American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #5
American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #5
American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #5
College of Engineering
ⅆ2T
−0. 15T =0
ⅆ x2
L=10 h=2 (step size = 2) – T(0) = 240, T(10) = 150
ⅆT
=z = f1(xi,Ti,zi )
ⅆx
ⅆz d ⅆT
=
ⅆx ⅆx ⅆx ( )
=0 . 15 T = f2(xi,Ti,zi ),
T i+1=T i+ f 1 ( xi , T i , zi ) h
z i+1=z i + f 2 ( x i ,T i , z i ) h
MATLAB
2)a)
T’’ = f(x,T,T’ )
T(0) = 240, T(10) = 150
T i−1−2 T i+T i+1
=f ¿) , i = 1,2, …, 10
h2
T1 = 240
T10 = 150
T1 = T(0) = 240
– 2.15T2 + T3 = -240
T2 – 2.15T3 + T4 = 0
T3 – 2.15T4 + T5 = 0
T4 - 2.15T5 + T6 = 0
T5 - 2.15T6 + T7 = 0
T6 - 2.15T7 + T8 = 0
T7 - 2.15T8 + T9 = 0
T8 - 2.15T9 = -150
2)b)
Discussion:
It can be seen from both tables that using the shooting method (using Euler method) is indeed less
accurate than finite difference method, as seen from the absolute error, which shows comparison between the
analytical solution and estimated ones.