Anda di halaman 1dari 17

Question 2.

𝑀2 𝑠𝑖𝑛2 (𝐵) − 1
𝑓(𝐵) = 2 cot(𝐵) − tan⁡(𝜃)
𝑀2 (𝛾 + cos(2𝐵)) + 2
When 𝛾 = 1.4, f(B) = 0 and 𝜃 = 0, tan⁡(𝜃) = 0 and hence the equation become:

𝑀2 𝑠𝑖𝑛2 (𝐵) − 1
2 cot(𝐵) =0
𝑀2 (1.4 + cos(2𝐵)) + 2
cos⁡(𝐵) 𝑀2 𝑠𝑖𝑛2 (𝐵) − 1
2( ) 2 =0
sin⁡(𝐵) 𝑀 (1.4 + cos(2𝐵)) + 2
cos⁡(𝐵)
To make sin⁡(𝐵) valid, sin⁡(𝐵) must not equal to zero, hence B ≠ 0.

𝑀 2 𝑠𝑖𝑛2 (𝐵)−1
To make 𝑀2 (1.4+cos(2𝐵))+2 valid,⁡𝑀2 (1.4 + cos(2𝐵)) + 2 must not equal to zero.

𝑀2 (1.4 + cos(2𝐵)) + 2 ≠ 0
2
(1.4 + cos(2𝐵)) ⁡ ≠ ⁡ − ⁡
𝑀2
1 2
𝐵⁡ ≠ ⁡ 𝑐𝑜𝑠 −1 (− 2 − 1.4)
2 𝑀
Hence, we can deduce that either cos(𝐵) = 0, in which 𝐵1 = 90.
1
Or, 𝑀2 𝑠𝑖𝑛2 (𝐵) − 1 = 0, in which 𝐵2 = arcsin⁡(𝑀).
1
Logically, 𝐵1 = 𝐵𝐿 while 𝐵2 = 𝐵𝑈 since arcsin⁡(𝑀) < 90.

Question 2.2
From graph above, we can deduce that the amplitude of f(𝐵𝑈 ) and f(𝐵𝐿 ) increases as M
increases while overall values of f(𝐵𝑈 ) and f(𝐵𝐿 ) decreases as 𝜃 increases. The approximate value of
𝜃𝑚𝑎𝑥 is 10 degree when M = 1.5 and 30 degree when M = 5.0.

Question 2.3

(a) The appropriate initial guess for 𝐵𝐿 = 35 and 𝐵𝑈 = 90. The outcome of C program
implementation is shown as below:

(b) According to output shown on appendix section, the output points are being plotted using
excel as shown below:

Theta Versus Beta Diagram For M=5.0


beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)

(c)
Theta Versus Beta Diagram For M=1.5
beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)

Theta Versus Beta Diagram For M=3.0


beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)
Theta Versus Beta Diagram For M=4.0
beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)

Theta Versus Beta Diagram For M=7.0


beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)
Theta Versus Beta Diagram For M=8.0
beta_lower beta_ upper

100

90

80

70

60
Beta(Ѳ)

50

40

30

20

10

0
0 5 10 15 20 25 30 35 40 45
Theta(Ѳ)

Question 3

 a1 b1 0 0  0   x1   Q1 
 c2 a2 b2 0  0  x  Q 
   2  2
 0 c3 a3 b3     x3   Q3 
    =  
             
 0  0 c N 1 a N 1 bN 1       
     
 0  0 0 cN a N   x N  QN 
𝑐
To eliminate 𝑐2 at 2nd row, first we multiply first row by 𝑎2 so that 𝑎1 can become 𝑐2 as shown below:
1

𝑏1 𝑐2 𝑐2
(𝑐2 𝑥1 + ⁡ 𝑥2 + 0 + 0 + ⋯⁡) = ⁡ 𝑄1
𝑎1 𝑎1
Next, we can eliminate 𝑐2 at 2nd row by minus with modified first row equation as shown below:

𝑏1 𝑐2 𝑐2
((𝑐2 − 𝑐2 )𝑥1 + ⁡ (𝑎2 − ) 𝑥2 + 0 + 0 + ⋯⁡) = ⁡ (𝑄2 − ⁡ 𝑄1 )
𝑎1 𝑎1

Similarly, we can eliminate 𝑐3 at 3rd row by minus with modified second row equation as shown
below:
𝑏2 𝑐3 𝑐3
(0 + ⁡ (𝑐3 − 𝑐3 )𝑥2 + ⁡ (𝑎3 − ) 𝑥3 + 0 + 0 + ⋯⁡) = ⁡ (𝑄3 − ⁡ 𝑄2̇ )
𝑎̇ 2 𝑎̇ 2
𝑏1 𝑐2
In which 𝑎̇ 2 refers to modified 𝑎2 value (𝑎2 − 𝑎1
) as shown on modified first row equation above
𝑐
while 𝑄2̇ refers to modified 𝑄2 value (𝑄2 − ⁡ 𝑄1 𝑎2 ) as shown on modified first row equation above.
1

Hence, since first row 𝑎1 and 𝑄1 are unaltered, we can conclude that

Since the matrix equation can be simplified as follow,

Therefore, the x value can be computed by using equations below:

For 𝑥𝑖 in which i < N, ⁡((𝑎̇ 𝑖 )𝑥𝑖 + ⁡ (𝑏𝑖 )𝑥𝑖+1 ) = ⁡ 𝑄̇ 𝑖

For 𝑥𝑁 , ⁡((𝑎̇ 𝑁 )𝑥𝑁 ⁡) = ⁡ 𝑄𝑁̇

Question 4
1
 a   x
2
 x  xy
b    N    y 
    x

a  1  N   x   xy
b     
   x 2 N   x  x   x  x 2    y 
a  1  N  xy   x y 
b    
   x N   x x   x xy   x 2 y 
2

For solving expression term ‘a’,

N  xy   x y
a
x 2
N   x x

Since ∑x = 𝑥̅ 𝑁 and ∑y = 𝑦̅𝑁,


_ _ _ _
N  xy  x y N 2  xy  x y N
a _
 _

x 2
N  (x N )2  x  ( x) N 2 2

_ _ _ _ _ _ _ _ _ _

a
 xy  x y N  x y N  x y N   xy  y( x)  x( y)  x y N (*)
_ _ _ _

 x  2( x) N  ( x) N
2
 x  2 x ( x )  ( x ) N
2 2 2 2

Since ∑xy + 𝑥̅ 𝑦̅𝑁 can be rewritten as ∑(xy + 𝑥̅ 𝑦̅) while ∑𝑥 2 + 𝑥̅ 2 𝑁 can be rewritten as ∑(𝑥 2 + 𝑥̅ 2 ) ,
_ _ _ _ _ _

a
 ( xy  x y)  y( x)  x( y) 
 ( x  x)( y  y)
_ _ _

 (x 2
 ( x ) )  2 x ( x )
2
 ( x  x) 2

For solving expression term ‘b’,


_ _
  x xy   x 2  y  x N  xy   x 2 y N
b 
x 2
N   x x
 x 2 N  ( x) 2 N 2
_

_ _ _
Introduce summation and subtraction of ( x) 2 y N 2 in numerator and elaborate ( x) 2 N 2 in
denominator:
_ _ _ _ _ _ _ _ _ _ _ _ _ _

b
 x 2 y N  x N  xy 
 x 2 y N  2( x) 2 y N 2  ( x) 2 y N 2  x N  xy  ( x) 2 y N 2  ( x) 2 y N 2  ( x) 2 y N 2
_ _ _

x 2
N  ( x) N 2 2
N ( x 2  2( x) 2 N  ( x) 2 N )

∑𝑥 ∑𝑦
Selectively substitute 𝑥̅ = 𝑁
and 𝑦̅ = 𝑁
into numerator:

 x  y  2 x  y x  ( x) N  y   x xy   x 
_ _ _ _ _ _
y x  y x  x y N  x
2 2 2

b _ _
N ( x  2( x) N  ( x) N ) 2 2 2

 x  y  2 x  y x  ( x) N  y   x xy   x 
_ _ _ _ _ _
y x  y x  x y N  x
2 2 2

b _ _
N ( x  2( x)(  x)  ( x) N ) 2 2

Rearrange equation above and perform simplification,

 _ _ _ _

b
 y    xy  x  y  y  x  x y N   x 
   _ _
N   x  2 x  x  ( x) N  N  2 2
 

 _ _ _ _

  xy  x  y  y  x  x y N  _
_
b  y  _ _ x
  x 2  2 x  x  ( x) 2 N 
 
_ _
b  y a x

in which a is derived from equation (*) on previous page in steps of proving expression ‘a’.

Question 5

Lagrange interpolation formula:

Substitute points, x1, x2, x3, y1, y2, y3 into equation above:

(𝑥 − 3)(𝑥 − 8) (𝑥 − 1)(𝑥 − 8) (𝑥 − 1)(𝑥 − 3)


𝑓(𝑥) = ⁡ (11) + (17) (17)
(1 − 3)(1 − 8) (3 − 1)(3 − 8) (8 − 1)(8 − 3)
11 2 17 2 17 2 121 153 68 264 68 51
𝑓(𝑥) = ⁡ 𝑥 − 𝑥 + 𝑥 − 𝑥+ 𝑥− 𝑥+ − +
14 10 35 14 10 35 14 10 35
3 33 47
𝑓(𝑥) = ⁡ − 𝑥 2 + 𝑥 +
7 7 7
Hence,

3 33 47
𝑓(5) = ⁡ − (5)2 + (5) +
7 7 7
𝑓(5) = 19.5714

Cubic spline interpolation is determined by using online tool [1]:


−1.325𝑥 3 − (3.84 × 10−63 )𝑥 2 + 12.325𝑥⁡⁡⁡⁡⁡⁡𝐹𝑜𝑟⁡𝑥⁡[0,1]⁡
𝑓(𝑥) = ⁡ { 0.65𝑥 3 − 5.925𝑥 2 + 18.25𝑥 − 1.975⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐹𝑜𝑟⁡𝑥[1,3]
0.005𝑥 3 − 0.12𝑥 2 + 0.835𝑥 + 1.544⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐹𝑜𝑟⁡𝑥[3,8]
By keying the formulas being computed above into matlab (as shown in appendix):

Cubic spline line is apparently smoother than Lagrange interpolation line so it is considered less error
in terms of interpolating datapoints, meanwhile Lagrange interpolation line emphasise more on
interpolating tighter intervals which results in better accuracy.

Question 6

The constraints for investigating the influence of variables such as spatial resolution (Nx), temporal
resolution (Nt) and time integration type are being listed as below:

Total time, 𝑡𝑡𝑜𝑡𝑎𝑙 2 Diffusion number 0.1


Total length, 𝑥𝑡𝑜𝑡𝑎𝑙 1 𝜇 0.005

𝑥𝑡𝑜𝑡𝑎𝑙 𝑡𝑡𝑜𝑡𝑎𝑙
Since ∆𝑥 = 𝑁𝑥
and ∆𝑡 = 𝑁𝑡
, we can substitute ∆𝑥 and ∆𝑡 into equation statement below:
𝜇⁡×⁡∆𝑡⁡
⁡⁡ ≤ ⁡⁡𝐷𝑖𝑓𝑓𝑢𝑠𝑖𝑜𝑛⁡𝑛𝑢𝑚𝑏𝑒𝑟
(∆𝑥)2

𝜇⁡×⁡𝑡𝑡𝑜𝑡𝑎𝑙 ⁡ 𝑥 2 ⁡×⁡⁡𝐷𝑖𝑓𝑓𝑢𝑠𝑖𝑜𝑛⁡𝑛𝑢𝑚𝑏𝑒𝑟⁡
⁡⁡ ≤ ⁡ 𝑡𝑜𝑡𝑎𝑙
𝑁𝑡 𝑁𝑥 2

𝜇⁡ × ⁡ 𝑡𝑡𝑜𝑡𝑎𝑙 ⁡ × ⁡𝑁𝑥 2 ⁡ ≤ ⁡𝑁𝑡⁡ × 𝐷𝑖𝑓𝑓𝑢𝑠𝑖𝑜𝑛⁡𝑛𝑢𝑚𝑏𝑒𝑟

0.01⁡ × ⁡𝑁𝑥 2
≤ ⁡𝑁𝑡⁡
𝐷𝑖𝑓𝑓𝑢𝑠𝑖𝑜𝑛⁡𝑛𝑢𝑚𝑏𝑒𝑟
Setting 𝑁𝑥𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 and 𝑁𝑡𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 as grid-independent reference solution:
0.01⁡×⁡10002
Since 𝑁𝑥𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 is set to be 1000, 𝑁𝑡𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 = ⁡ = 10000
0.1

Nt1 Nt2 Nt3 Nt4 Nt(refer)


Nx1 (100,100) (200,100) (400,100) (800,100) -
Nx2 (100,200) - - - -
Nx3 (100,400) - - - -
Nx4 (100,800) - - - -
Nx(refer) - - - - (1000,100000)

Explicit fixed end interpolation at various Nx values (Nt is constant at 100) and time step = 100th :

Nx=100 Nx=200 Nx=400 Nx=800 Reference line

0
0 0.2 0.4 0.6 0.8 1 1.2

-2E+252

-4E+252

-6E+252

-8E+252

-1E+253

-1.2E+253

-1.4E+253

Explicit variable end interpolation at various Nx values (Nt is constant at 100) and time step = 100th :
Nx=100 Nx=200 Nx=400 Nx=800 reference line

0
0 0.2 0.4 0.6 0.8 1 1.2
-2E+252

-4E+252

-6E+252

-8E+252

-1E+253

-1.2E+253

-1.4E+253

Implicit fixed end interpolation at various Nx values (Nt is constant at 100) and time step = 100th:

Nx=100 Nx=200 Nx=400 Nx=800 Reference line

0.35

0.3

0.25

0.2

0.15

0.1

0.05

0
0 0.2 0.4 0.6 0.8 1 1.2

To summarise, implicit fixed end interpolation owns greater accuracy in predicting the solution of heat
equation in comparison with explicit fixed end interpolation and explicit variable end interpolation.
There is no significant difference shown in increasing ∆𝑥 resolution for all interpolation methods.
Appendix

Question 2 excel graph data:

M theta beta_lower beta_upper


1.5 0 41.81032 90
1.5 1 42.91297 88.83844
1.5 2 44.06459 87.66742
1.5 3 45.27176 86.47688
1.5 4 46.54292 85.25542
1.5 5 47.88926 83.98938
1.5 6 49.32616 82.66126
1.5 7 50.87567 81.24716
1.5 8 52.5715 79.71175
1.5 9 54.46989 77.99735
1.5 10 56.67868 75.99487
1.5 11 59.46511 73.43591
1.5 12 64.35881 68.78982
3 0 19.47122 90
3 1 20.15756 89.64991
3 2 20.86674 89.2993
3 3 21.59897 88.94762
3 4 22.35442 88.59434
3 5 23.13326 88.2389
3 6 23.93561 87.88073
3 7 24.7616 87.51923
3 8 25.61135 87.15377
3 9 26.485 86.78368
3 10 27.38269 86.40825
3 11 28.30461 86.02672
3 12 29.251 85.63825
3 13 30.22215 85.24194
3 14 31.21845 84.83679
3 15 32.2404 84.42168
3 16 33.28863 83.99537
3 17 34.36393 83.55645
3 18 35.46731 83.10331
3 19 36.60002 82.63411
3 20 37.76363 82.14667
3 21 38.96014 81.63847
3 22 40.192 81.10646
3 23 41.46238 80.54697
3 24 42.77529 79.95545
3 25 44.13593 79.32621
3 26 45.55117 78.65191
3 27 47.03028 77.92281
3 28 48.58618 77.12554
3 29 50.23768 76.24089
3 30 52.01384 75.23939
3 31 53.96366 74.07165
3 32 56.18212 72.64234
3 33 58.90888 70.71142
3 34 63.67317 66.74936
4 0 14.47751 90
4 1 15.13127 89.71994
4 2 15.81258 89.43953
4 3 16.52145 89.15841
4 4 17.25776 88.87622
4 5 18.02129 88.59259
4 6 18.81173 88.30714
4 7 19.62869 88.01949
4 8 20.47174 87.72923
4 9 21.34039 87.43593
4 10 22.23415 87.13915
4 11 23.1525 86.8384
4 12 24.09498 86.53319
4 13 25.06112 86.22297
4 14 26.05053 85.90715
4 15 27.06288 85.5851
4 16 28.09791 85.25612
4 17 29.1555 84.91943
4 18 30.23559 84.5742
4 19 31.3383 84.21948
4 20 32.4639 83.85419
4 21 33.61282 83.47714
4 22 34.78572 83.08695
4 23 35.9835 82.68205
4 24 37.20737 82.26059
4 25 38.45887 81.82043
4 26 39.74 81.35901
4 27 41.05332 80.87325
4 28 42.40209 80.3594
4 29 43.79051 79.8128
4 30 45.22408 79.22751
4 31 46.71009 78.59587
4 32 48.25848 77.90754
4 33 49.88327 77.14818
4 34 51.60518 76.29673
4 35 53.45693 75.32017
4 36 55.49565 74.16109
4 37 57.83896 72.70161
4 38 60.82714 70.60122
5 0 11.53696 90
5 1 12.17853 89.74995
5 2 12.85323 89.49961
5 3 13.56082 89.24869
5 4 14.30086 88.99688
5 5 15.07268 88.74388
5 6 15.87548 88.48939
5 7 16.70828 88.23308
5 8 17.57004 87.97463
5 9 18.45966 87.71369
5 10 19.37601 87.44989
5 11 20.31798 87.18286
5 12 21.28449 86.91219
5 13 22.27455 86.63746
5 14 23.28723 86.35819
5 15 24.32171 86.07389
5 16 25.37728 85.78403
5 17 26.45336 85.48801
5 18 27.54951 85.1852
5 19 28.66541 84.87487
5 20 29.80092 84.55626
5 21 30.95603 84.22847
5 22 32.13095 83.89052
5 23 33.32605 83.54129
5 24 34.54193 83.17952
5 25 35.77944 82.80374
5 26 37.03969 82.41225
5 27 38.32416 82.00308
5 28 39.63471 81.57386
5 29 40.97374 81.12178
5 30 42.34427 80.64342
5 31 43.75015 80.13455
5 32 45.19639 79.58982
5 33 46.68955 79.00237
5 34 48.23848 78.36307
5 35 49.85543 77.65939
5 36 51.55819 76.87331
5 37 53.37411 75.97726
5 38 55.34903 74.92519
5 39 57.57114 73.62872
5 40 60.25927 71.86885
5 41 64.65515 68.40368
7 0 8.213211 90
7 1 8.848258 89.77496
7 2 9.528135 89.54967
7 3 10.25195 89.32389
7 4 11.01821 89.09737
7 5 11.82498 88.86984
7 6 12.66996 88.64106
7 7 13.55066 88.41075
7 8 14.46454 88.17864
7 9 15.40906 87.94444
7 10 16.38182 87.70785
7 11 17.38058 87.46856
7 12 18.4033 87.22624
7 13 19.44817 86.98052
7 14 20.51361 86.73105
7 15 21.59826 86.47741
7 16 22.70096 86.21917
7 17 23.8208 85.95588
7 18 24.95704 85.68701
7 19 26.10912 85.41202
7 20 27.27668 85.1303
7 21 28.45954 84.84116
7 22 29.65767 84.54387
7 23 30.87124 84.23759
7 24 32.10057 83.92137
7 25 33.34621 83.59415
7 26 34.60889 83.25471
7 27 35.88958 82.90167
7 28 37.18952 82.53339
7 29 38.51027 82.14798
7 30 39.85376 81.7432
7 31 41.22242 81.31636
7 32 42.61925 80.8642
7 33 44.04806 80.38269
7 34 45.51371 79.86676
7 35 47.02253 79.3099
7 36 48.58297 78.70352
7 37 50.20662 78.03585
7 38 51.91016 77.29007
7 39 53.71895 76.44072
7 40 55.67485 75.44581
7 41 57.85645 74.22664
7 42 60.44971 72.59716
7 43 64.28439 69.72753
8 0 7.180756 90
8 1 7.815874 89.78091
8 2 8.501741 89.56159
8 3 9.236971 89.34179
8 4 10.01935 89.12129
8 5 10.84602 88.89982
8 6 11.71376 88.67715
8 7 12.61916 88.45301
8 8 13.55885 88.22715
8 9 14.52958 87.9993
8 10 15.52839 87.76915
8 11 16.55257 87.53642
8 12 17.59977 87.30078
8 13 18.66794 87.06191
8 14 19.75533 86.81945
8 15 20.86048 86.57301
8 16 21.9822 86.32219
8 17 23.11952 86.06655
8 18 24.2717 85.8056
8 19 25.43822 85.53882
8 20 26.61872 85.26564
8 21 27.81302 84.98543
8 22 29.02112 84.69748
8 23 30.24319 84.40102
8 24 31.47956 84.09517
8 25 32.73074 83.77894
8 26 33.99743 83.45121
8 27 35.28055 83.11069
8 28 36.58125 82.7559
8 29 37.90097 82.3851
8 30 39.24149 81.99627
8 31 40.60499 81.58697
8 32 41.99419 81.1543
8 33 43.41247 80.69467
8 34 44.8641 80.20365
8 35 46.35457 79.67559
8 36 47.89111 79.10314
8 37 49.48343 78.47645
8 38 51.14515 77.78179
8 39 52.8963 76.99903
8 40 54.76837 76.09659
8 41 56.81612 75.01963
8 42 59.15175 73.65584
8 43 62.09706 71.68338
Question 3 output:

Question 5 matlab code:

References:

[1] Denk,T. [n.d.]. Cubic spline interpolation. Retrieved from https://tools.timodenk.com/cubic-


spline-interpolation

Anda mungkin juga menyukai