Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

Solving partial differential equations

PIN number: 239

Q1:

Convergence table for Jacobi method:

Convergence summary table


N_
14
12
10
8
6
4
2
SIGMA
1
1
1
1
1
1
1
N_it
202
212
220
226
232
234
236
ln(N_)
2.63905733 2.48490665 2.30258509 2.07944154 1.79175947 1.38629436 0.69314718
ln(N_it)
5.3082677 5.35658627 5.39362755
5.420535 5.44673737 5.45532112 5.46383181

Q2:

Chartsheet showing the ln(Nit) vs ln(N) for Jacobi method:

Comment on slope of the line:


There is a linear relation between ln(N_it) and ln(N_). The gradient indicates that
N_it = exp(gradient) * ln(N_)

Solving partial differential equations


Solution sheet Lent 2014

Page 1 of 6

PIN number: 239

Q3:

Convergence table for GaussSeidel method:

Convergence summary table


N_
14
12
10
8
6
4
2
SIGMA
1
1
1
1
1
1
1
N_it
202
212
220
226
232
236
238
ln(N_)
2.63905733 2.48490665 2.30258509 2.07944154 1.79175947 1.38629436 0.69314718
ln(N_it)
5.3082677 5.35658627 5.39362755
5.420535 5.44673737 5.46383181 5.47227067

Comparison of convergence rate of Jacobi and GaussSeidel methods:


Clearly, it can be noted that Gauss_Seidel method converges faster than Jacobi
method.

Q4(a): Chartsheet showing the (xi,0.5) vs xi plot for the case =0.2

As the number of iterations increases the plot behaves in the following way:
The first three and the last 4 points tend to go up as the number of iterations increases

Solving partial differential equations


Solution sheet Lent 2014

Page 2 of 6

PIN number: 239

Q4 (b):

Chartsheet showing the (xi,0.5) vs xi plot for the case =1.8

As the number of iterations increases the plot behaves in the following way:
As N_it rises, each point oscillates up and down vertically

Q5:

Convergence table for GaussSeidel method with relaxation

Convergence summary table


N_
14
14
14
14
14
14
14
SIGMA
0.2
0.4
0.6
0.8
1.2
1.4
1.6
N_it
1012
506
338
252
29
19
17
ln(N_)
2.63905733 2.63905733 2.63905733 2.63905733 2.63905733 2.63905733 2.63905733
ln(N_it)
6.91968385 6.22653667 5.8230459 5.52942909 3.36729583 2.94443898 2.83321334

The GaussSeidel method converges fastest for a value: I would say when
sigma = 1.4 or 1.6
Comment on the effect of over-relaxation on the GaussSeidel method:
For over relaxation there tends to be extremely rapid convergence
What happens for the GaussSeidel method when =2.5? Answer:

Solving partial differential equations


Solution sheet Lent 2014

Page 3 of 6

The % difference changes from 50% ( for N_ it = 6 ) to -40% for ( N_it = 7 ) ; so


rapidly changes

Solving partial differential equations


Solution sheet Lent 2014

Page 4 of 6

PIN number: 239

Q6: Does the iteration converge for any value greater than 1? Answer:
No it doesnt. It rather tends to diverge.
Convergence table for Jacobi method with relaxation
Convergence summary table
N_
14
14
14
14
14
SIGMA
0.2
0.4
0.6
0.8
1
N_it
1012
505
338
252
202
ln(N_)
2.63905733 2.63905733 2.63905733 2.63905733 2.63905733
ln(N_it)
6.91968385 6.22455843 5.8230459 5.52942909 5.3082677

Q7:

Chartsheet showing the (xi,0.5) vs xi plot with over-relaxation:

The value of I used is 1.6


The value of Nit I used is 150

Solving partial differential equations


Solution sheet Lent 2014

Page 5 of 6

PIN number: 239

Q8(a): Picture of cells A1:R61

PIN
C_
SIGMA
LZERO
N_
x_0
x_1
y_0
y_1
COUNT

Iteration Progress
exact phi

239
4.39
1.2
1
14
0
1
0
1
150

0
Convergence summary table
N_
14
14
14
14
14
14
14
SIGMA
0.2
0.4
0.6
0.8
1
1
1
N_it
1012
505
338
252
202
ln(N_)
2.63905733 2.63905733 2.63905733 2.63905733 2.63905733 2.63905733 2.63905733
ln(N_it)
6.91968385 6.22455843 5.8230459 5.52942909 5.3082677 #NUM!
#NUM!

delta Phi/ Phi


Calc Phi delta Phi %
1.0975 6.62E+16 -6.6E+16 -6.03554E+18

(x_i,0.5) vs x_i
8E+16
6E+16

x
i_

0.07
1

0.14
2

0.21
3

j_
0.00
0.07
0.14
0.21
0.29
0.36
0.43
0.50
0.57
0.64
0.71
0.79
0.86
0.93
1.00

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Relaxation Solution Grid 1

0
0.005102041
0.020408163
0.045918367
0.081632653
0.12755102
0.183673469
0.25
0.326530612
0.413265306
0.510204082
0.617346939
0.734693878
0.862244898
1

x
i_

-0.005102
0.02239796
0.06010204
0.1080102
0.16612245
0.23443878
0.31295918
0.40168367
0.50061224
0.6097449
0.72908163
0.85862245
0.99836735
1.14831633
1.30846939

-0.0204082
0.0294898
0.08959184
0.15989796
0.24040816
0.33112245
0.43204082
0.54316327
0.6644898
0.79602041
0.9377551
1.08969388
1.25183673
1.42418367
1.60673469

-0.0459184
0.02637755
0.10887755
0.20158163
0.3044898
0.41760204
0.54091837
0.67443878
0.81816327
0.97209184
1.13622449
1.31056122
1.49510204
1.68984694
1.89479592

4E+16

0.29
4

0.36
5

-0.0816327
0.01306122
0.11795918
0.23306122
0.35836735
0.49387755
0.63959184
0.7955102
0.96163265
1.13795918
1.3244898
1.52122449
1.72816327
1.94530612
2.17265306

0.43
6

2E+16

(x
)
.5
i,0
_

0.00
0

0.50
7

0.57
8

0.64
9

-0.3265306
-0.1422449
0.0522449
0.25693878
0.47183673
x_i
0.69693878
0.9322449
1.1777551
1.43346939
1.69938776
1.9755102
2.26183673
2.55836735
2.86510204
3.18204082

-0.4132653
-0.2065816
0.01030612
0.23739796
0.47469388
0.72219388
0.97989796
1.24780612
1.52591837
1.81423469
2.1127551
2.42147959
2.74040816
3.06954082
3.40887755

0.71
10

0.79
11

0.86
12

0.93
13

1.00
14

-0.6173469
-0.3658673
-0.1041837
0.16770408
0.44979592
0.74209184
1.04459184
1.35729592
1.68020408
2.01331633
2.35663265
2.71015306
3.07387755
3.44780612
3.83193878

-0.7346939
-0.4608163
-0.1767347
0.11755102
0.42204082
0.73673469
1.06163265
1.39673469
1.74204082
2.09755102
2.46326531
2.83918367
3.22530612
3.62163265
4.02816327

-0.8622449
-0.5659694
-0.2594898
0.05719388
0.38408163
0.72117347
1.06846939
1.42596939
1.79367347
2.17158163
2.55969388
2.9580102
3.36653061
3.7852551
4.21418367

-1
-0.68133
-0.35245
-0.01337
0.335918
0.695408
1.065102
1.445
1.835102
2.235408
2.645918
3.066633
3.497551
3.938673
4.39

0.5 0.57142857 0.64285714 0.71428571 0.78571429 0.85714286 0.92857143


7
8
9
10
11
12
13

1
14

-0.127551
-2E+16
-0.0104592
-4E+16
0.11683673
-6E+16
0.25433673
-8E+16
0.40204082
0.55994898
0.72806122
0.90637755
1.09489796
1.29362245
1.50255102
1.72168367
1.95102041
2.19056122
2.44030612

0.2

-0.1836735
-0.0441837
0.1055102
0.26540816
0.4355102
0.61581633
0.80632653
1.00704082
1.21795918
1.43908163
1.67040816
1.91193878
2.16367347
2.42561224
2.6977551

0 0.07142857 0.14285714 0.21428571 0.28571429 0.35714286 0.42857143


0
1
2
3
4
5
6

0.4

-0.25
-0.0881122
0.08397959
0.26627551
0.45877551
0.66147959
0.87438776
1.0975
1.33081633
1.57433673
1.82806122
2.0919898
2.36612245
2.65045918
2.945

0.6

0.8

1.2

-0.5102041
-0.2811224
-0.0418367
0.20765306
0.46734694
0.7372449
1.01734694
1.30765306
1.60816327
1.91887755
2.23979592
2.57091837
2.9122449
3.26377551
3.6255102

j_
0
0.071
0.143
0.214
0.286
0.357
0.429
0.500
0.571
0.643
0.714
0.786
0.857
0.929
1.000

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

0
0.005102041
0.020408163
0.045918367
0.081632653
0.12755102
0.183673469
0.25
0.326530612
0.413265306
0.510204082
0.617346939
0.734693878
0.862244898
1

-0.005102
3.0907E+15
-6.047E+15
8.7361E+15
-1.103E+16
1.2822E+16
-1.4E+16
1.4506E+16
-1.428E+16
1.3316E+16
-1.165E+16
9.3524E+15
-6.541E+15
3.365E+15
1.30846939

-0.0204082
-6.034E+15
1.1805E+16
-1.705E+16
2.1539E+16
-2.503E+16
2.7341E+16
-2.832E+16
2.7876E+16
-2.6E+16
2.2742E+16
-1.826E+16
1.277E+16
-6.569E+15
1.60673469

-0.0459184
8.6876E+15
-1.7E+16
2.4556E+16
-3.101E+16
3.6041E+16
-3.937E+16
4.0774E+16
-4.014E+16
3.7431E+16
-3.274E+16
2.6289E+16
-1.839E+16
9.4588E+15
1.89479592

-0.0816327
-1.092E+16
2.1368E+16
-3.087E+16
3.8989E+16
-4.531E+16
4.9492E+16
-5.126E+16
5.0462E+16
-4.706E+16
4.1168E+16
-3.305E+16
2.3116E+16
-1.189E+16
2.17265306

Solving partial differential equations


Solution sheet Lent 2014

-0.127551
1.2626E+16
-2.47E+16
3.5688E+16
-4.507E+16
5.238E+16
-5.721E+16
5.9258E+16
-5.833E+16
5.44E+16
-4.759E+16
3.8207E+16
-2.672E+16
1.3747E+16
2.44030612

-0.1836735
-1.371E+16
2.6822E+16
-3.875E+16
4.8939E+16
-5.688E+16
6.2123E+16
-6.434E+16
6.3341E+16
-5.907E+16
5.1676E+16
-4.149E+16
2.9016E+16
-1.493E+16
2.6977551

-0.25
1.4113E+16
-2.761E+16
3.9892E+16
-5.038E+16
5.8551E+16
-6.395E+16
6.624E+16
-6.521E+16
6.081E+16
-5.32E+16
4.2709E+16
-2.987E+16
1.5367E+16
2.945

-0.3265306
-1.381E+16
2.7016E+16
-3.903E+16
4.9295E+16
-5.729E+16
6.2575E+16
-6.481E+16
6.3803E+16
-5.95E+16
5.2053E+16
-4.179E+16
2.9228E+16
-1.504E+16
3.18204082

-0.4132653
1.2805E+16
-2.505E+16
3.6195E+16
-4.571E+16
5.3126E+16
-5.803E+16
6.0103E+16
-5.917E+16
5.5177E+16
-4.827E+16
3.8753E+16
-2.71E+16
1.3944E+16
3.40887755

-0.5102041
-1.115E+16
2.1807E+16
-3.151E+16
3.9789E+16
-4.624E+16
5.0509E+16
-5.232E+16
5.15E+16
-4.803E+16
4.2016E+16
-3.373E+16
2.3592E+16
-1.214E+16
3.6255102

-0.6173469
8.9115E+15
-1.743E+16
2.5189E+16
-3.181E+16
3.6971E+16
-4.038E+16
4.1828E+16
-4.118E+16
3.84E+16
-3.359E+16
2.697E+16
-1.886E+16
9.704E+15
3.83193878

-0.7346939
-6.213E+15
1.2156E+16
-1.756E+16
2.218E+16
-2.578E+16
2.8156E+16
-2.916E+16
2.8709E+16
-2.677E+16
2.3422E+16
-1.88E+16
1.3152E+16
-6.766E+15
4.02816327

-0.8622449
3.1904E+15
-6.242E+15
9.0178E+15
-1.139E+16
1.3236E+16
-1.446E+16
1.4975E+16
-1.474E+16
1.3747E+16
-1.203E+16
9.6555E+15
-6.753E+15
3.4741E+15
4.21418367

-1
-0.68133
-0.35245
-0.01337
0.335918
0.695408
1.065102
1.445
1.835102
2.235408
2.645918
3.066633
3.497551
3.938673
4.39

Page 6 of 6

PIN number: 239

Q8(b): Picture of cells A62:R83

Relaxation Grid 1
x
i_
y

0 0.07142857 0.14285714 0.21428571 0.28571429 0.35714286 0.42857143


0
1
2
3
4
5
6

0.5 0.57142857 0.64285714 0.71428571 0.78571429 0.85714286 0.92857143


7
8
9
10
11
12
13

1
14

j_
0
0.071
0.143
0.214
0.286
0.357
0.429
0.500
0.571
0.643
0.714
0.786
0.857
0.929
1.000

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

0
0.005102041
0.020408163
0.045918367
0.081632653
0.12755102
0.183673469
0.25
0.326530612
0.413265306
0.510204082
0.617346939
0.734693878
0.862244898
1

-0.005
-4.242E+15
8.2988E+15
-1.199E+16
1.5136E+16
-1.759E+16
1.9201E+16
-1.988E+16
1.9565E+16
-1.824E+16
1.5953E+16
-1.281E+16
8.9543E+15
-4.606E+15
1.30846939

-0.020
8.2817E+15
-1.62E+16
2.3402E+16
-2.955E+16
3.4329E+16
-3.748E+16
3.8813E+16
-3.819E+16
3.5609E+16
-3.114E+16
2.4998E+16
-1.748E+16
8.9919E+15
1.60673469

-0.046
-1.192E+16
2.3324E+16
-3.369E+16
4.254E+16
-4.942E+16
5.3967E+16
-5.588E+16
5.499E+16
-5.127E+16
4.4838E+16
-3.599E+16
2.5167E+16
-1.295E+16
1.89479592

Solving partial differential equations


Solution sheet Lent 2014

-0.082
1.4989E+16
-2.932E+16
4.2355E+16
-5.348E+16
6.2133E+16
-6.784E+16
7.0248E+16
-6.913E+16
6.445E+16
-5.637E+16
4.5244E+16
-3.164E+16
1.6275E+16
2.17265306

-0.128
-1.733E+16
3.3891E+16
-4.896E+16
6.1813E+16
-7.182E+16
7.8418E+16
-8.12E+16
7.9905E+16
-7.45E+16
6.5153E+16
-5.23E+16
3.657E+16
-1.881E+16
2.44030612

-0.184
1.881E+16
-3.68E+16
5.3152E+16
-6.711E+16
7.7973E+16
-8.514E+16
8.8157E+16
-8.675E+16
8.0882E+16
-7.074E+16
5.678E+16
-3.971E+16
2.0425E+16
2.6977551

-0.250
-1.936E+16
3.7875E+16
-5.471E+16
6.9079E+16
-8.026E+16
8.7637E+16
-9.074E+16
8.9299E+16
-8.325E+16
7.2814E+16
-5.845E+16
4.087E+16
-2.102E+16
2.945

-0.327
1.8942E+16
-3.705E+16
5.3526E+16
-6.758E+16
7.8522E+16
-8.574E+16
8.8779E+16
-8.737E+16
8.1453E+16
-7.124E+16
5.7181E+16
-3.999E+16
2.0569E+16
3.18204082

-0.413
-1.756E+16
3.4358E+16
-4.963E+16
6.2664E+16
-7.281E+16
7.9499E+16
-8.232E+16
8.1008E+16
-7.552E+16
6.6054E+16
-5.302E+16
3.7076E+16
-1.907E+16
3.40887755

-0.510
1.5286E+16
-2.99E+16
4.3195E+16
-5.454E+16
6.3367E+16
-6.919E+16
7.1645E+16
-7.051E+16
6.5733E+16
-5.749E+16
4.6146E+16
-3.227E+16
1.6599E+16
3.6255102

-0.617
-1.222E+16
2.3906E+16
-3.453E+16
4.3601E+16
-5.066E+16
5.5316E+16
-5.728E+16
5.6366E+16
-5.255E+16
4.5961E+16
-3.689E+16
2.5798E+16
-1.327E+16
3.83193878

-0.735
8.52E+15
-1.667E+16
2.4075E+16
-3.04E+16
3.5319E+16
-3.857E+16
3.9933E+16
-3.93E+16
3.6638E+16
-3.204E+16
2.5721E+16
-1.799E+16
9.2522E+15
4.02816327

Page 7 of 6

-0.862
-4.375E+15
8.5576E+15
-1.236E+16
1.5608E+16
-1.813E+16
1.9802E+16
-2.05E+16
2.0177E+16
-1.881E+16
1.6453E+16
-1.321E+16
9.235E+15
-4.751E+15
4.21418367

-1
-0.68133
-0.35245
-0.01337
0.335918
0.695408
1.065102
1.445
1.835102
2.235408
2.645918
3.066633
3.497551
3.938673
4.39

You might also like