Use a finite difference approach with Delta x 025 to solve
Use a finite difference approach with Delta x = 0.25 to solve d^2/dx^2 + u = x u(0) = 1 u(1) = 2 for 0 lessthanorequalto x lessthanorequalto 1.
Solution
using central difference approch
h=0.25 x=nh u0=1 u4=2
(un+1-2un+un-1)/h2 +u n=nh
for n=1;
(u2-2u1+ u0)/0.0625 + u0=0.25
u2-2u1=-1.046875---------------------(1)
for n=2
(u3-2u2+ u1)/0.0625 + u1=0.5
u3-2u2+1.0625u1 = 0.03125 --------------------(2)
for n=3
(u4-2u3+ u2)/0.0625 + u2=0.75
2u3+ u2 = -2.078125---------------------------(3)
solving equation 1 2 and 3 simultaneously , we get
u1 = 1.3306 u2 =1.6144 u3=1.8463
