written 7.2 years ago by | modified 4.9 years ago by |
Solve the following differential equation using Galerkin Method
d2ϕdx2+cosπx=00≤x≤1
Boundary conditions are ϕ(0)=0ϕ(1)=0
Find ϕ(0.25),ϕ(0.5)&ϕ(0.75).
Compare your answers with exact solution.
written 7.2 years ago by | modified 4.9 years ago by |
Solve the following differential equation using Galerkin Method
d2ϕdx2+cosπx=00≤x≤1
Boundary conditions are ϕ(0)=0ϕ(1)=0
Find ϕ(0.25),ϕ(0.5)&ϕ(0.75).
Compare your answers with exact solution.
written 7.1 years ago by | • modified 7.1 years ago |
Given differential equation d2ϕdx2+cosπx=0 where 0≤x≤1 with boundary conditions ϕ(0)=0;ϕ(1)=0
Approximate solution is given by,
ϕ=C0+∑[Cisin(π2(2i−1)x)] ......(0)
At x = 0, ϕ=0,∴C0=0∴ϕ=∑[Cisin(π2(2i−1)x)]
Since the order of D.E is 2, so i will be of order 3
∴ϕ=C1sin(πx2)+C2sin(3πx2)+C3sin(5πx2)
At x = 1, ϕ=0
∴0=C1−C2+C3∴C2=C1+C3
Equation (1) becomes,
ϕ=C1sin(πx2)+(C1+C3)sin(3πx2)+C3sin(5πx2)ϕ=C1[sin(πx2)+sin(3πx2)]+C3[sin(3πx2)+sin(5πx2)]
Differentiating the above equation, we get,
dϕdx=C1π2[cos(πx2)+3cos(3πx2)+C3π2[3cos(3πx2)+5cos(5πx2)
Again differentiating above equation, we get,
d2ϕdx2=−C1π44(sinπx2+9sin3πx2)−C3π24(9sin3πx2+25sin5πx2)
Residual function is given by,
−d2ϕdx2−cosπx=R
Substituting the value of (−d2ϕdx2) in above equation, we get,
π44[C1(sinπx2+9sin3πx2)+C3(9sin3πx2+25sin5πx2)]−cosπx=R
Weighted Integral form,
∫10wiRdx=0
wi = coefficient of constant from ϕ
For i = 1, w1=sinπx2+sin3πx2∴π24∫10(sinπx2+sin3πx2)[C1(sinπx2+9sin3πx2)+C3(9sin3πx2+25sin5πx2)−cosπx]dx=05C1+2.84C3−0.069=05C1+2.84C3=0.069.....(A)
For i = 2, w2=sin3πx2+sin5πx2C1∫10(sin3πx2+sin5πx2)(sinπx2+sin3πx2)dx+C3∫10(sin3πx2+sin5πx2)(9sin3πx2+25sin5πx2)dx−∫10(sin3πx2+sin5πx2)cosπxdx=03.9C1+14.75C3−0.207=0∴3.9C1+14.75C3=0.207.....(B)
Solving (A) and (B), we get,
C1 = 0.0069 and C3 = 0.0122
Approximate solution is given by,
ϕ=0.0069(sinπx2+sin3πx2)+0.0122(sin3πx2+sin5πx2)
i) At x = 0.25; ϕ = 0.02210
ii) At x = 0.5; ϕ = 0.03155
iii) At x = 0.75; ϕ = 0.0249
Exact solution:
−d2ϕdx2−cosπx=0i.e.−d2ϕdx2=cosπx
Integrating above equation, we get,
−dϕdx=−sinπxπ+C1
Again integrating, we get,
−ϕ=−cosπxπ2+C1x+C2C2=1π2
Imposing boundary condition
At x = 0; ϕ = 0
0=−1π2+C21π2=C2
∴−ϕ=−cosπxπ2+C1x+1π2
At x = 1; ϕ1 = 0
∴0=1π2+C1+1π2C1=−2π2∴−ϕ=−cosπxπ2−2xπ2+1π2∴ϕ=cosπxπ2+2xπ2−1π2
At x = 0.25; ϕ = 0.0207
At x = 0.5; ϕ = 0
At x = 0.75; ϕ = - 0.02098