Professional Documents
Culture Documents
HW 1
RAHUL ALAM
ME15BTECH11030
Ans:
u = up + uh . up = particular solution, uh = homogeneous solution
First we will find uh .
d2 u
For that we have to consider, dx2
+u = 0
So, the homogeneous solution is, uh = Acos(x) + Bsin(x)
The RHS of the equation is constant. So, for particular solution, we can up = k.
So, up ll = 0 and from the given differential we get k = 1.
So, the analytical solution is,
u = Acos(x) + Bsin(x) + 1
Now from Boundary conditions,
At x = 0 ,
1 = A+0+1 ⇒A = 0
At x = 1 ,
−1
0 = Bsin(1) + 1 ⇒ B = sin(1)
Ans.
u(0) = 1 = a0
u(1) = 1 + a1 + a2 = 0 ⇒ a1 = − a2 − 1
Now we apply MWR (Method of weighted residue) to find the approximate solutions.
We will use the below 5 methods to find approximate solutions. Also we will find the RMS
√
1
error for each approximate function using , RMS error = ∫(u − u) 2 dx
0
a) Collocation method:
√
1
error for each approximate function using , RMS error = ∫(u − u) 2 dx
0
a) Collocation method:
And we have R(xi ) = 0 at 2 point b/w 0 and 1. We choose xi = 0.25 and xi = 0.5 .
29 81 1
R(0.25) = 0 ⇒ 16 b2 + 64 b3 = 4
7 21 1
R(0.5) = 0 ⇒ b
4 2
+ b
8 3
= 2
⇒ u = 1 − x + 0.0216(x2 − x ) + 0.1707(x3 − x)
and RMS error = 0.00019
v) Method of moments:
1
1 2
i
W = x , i = DOF ⇒ W 1 = x , W 2 = x and ∫ W Rdx = 0
0
1
11 28 1
W1 = x ⇒ ∫ x[− x + b2 (x2 − x + 2) + b3 (x3 + 5x)]dx = 0 ⇒ b
12 2
+ b
15 3
= 3
0
1
37 17 1
W2 = x 2
⇒ ∫ x 2 [− x + b2 (x2 − x + 2) + b3 (x3 + 5x)]dx = 0 ⇒ b
60 2
+ b
12 3
= 4
0
⇒ u = 1 − x + 0.0376(x2 − x ) + 0.1600(x3 − x)
and RMS error = 0.00042
Here is the code for comparing all the approximate and analytical plots.