Professional Documents
Culture Documents
Given that
a) Using analytical method, determine the solution u (x,t).
b) Using numerical method - explicit method, determine the magnitude of
vibration for t = 0.5, 1.0, 1.5, 2.0, 2.5, 3.0 taking h = 0.2 and k = 0.5.
Compare the answers with analytical method. [50 marks]
Question 2
a) Using analytical method, solve the Poisson Equation for the following Figure 1
with the given data,
Figure 1
Take a = 2, b = 1.
Solve (a) with numerical method and compare the answer for each node. Taking the
mesh size h
= k = 0.2
b) Solve the heat problem by the explicit method with h = 0.2 and k = 0.01, 6 time c2 = 1.0
steps.
with both ends kept at zero temperature.
Question 1a
a)
(, ) = ( + ) ; =
=1
2 2
= () ; = ()
0 0
From the question, initial velocity () = 0 because vibrate from rest. So, is also
0. The equation then simplified to:
(, ) = ( ) ; =
=1
1
= 1 =
1 1
() = 0
5 5
(1 ) 1
() = 1
20 5
2
= ()
0
1
1 (1
2 51 )
= [ + ]
1 0 5 1 1 20 1
5
0.2 1
2 () () 1 () () ()
= [ 2
] + [ ]
5 () 10 ()2
0 0.2
2 (0.2) 0.2(0.2)
= [ ]
5 ()2
1 () () (0.2) 0.2(0.2)
+ [ +
10 ()2
(0.2)
+ ]
0.4(0.2) 0.08(0.2) 0.1(0.2) 0.02(0.2)
= +
()2 ()2
0.1(0.2)
+
0.5(0.2)
=
()2
=
1
=
1
(, ) = ( )
=1
0.5(0.2)
= ()()
()2
=1
(0.6)
+ (3)(3)]
(3)2
Calculations:
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (0)(0.6)]
(3)2
= 0.03405
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (0)(1.2)]
(3)2
= 0.03247
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (0)(1.8)]
(3)2
= 0.01809
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (0)(2.4)]
(3)2
= 0.01115
= .
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (1.5)(0.6)]
(3)2
= 0.02191
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (1.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.00901
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (7.5)(1.2)]
(3)2
= 0.02177
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (7.5)(1.8)]
(3)2
= 0.02579
0.5 (0.2) (0.4)
(0.8,2.5) = [ ()() + (2)(2)
2 (1)2 (2)2
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (7.5)(2.4)]
(3)2
= 0.01551
= .
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (9.0)(0.6)]
(3)2
= 0.01097
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (9.0)(1.2)]
(3)2
= 0.01837
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (9.0)(1.8)]
(3)2
= 0.03197
0.5 (0.2) (0.4)
(0.8,3.0) = [ ()() + (2)(2)
2 (1)2 (2)2
(0.6)
+ (3)(3)]
(3)2
(0.6)
+ (9.0)(2.4)]
(3)2
= 0.03297
Tabulation of results:
i= 0 1 2 3 4 5
x= 0 0.2 0.4 0.6 0.8 1
j= t=
0 0 0 0.03405 0.03247 0.01809 0.01115 0
1 0.5 0 0.02191 0.02846 0.02081 0.00953 0
2 1 0 -0.00035 0.01548 0.02137 0.00919 0
3 1.5 0 -0.01118 -0.00434 0.00968 0.01151 0
4 2 0 -0.00989 -0.01944 -0.01018 0.0051 0
5 2.5 0 -0.00901 -0.02177 -0.02579 -0.01551 0
6 3 0 -0.01097 -0.01837 -0.03197 -0.03297 0
Graph:
0.03 0s
0.02 0.5 s
0.01 1.0 s
0 1.5 s
0 0.2 0.4 0.6 0.8 1 1.2
-0.01 2.0 s
-0.02 2.5 s
-0.03 3.0 s
-0.04
Position, x
Question 1b)
(, + 1) = 2(, ) (, 1) + 2 [( + 1, ) 2(, ) + ( 1, )]
1
(, 1) = (1 2 ) + 2 (+1 + 1 ) +
2
=
1 0.5
=
0.2
2.5
=
2 = 0.63326
1
1 = (0.2)
5
= 0.04
1 0.4
2 =
20
= 0.03
1 0.6
3 =
20
= 0.02
1 0.8
4 =
20
= 0.01
1
(, 1) = (1 2 ) + 2 (+1 + 1 ) + , = 0
2
1
(, 1) = (1 2 ) + 2 (+1 + 1 )
2
When = 1:
1
(1,1) = (1 2 )1 + 2 (1+1 + 11 )
2
1
= (1 0.63326)(0.04) + (0.63326)(0.03 + 0)
2
= 0.02417
When = 2:
1
(2,1) = (1 2 )2 + 2 (2+1 + 21 )
2
1
= (1 0.63326)(0.03) + (0.63326)(0.02 + 0.04)
2
= 0.03
When = 3:
1
(3,1) = (1 2 )3 + 2 (3+1 + 31 )
2
1
= (1 0.63326)(0.02) + (0.63326)(0.01 + 0.03)
2
= 0.02003
When = 4:
1
(4,1) = (1 2 )4 + 2 (4+1 + 41 )
2
1
= (1 0.63326)(0.01) + (0.63326)(0 + 0.02)
2
= 0.01
For = 1 ; = 1:
For = 2 ; = 1:
For = 3 ; = 1:
For = 4 ; = 1:
For = 1 ; = 2:
For = 2 ; = 2:
For = 3 ; = 2:
For = 4 ; = 2:
For = 1 ; = 3:
(1,4) = 2(1,3) (1,2) + 2 [(2,3) 2(1,3) + (0,3)]
= 2(0.01391) + 0.00327 + 0.63326[0.00468 2(0.01391) + 0]
= 0.00990
For = 2 ; = 3:
For = 3 ; = 3:
For = 4 ; = 3:
For = 1 ; = 4:
For = 2 ; = 4:
For = 3 ; = 4:
For = 4 ; = 4:
For = 1 ; = 5:
For = 2 ; = 5:
For = 3 ; = 5:
For = 4 ; = 5:
i= 0 1 2 3 4 5
x= 0 0.2 0.4 0.6 0.8 1
j= t=
0 0 0 0.04 0.03 0.02 0.01 0
1 0.5 0 0.02417 0.03 0.02003 0.01 0
2 1 0 -0.00327 0.01999 0.0201 0.00988 0
3 1.5 0 -0.01391 -0.00468 0.01369 0.01005 0
4 2 0 -0.0099 -0.02356 -0.00666 0.00606 0
5 2.5 0 -0.00827 -0.02309 -0.02966 -0.00982 0
6 3 0 -0.01097 -0.0174 -0.03593 -0.03205 0
Graph:
0s
0.02
0.5 s
0.01
1.0 s
0
1.5 s
-0.01 0 0.2 0.4 0.6 0.8 1 1.2
2.0 s
-0.02
-0.03 2.5 s
-0.04 3.0 s
-0.05
Position, x
Percentage Difference between two Methods:
% (, ) = | | 100%
0.03405 0.04
(1,0) = | | 100%
0.03405
= 17.47%
0.03247 0.03
(2,0) = | | 100%
0.03247
= 7.61%
0.01809 0.02
(3,0) = | | 100%
0.01809
= 10.56%
0.01115 0.01
(4,0) = | | 100%
0.01115
= 10.31%
0.02191 0.02417
(1,1) = | | 100%
0.02191
= 10.31%
0.02846 0.03
(2,1) = | | 100%
0.02846
= 5.41%
0.02081 0.02003
(3,1) = | | 100%
0.02081
= 3.75%
0.00953 0.01
(4,1) = | | 100%
0.00953
= 4.93%
0.00035 + 0.00327
(1,2) = | | 100%
0.00035
= 834.29%
0.01548 0.01999
(2,2) = | | 100%
0.01548
= 29.13%
0.02137 0.0201
(3,2) = | | 100%
0.02137
= 5.94%
0.00919 0.00988
(4,2) = | | 100%
0.00919
= 7.51%
0.01118 + 0.01391
(1,3) = | | 100%
0.01118
= 24.42%
0.00434 + 0.00468
(2,3) = | | 100%
0.00434
= 7.83%
0.00968 0.01369
(3,3) = | | 100%
0.00968
= 41.43%
0.01151 0.01005
(4,3) = | | 100%
0.01151
= 12.68%
0.00989 + 0.00990
(1,4) = | | 100%
0.00989
= 0.10%
0.01944 + 0.02356
(2,4) = | | 100%
0.01944
= 21.19%
0.01018 + 0.00666
(3,4) = | | 100%
0.01018
= 34.58%
0.00510 0.00606
(4,4) = | | 100%
0.00510
= 18.82%
0.00901 + 0.00827
(1,5) = | | 100%
0.00901
= 8.21%
0.02177 + 0.02309
(2,5) = | | 100%
0.02177
= 6.06%
0.02579 + 0.02966
(3,5) = | | 100%
0.00989
= 15.01%
0.01551 + 0.00982
(4,5) = | | 100%
0.00989
= 36.69%
0.01097 + 0.01079
(1,6) = | | 100%
0.01097
= 1.64%
0.01837 + 0.01740
(2,6) = | | 100%
0.01837
= 5.28%
0.03197 + 0.03593
(3,6) = | | 100%
0.03197
= 12.39%
0.03297 + 0.03205
(4,6) = | | 100%
0.03297
= 2.79%
Discussion:
For the results, there are some differences between the answer obtained by the
two methods. However, the results obtained by numerical method will be more
accurate. As mentioned above, analytical method required lots of terms in summation
to get more accurate answer. This will be time consuming. Numerical method,
however, can use software to calculate. This can reduce the error and get more
accurate answer.
Analytical Method
(, ) = (, ) + (, )
(,) =
(, ) = 4 ; 1 () = 0 ; 2 () = 100 ; 1 () = 100 ; 2 () = 100 2
2
= 0 (1 () )
asinh( )
2
1 2
= 0 (0 )
sinh( )
2
1 (, ) =
=1 sinh( )( )
1 (, ) =
=1 (0) sinh( )( )
(, ) =
2
= 0 (2 ()
)
( )
2 2
= 0 (100 )
2( )
100 2 2
= [ ]
( ) 2 0
2
100 2 2
= [ ]
( )
2
200
= ( 1) n = 1, 3, 5,.
( )
2
2 (, ) =
=1 ( )
(, ) =
= ( ) ( )
( )
2
= 0 1 ()
( )
2 1
= 0 (100)
( )
0
200 1
= [ () + ()2 ()]10
(2)
()
= () n = 1, 2, 3, 4....
()
3 (, ) =
=1 sin( )
()
(, ) =
= ( ()) ( )
2
= 0 2 ()
bsinh( )
200 1
= sinh(2) 0 sin( 2 )
1
integration by parts:
1 1 1 1
0 ( 2 ) = [ 0 +
] +
1 2 22 2 0
1 1
0 42 ( 2 ) 1
1 1 1
(1 42 ) 0 ( 2 ) =
1 4
0 ( 2 ) = (42 1)
200 4 ()
= (2) (42 1) = ( )()
4 (, ) =
=1 sin( )()
()
(, ) =
= ( )()
Finally,
(, ) = 1 (, ) + 2 (, ) + 3 (, ) + 4 (, )
200
(, ) = 0 +
=1 ( ( 1)) ( )+
( ) 2 2
2
=1 ( ) sinh (2 ) si n +
=1
(2) (42 )(2)
= ,
(, ) = 4
4
= 0 0 (, )
4 1 2
= 2 0 0 (4) sin()
2
2 1 2
= 0 (4 sin()) 0 ( 2
)
2 1 2 4 2
=
0 (4 sin()) [ ( 2
)+
2 2
2
]
0
0
1
2 4 4
= (4
0
sin()) [ () + 2 2 sin()]
2 4 1
= [ ( ()) 4] 0 ( sin())
32 1 1
= [( ())] [ () + 2 2 sin ]
0
0
32 1 1
= ( ()) [ () + 2 2 sin ]
32
= ( 2
()cos()) m,n = 1, 2, 3, 4,....
2 2
= ( ) +( )
2
= ( ) + ()2
2
= (
()()) m,n =1, 2, 3, 4,....
[( ) +() ]
(, ) =
=1 =1 ( ) ( )
32
(, ) =
=1 =1 ( 2
()co s()) ( ) ()
[( ) +()2 ] 2 2
2
(, ) = (, ) + (, ) (, ) =
32
=1 =1 ( 2
()co s()) ( ) () + 0 +
[( ) +()2 ] 2 2
2
200
=1 ( ( 1)) ( )+
( ) 2 2
2
200() 800()
=1 ( ) (2 ) sin ny +
=1
(2) (42 )(2)
800()
(4)(2)
11 (, ) = 0.262809 ( 2 ) () + 0 + 55.3270 sin ( 2 ) +
2
By using Excel, we obtain the solution for each point for U11(x,y)
1 100 100 100 100 100 100 100 100 100 100
0.8 80 47.6426 63.3632 78.4204 88.9780 92.9363 89.7023 80.1643 66.8382 54.2661
0.6 60 51.0322 52.9641 58.6737 63.7801 66.0579 64.9519 61.4954 58.5865 61.7490
0.4 40 43.8882 39.3754 39.9705 41.7932 42.9395 42.9649 42.7921 44.9977 54.6049
0.2 20 25.4997 21.2449 20.4496 20.8293 21.2804 21.5535 22.1934 24.7197 32.1230
0 0 0 0 0 0 0 0 0 0 0
y/x 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
Numerical Method
= 0.2
1
{1 4 1} = 2 (, )
1
( , 0) = 0
( , 5) = 100
(0 , ) = 100
(10 , ) = 100
2
Sample calculation,
= 2.40802 1019
1 = 4.81842 1020
2 = 9.63515 1020
3 = 1.44497 1021
4 = 1.92635 1021
1 4.81842 1020
(1,1) = = = 20.0099
2.40802 1019
(1,2) = 40.01275
(1,3) = 60.00648
(1,4) = 79.99731
Substitute the values of (1,1), (1,2), (1,3) and (1,4) to the equations above to find others (, ) using Excel
u(i,j) i 0 1 2 3 4 5 6 7 8 9 10
x 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
j y
0 0 0 0 0 0 0 0 0 0 0 0 0
1 0.2 20 20.0099 20.0333 20.0886 20.2060 20.4384 20.8790 21.6921 23.1683 25.8449 30.9017
2 0.4 40 40.0127 40.0474 40.1342 40.3228 40.7007 41.4237 42.7660 45.1872 49.3584 58.7785
3 0.6 60 60.0065 60.0351 60.1163 60.3014 60.6817 61.4261 62.8507 65.5585 70.7380 80.9017
4 0.8 80 79.9973 80.0084 80.0524 80.1615 80.3947 80.8635 81.7867 83.6116 87.3062 95.1057
5 1 100 100 100 100 100 100 100 100 100 100 100
Values
(, 0) = 0, (, 5) = 100
(8,1) = 23.1683
(8,2) = 45.1872
(8,3) = 65.5585
(8,4) = 83.6116
(9,1) = 25.8449
(9,2) = 49.3584
(9,3) = 70.7380
(9,4) = 87.3062
(10,1) = 30.9017
(10,2) = 58.7785
(10,3) = 80.9017
(10,4) = 95.1
Percentage Error
For this part of the calculation, U11(0.2,0.2) will be used as an example for the
calculation
= 100%
25.499 20.001
= 100%
25.499
= . %
1 0 0 0 0 0 0 0 0 0 0 0
0.8 0 67.91123 26.26942 2.081009 9.908663 13.49485 9.853517 2.023729 25.09563 60.88541 0.00003
0.6 0 17.58546 13.35045 2.458598 5.454315 8.138718 5.428375 2.203974 11.90032 14.55733 0.00006
0.4 0 8.830307 1.706631 0.409299 3.518364 5.213995 3.587175 0.060956 0.420966 9.60819 0.00007
0.2 0 21.52882 5.703399 1.765544 2.992069 3.956611 3.129363 2.258812 6.276296 19.54372 0.00008
0 0 0 0 0 0 0 0 0 0 0 0
399.1118
= = . %
40
Discussion
As we compare the result for this Poisson problem, the result obtained from
using analytical method and the result obtained using numerical method has a slight
difference.
The percentage error of the entire solution for each respective U(x,y) is
calculated. Also, the overall percentage error of the solution is also calculated to be
9.98%.
1
() = 0
2
1
() = 1 1
2
= 0.2
= 0.01
2 = 1
(, + 1) = ( 1, ) + (1 2)(, ) + ( + 1, )
Where, = 2 2
0.01
= 1 ( 2 ) = 0.25
0.2
As both end kept at zero temperature, hence (0, ) and (5, ) = 0
Sample calculation
When,
= 0.2
i= 0 1 2 3 4 5
j= x= 0 0.2 0.4 0.6 0.8 1
0 f(x)/u(i, 0) 0 0.2 0.4 0.4 0.2 0
1 u(i, 1) 0 0.2 0.35 0.35 0.2 0
2 u(i, 2) 0 0.1875 0.3125 0.3125 0.1875 0
3 u(i, 3) 0 0.1719 0.2813 0.2813 0.1719 0
4 u(i, 4) 0 0.1563 0.2539 0.2539 0.1563 0
5 u(i, 5) 0 0.1416 0.2295 0.2295 0.1416 0
6 u(i, 6) 0 0.1282 0.2075 0.2075 0.1282 0
Values (1,5) = 0.1416
(4,0) = 0.2
(1,6) = 0.1282
(4,1) = 0.2
(1,2) = 0.1875
(2,2) = 0.3125
(3,2) = 0.3125
(4,2) = 0.1875
(1,3) = 0.1719
(2,3) = 0.2813
(3,3) = 0.2813
(4,3) = 0.1719
(1,4) = 0.1563
(2,4) = 0.2539
(3,4) = 0.2539
(4,4) = 0.1563