Upload
madi-bidin
View
219
Download
0
Embed Size (px)
Citation preview
SCHOOL OF MATHEMATICAL SCIENCESUNIVERSITI SAINS MALAYSIA
MSG 389: ENGINEERING COMPUTATION IISemester 2, Academic Session 2013/2014
ASSIGNMENTGROUP: 4b (Adam-Bashfort)
LECTURER:
DR.SARATHA A/P SATHASIVAM
NAME
IC NUMBER
MATRIC NUMBER
1. MARINA AISHAH BINTI MOHAMAD 921027-11-5534 112556
2.MAZIATUL ATHIRAH LONG HUSSIN 921026-11-5938 112557
3.MARDHIYANA BINTI ABIDIN 921116-12-5216 112555
DATE OF SUBMISSION: 31st March 2014
2.
(b) Find an approximate value of y (1.5) for the initial value problem
y '=x2+ y2 , y (1 )=0
using the multistep method
y i+1 = y i+h
12¿)
with h=0.1 . Calculate the starting values using third order Taylor series
method with the same step length, h .
[40 marks]
SOLUTION 2(b)
Initial value problem,
y '=x2+ y2 , y (1 )=0
Using the multistep method,
y i+1 = y i+h
12¿)
y i+3= y i+2+h
12(23 f i+2−16 f i+ 1+5 f i)
i=0 : y3= y2+h
12(23 f 2−16 f 1+5 f 0)
For starting values, using third order Taylor series method :
y j+1= y j+h y j' + h
2
2y j' '+ h
3
6y j' ' '
We have : y '=x2+ y2, y ' '=2 x+2 y y' , y ' ' '=2+2 yy ' '+2¿
For h=0.1,
j=0 : x0=1 , y0=0 , y0'=1 , y0
' '=2 , y0' ' '=4
y1≅ y (1.1 )= y0+h y0' + h
2
2y0' '+ h
3
6y0' ' '
¿0+( 0.1 )1+ 0.12
2(2 )+ 0.13
6(4 )
¿0.11067
j=1: x1=1.1 , y1=0.11067 , y1'=1.22225 , y1
' '=2.47053 , y1' ' '=5.53462
y2≅ y (1.2 )= y1+h y1' + h
2
2y1' '+ h
3
6y1' ' '
¿0.11067+(0.1 )1.22225+ 0.12
2(2.47053 )+ 0.13
6(5.53462 )
¿0.24617
Then, use multistep method,
x0=1 , y0=0 , f 0=x02+ y0
2=1
x1=1.1 , y1=0.11067 , f 1=x12+ y1
2=1.22225
x2=1.2 , y2=0.24617 , f 2=x22+ y2
2=1.50060
For i=0 :
y3≅ y (1.3 )= y2+h
12 (23 f 2−16 f 1+5 f 0 )
¿ 0.24617+ 0.112
(23 (1.50060 )−16 (1.22225 )+5(1))
¿0.41249
For i=1 :
x3=1.3 , y3=0.41249 , f 3=x32+ y3
2=1.86015
y4≅ y (1.4 )= y3+h
12 (23 f 3−16 f 2+5 f 1 )
¿ 0.41249+ 0.112
(23 (1.86015 )−16 (1.50060 )+5(1.22225))
¿0.61987
For i=2:
x4=1.4 , y4=0.61987 , f 4=x42+ y4
2=2.34424
y5≅ y (1.5 )= y4+h
12 (23 f 4−16 f 3+5 f 2 )
¿ 0.61987+ 0.112
(23 (2.34424 )−16 (1.86015 )+5(1.50060))
¿0.88369
∴ y5≅ y (1.5 )=0.88369
SOLUTION 1(a)
( 3 1 −12 4 1
−1 2 5 )(UVW )=(411)withinitial value(X1
X2
X3)=(000)up¿6iterations .
3 X1+X2−X3=42 X1+4 X2+X3=1
−X1+2 X2+5 X3=1
X1=13 (4−X2+X3 )
X2=14 ( 1−2 X1−X 3 )
X3=15 (1+X1−2 X2 )
i) Jacobi Iteration Method
K=0 X1=0X2=0X3=0
K=1 X1=13 (4−(0 )+(0))=1.333333
X2=14 (1−2 (0 )−(0))=0.25
X3=15 (1+(0)−2(0))=0.2
K=2 X1=13 (4−(0.25 )+ (0.2 ) )=1.316667
X2=14 (1−2 (1.333333 )−(0.2))=−0.466667
X3=15 (1+(1.333333)−2(0.25))=0.366667
K=3 X1=13 (4−(−0.466667 )+(0.366667 ) )=1.611111
X2=14 (1−2 (1.316667 )−(0.366667))=−0.50
X3=15 (1+(1.316667)−2 (−0.466667))=0.276667
K=4 X1=13 (4−(−0.50 )+ (0.276667 ) )=1.592222
X2=14 (1−2 (1.611111)−(0.276667))=−0.624722
X3=15 (1+(1.611111)−2(−0.50))=0.722222
K=5 X1=13 (4−(−0.624722)+ ( 0.722222) )=1.782315
X2=14 (1−2 (1.592222 )−(0.722222))=−0.726667
X3=15 (1+(1.592222)−2(−0.624722))=0.806352
K=6 X1=13 (4−(−0.726667 )+(0.806352 ) )=1.844340
X2=14 (1−2 (1.782315 )−(0.806352))=−0.842746
X3=15 (1+(1.782315)−2(−0.726667))=0.847130
OR
k X1 X2 X3
0 0 0 01 1.333333 0.25 0.22 1.316667 -0.466667 0.3666673 1.611111 -0.50 0.2766674 1.592222 -0.624722 0.7222225 1.782315 -0.726667 0.806352
6 1.844340 -0.842746 0.847130
∴ X1≈2
X2≈−1
X3≈1
ii) Gauss-Seidel Method
K=0 X 1=0X2=0X3=0
K=1 X1=13 (4−(0 )+(0))=1.333333
X2=14 (1−2 (1.333333 )−(0))=−0.416667
X3=15 (1+(1.333333)−2(−0.416667))=0.633333
K=2 X1=13 (4−(−0.416667 )+(0.633333))=1.683333
X2=14 (1−2 (1.683333 )−(0.633333))=−0.75
X3=15 (1+(1.683333 )−2 (−0.75 ) )=0.836667
K=3 X1=13 (4−(−0.75 )+(0.836667))=1.862222
X2=14 (1−2 (1.862222 )−(0.836667))=−0.890278
X3=15 (1+ (1.862222 )−2 (−0.890278 ) )=0.928556
K=4 X1=13 (4−(−0.890278 )+(0.928556))=1.939611
X2=14 (1−2 (1.939611 )−(0.928556))=−0.951945
X3=15 (1+ (1.939611)−2 (−0.951945 ))=0.968700
K=5 X1=13 (4−(−0.951945 )+(0.968700))=1.973548
X2=14 (1−2 (1.973548 )−(0.968700))=−0.978949
X3=15 (1+ (1.973548 )−2 (−0.978949 ) )=0.986289
K=6 X1=13 (4−(−0.978949 )+(0.986289))=1.988413
X2=14 (1−2 (1.988413 )−(0.986289))=−0.990779
X3=15 (1+(1.988413 )−2 (−0.990779 ) )=0.993994
OR
k X1 X2 X3
0 0 0 01 1.333333 -0.416667 0.6333332 1.683333 -0.75 0.8366673 1.862222 -0.890278 0.9285564 1.939611 -0.951945 0.9687005 1.973548 -0.978949 0.9862896 1.988413 -0.990779 0.993994
∴ X1≈2
X2≈−1
X3≈1
SOLUTION 3(a)
(12 7 31 5 12 7 −11)(
X1
X2
X3)=( 2
−56 ) , initial value(X1
X2
X3)=(135)after3 iterations .
Gauss-Seidel Method :
12 X1+7 X2+3 X3=2X1+5 X2+X 3=−5
2 X1+7 X2−11 X3=6
X1=1
12 ( 2−7 X2−3 X3 )
X2=15 (−5−X1−X3 )
X3=−111 (6−2X 1−7 X2 )
K=0 X1=1X2=3X3=5
K=1 X1=1
12 (2−7(3)−3(5))=−2.833333
X2=15 (−5− (−2.833333 )−(5))=−1.433333
X3=−111 (6−2(−2.833333)−7(−1.433333))=−1.972727
K=2 X1=1
12 (2−7(−1.433333)−3 (−1.972727))=1.495959
X2=15 (−5− (1.495959 )−(−1.972727))=−0.904646
X3=−111 (6−2(1.495959)−7(−0.904646))=−0.849146
K=3 X1=1
12 (2−7(−0.904646)−3(−0.849146))=0.906663
X2=15 (−5− (0.906663 )−(−0.849146))=−1.011503
X3=−111 (6−2(0.906663)−7(−1.011503 ))=−1.024290
OR
k X1 X2 X3
0 1 3 51 -2.833333 -1.433333 -1.972727
2 1.495959 -0.904646 -0.8491463 0.906663 -1.011503 -1.024290
∴ X1≈1
X2≈−1
X3≈−1
Additional Questions.
Compute the solution of
y ' '−(0.1 ) (1− y2 ) y '+ y=0
with initial values y (0 )=1 , y ' (0 )=0 up to the third zero of y (t ). Use the Runge-Kutta(4th order) formulas for two first order equations.
Solution :
Convert into two system of first order differential equationLet y=z1∧ y’=z2
z2=z1’
y ”=z2’=(0.1)(1− y2) y ’ – y=(0.1)(1−z12)z2−z1
Therefore, we got
z '=f ( z )=[ z1 'z2 ' ]=[ z2
(0.1 ) (1−z12 ) z2−z1] , where z (0 )=[10]
The formula for Runge – Kutta 4th order method
zi+1 = zi + (h/6)(k1 + 2k2 + 2k3 + k4) where
k1 = f( ti , zi )k2 = f( ti + (h/2) , zi + (hk1)/2 )k3 = f( ti + (h/2) , zi + (hk2)/2 )k4 = f( ti + h , zi + hk3 )
For i=0, z0=[10]
k1=f (¿, [10 ])=[ 0(0.1 ) (1−12 ) (0 )−1]=[ 0
−1]
k 2=f (¿, [10 ]+ 0.12 [ 0
−1])=f (¿ ,[ 1−0.05])
¿ [ −0.05(0.1 ) (1−12 ) (−0.05 )−1]
¿ [−0.05−1 ]
k3=f (¿, [10]+ 0.12 [−0.05
−1 ])=f (¿, [0.9975−0.05 ])
¿ [ −0.05(0.1 ) (1−0.99752 ) (−0.05 )−0.9975]
¿ [ −0.05−0.997525]
k 4=f (¿ ,[10]+0.1[ −0.05−0.997525])=f (¿, [ 0.995
−0.099753])
¿ [ −0.099753(0.1 ) (1−0.9952 ) (−0.099753 )−0.995]
¿ [−0.099753−0.995100]
So,
z1=¿ [10] + 0.16
¿) = [ 0.995004−0.099835]
For i=1, z1=[ 0.995004−0.099835]
k1 ¿ f (__,[ 0.995004−0.099835]
¿ [ −0.099835(0.1 ) ( 1−0.9950042) (−0.099835 )−0.995004 ]
¿ [−0.099835−0.995104]
k 2=f (__,[ 0.995004−0.099835]+ 0.1
2 [[−0.099835−0.995104]]) = f (__,[ 0.990012
−0.149590])
¿ [ −0.149590(0.1 ) ( 1−0.9900122 ) (−0.149590 )−0.990012]
¿ [−0.149590−0.990309]
k3 ¿ f (__,[ 0.995004−0.099835]+0.1
2 [−0.149590−0.990309]) = f (__,[ 0.987525
−0.149350])
¿ [ −0.149350(0.1 ) ( 1−0.9875252 ) (−0.149350 )−0.987525]
¿ [−0.149350−0.987895]
k 4 ¿ f (__,[ 0.995004−0.099835]+0.1[−0.149350
−0.987895]) = f (__,[ 0.980069−0.198625])
¿ [ −0.198625(0.1 ) (1−0.9800692 ) (−0.198625 )−0.980069]
¿ [−0.198625−0.980853]
So,
z2 ¿ [ 0.995004−0.099835]+
0.16
¿)
¿ [ 0.980065−0.198708]
For i=2, z2=[ 0.980065−0.198708]
k1 ¿ f (__,[ 0.980065−0.198708]
¿ [ −0.198708(0.1 ) (1−0.9800652 ) (−0.198708 )−0.980065]
¿ [−0.198708−0.980849]
k 2 ¿ f (__,[ 0.980065−0.198708]+ 0.1
2 [−0.198708−0.980849]) = f (__,[ 0.970130
−0.247750])
¿ [ −0.247750(0.1 ) ( 1−0.9701302 ) (−0.247750 )−0.970130]
¿ [−0.247750−0.971588]
k3 ¿ f (__,[ 0.980065−0.198708]+0.1
2 [[−0.247750−0.971588]]) =f (__,[ 0.967678
−0.247287])
¿ [ −0.247287(0.1 ) ( 1−0.9676782 ) (−0.247287 )−0.967678]
¿ [−0.247287−0.969251]
k 4 ¿ f (__,[ 0.980065−0.198708]+0.1[[−0.247287
−0.969251]]) =f (__,[ 0.955336−0.295633])
¿ [ −0.295633(0.1 ) (1−0.9553362 ) (−0.295633 )−0.955336 ]
¿ [−0.295633−0.957918]
So,
z3=¿ [ 0.980065−0.198708]+
0.16
¿
+[−0.295633−0.957918])
¿ [ 0.955325−0.295715]
∴ z3=[ 0.955325−0.295715] .