# Question 3

c^2
k
h
r

4
0.01
0.25
0.64

r=(kc^2)/h^2

(a) Explicit Finite -difference method
t
0.05
4.820788 3.10427 4.622179
0.04
3.130858 4.451116 3.666928
0.03
4.148707 3.353512 4.273323
0.02
3.04329 3.906897 3.90584
0.01
3.405006 3.122415 4.065577
0
2 3.097661
4.234
0
0.25
0.5

3.592857
4.37532
4.245642
4.478976
4.759151
5.107179
0.75

4.895107
3.861114
4.420582
4.687527
5.014951
5.436564
1

2.322822
4.962522
3.721354
4.478976
4.759151
5.107179
1.25

6.681058
1.939399
4.961451
3.08664
4.065577
4.234
1.5

-0.31568
6.325118
1.479592
4.623697
1.842415
3.097661
1.75

3.870052
4.062697
4.276526
4.515569
4.787586
5.107179
0.75

4.025537
4.235894
4.471567
4.740081
5.054764
5.436564
1

3.870052
4.062697
4.276526
4.515569
4.787586
5.107179
1.25

3.428873
3.573178
3.729592
3.895939
4.065472
4.234
1.5

2.772
2.848398
2.929129
3.010003
3.079871
3.097661
1.75

(b)Implicit finite difference method
t
0.05
0.04
0.03
0.02
0.01
0

2
2
2
2
2
2
0

2.772
2.848398
2.929129
3.010003
3.079871
3.097661
0.25

3.428873
3.573178
3.729592
3.895939
4.065472
4.234
0.5

8.002464
0.334595
5.568867
1.24809
3.965006
0
2

2
2
2
2
2
2
2

r

1
1-2r

0.64

1
-0.28

-r
r

2+2r
2-2r

-r
r

-0.64
0.64

3.28
0.72

-0.64
0.64

x

x

r

0.64

Question 2

(a) Using RK4
i
0
1
2
3
4
5
6
7
8
9
10

t
0
1
2
3
4
5
6
7
8
9
10

v
10.0000
9.7045
9.4176
9.1393
8.8692
8.6071
8.3527
8.1058
7.8663
7.6338
7.4082

k1
-0.3000
-0.2911
-0.2825
-0.2742
-0.2661
-0.2582
-0.2506
-0.2432
-0.2360
-0.2290
-0.2222

k2
-0.2955
-0.2868
-0.2783
-0.2701
-0.2621
-0.2543
-0.2468
-0.2395
-0.2324
-0.2256
-0.2189

k3
-0.2956
-0.2868
-0.2784
-0.2701
-0.2621
-0.2544
-0.2469
-0.2396
-0.2325
-0.2256
-0.2190

k4
-0.2911
-0.2825
-0.2742
-0.2661
-0.2582
-0.2506
-0.2432
-0.2360
-0.2290
-0.2222
-0.2157

Exact v
10.0000
9.7045
9.4176
9.1393
8.8692
8.6071
8.3527
8.1058
7.8663
7.6338
7.4082

IerrorI

i
0
1
2
3
4
5
6
7
8
9
10

t
0
1
2
3
4
5
6
7
8
9
10

v^p

8.8692
8.7929
8.7311
8.6606
8.5931
8.5260
8.4594

v^c
10.0000
9.7045
9.4176
9.1393
9.0688
8.9976
8.9274
8.8577
8.7886
8.7200
8.6519

i-3
i-2
i-1
i
i+1

0
2.01E-09
3.91E-09
5.69E-09
0.199557
0.390568
0.574732
0.751897
0.92231
1.086184
1.243722

exact v
10.0000
9.7045
9.4176
9.1393
8.8692
8.6071
8.3527
8.1058
7.8663
7.6338
7.4082

IerrorI
0
2.01E-09
3.91E-09
5.69E-09
7.37E-09
8.94E-09
1.04E-08
1.18E-08
1.31E-08
1.43E-08
1.54E-08

Question 1
(a)
when t=0.07
Unequally spaced data
i
0
1
2
x
0
0.07
0.16
T
10
9
5
L'
-8.03571 3.174603 4.861111
dT/dx
-27.4802
q
41.22024

2 point forward
di/dt
-44.4444
q
66.66667
2 point backward
di/dt
-14.2857
q
21.42857

(b) Basic trapezoidal rule

b)
i)

Q=

Basic trapezoidal rule
i
0
1
2
3
4
5
6
7

ii)

0.5

t
0
2
4
6
10
12
16
20

c
10
22
30
45
58
70
75
45

Qc
5
11
15
22.5
29
35
37.5
22.5

h

M

2
2
2
4
2
4
4

16
26
37.5
103
64
145
120
511.5

Combination trapezoidal rule and Simpson rule
i
0
1
2
3
4
5
6

t
0
2
4
6
10
12
16

c
10
22
30
45
58
70
75

Qc
5
11
15
22.5
29
35
37.5

h
2
2
2
4
2
4

M

79.125
103
64

7

20

45

22.5

4
∑M=

Basic Simpson's 3/8 rule
Basic Trapezoidal rule
Basic Simpson's1/3 rule

M

276.6667

276.6667
522.7917