American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

American University of Sharjah

College of Engineering

NGN 509 – Computational Methods


Professor Nai-Shyong Yeh
Assignment #5

Mostafa Mohamed Moussa - 59665

Submitted on 5th of May 2019


(1)a)

ⅆ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 ),

Given: T(0) = 240


Guess: T’(0) = -50
(1)b)

Euler Method: y i+1 = y i+ y ' h

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

T i−1−2T i +T i +1=0.15 T h2 , h=1

T i+1=2 .15 T ih 2 −T i−1, h=1

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.

You might also like