Professional Documents
Culture Documents
A 4 Soln
A 4 Soln
Spring 2016
Assignment 4
Due: February 16th, 2016
SOLUTIONS
First use the Jacobi method and then the Gauss-Seidel method. Use as the initial guess, = =
= 1. Iterate until < 10 for all , where = 1,2,3. Compare the number of
iterations for convergence between the Gauss-Seidel method and the Jacobi method.
Jacobi
1
"# = $94 3" 4" %
8
1
"# = $78 3" 2" %
8
1
"# = $67 2" 5" %
7
1
1
1
2
10.8750
4.0424
9.1250
3.5290
78
79
9.0000
9.0000
5.0000
5.0000
iteration
"# "
"# "
"# "
8.5714
-0.0536
6.83E+00
5.60E+00
8.63E+00
4.0000
4.0000
1.03E-06
-8.35E-07
8.03E-07
-6.53E-07
1.07E-06
-8.68E-07
Gauss-Seidel
iteration
1
"# = $94 3" 4" %
8
1
"#
= $78 3"# 2" %
8
1
"# = $67 2"# 5"# %
7
1
2
1
10.8750
8.4210
1
5.4219
5.9442
1
2.5915
2.9195
9
10
8.0000
8.0000
6.0000
6.0000
3.0000
3.0000
"# "
"# "
"# "
2.45E+00
-5.22E-01
-3.28E-01
2.69E-06
3.35E-07
2.74E-06
5.55E-07
-2.72E-06
-4.92E-07
Solution domain
./ = 0
x
dummy cell
L=1
dummy cell
&
&
- + &*
&*
&
> <
+ - =
,
&*
*
= =
&
< =
+ - =
&*
*
> <
< =
*
*
Or
- < =
> + + + (- =
*
*
*
F< < = F> > + F= =
= 2
Hence
or
or
Outlet
= 2./ G
Hence
or
or
In matrix form
where,
'F ) + 'F= )
K <
)
J 'F=
0
J
0
I
F= = ( +
'F> )
'F< )
'F= )H
0
= 8,
*
0
'F> )
'F< )H
'F= )G
F> =
= 4,
*
0
2'F= )
N
0
0
M O P = O
P
0
'F> )H M H
2'F> )G ./
'F< )G + 'F> )G L G
F< = F= + F> = ( + 2
= 12
*
Thomas algorithm
20 4 0
0
16
8 12 4 0
0
O
PO P = O P
0 8 12 4
0
H
0
0 8 16 G
0
0
20
4
16
4
8
12
0
Q = O P , R = O P, S = O P and T = O P
8
12
4
0
0
8
16
0
For 2
=2
=3
=4
Back substitute
=
<
Hence
W
E
V
W
@ = @
@
V
V = V
'8)
W
'4) = 10.400
E = 12
V
20
'8)
W
@ = @ @ = 0
16 = 6.400
V
20
V = V
'8)
W
'8) = 8.923
E = 12
V
10.4
'8)
W
@ = @ @ = 0
6.4 = 4.923
V
10.4
V = V
'8)
WH
'4) = 12.414
E = 16
V
8.923
'8)
WH
@H = @H @ = 0
4.923 = 4.414
V
8.923
VH = VH
*Z[\ =
* =
@Z[\
VZ[\
@ E *#
V
*H = G =
* = H =
@H
4.414
=
= 0.356
VH 12.414
@ E *H 4.923 '4)0.356
=
= 0.711
V
8.923
* = =
* = =
@ E * 6.4 '4)0.711
=
= 0.889
V
10.4
@ E * 16 '4)0.889
=
= 0.978
V
20
'() '() = +
Use central differencing
1
= '> + < ),
2
&
> <
,
+ - =
&*
*
&
&
- + &*
&*
1
= '= + < )
2
&
< =
+ - =
&*
*
2
*
*
2
Which can be rearranged to
Or
(
(
< = + + - = + + - >
*
* 2
* 2
F< < = F> > + F= =
= 2
Hence
or
or
Outlet
= 2./ G
Hence
or
or
In matrix form,
'F ) + 'F= )
K <
)
J 'F=
0
J
0
I
where,
F= =
Thomas algorithm
'F> )
'F< )
'F= )H
0
(
+ = 6,
* 2
0
'F> )
'F< )H
'F= )G
F> =
0
2'F= )
N
0
0
M O P = O
P
0
'F> )H M H
2'F> )G ./
'F< )G + 'F> )G L G
(
= 2,
* 2
F< = F= + F> = 2
14 2 0
0
12
0
6 8 2 0
O
P O P = O P
0
0 6 8 2 H
0
0 6 10 G
0
0
14
2
12
6
8
2
0
Q = O P , R = O P, S = O P and T = O P
6
8
2
0
6
10
0
0
=8
*
For 2
=2
=3
=4
Back substitute
=
<
W
E
V
W
@ = @
@
V
V = V
'6)
W
'2) = 7.143
E = 8
V
14
'6)
W
@ = @ @ = 0
12 = 5.143
V
14
V = V
'6)
W
'2) = 6.320
E = 8
V
7.143
'6)
W
@ = @ @ = 0
5.143 = 4.320
V
7.143
V = V
'6)
WH
'2) = 8.101
E = 10
6.320
V
'6)
WH
@H = @H @ = 0
4.320 = 4.101
V
6.320
VH = VH
*Z[\ =
* =
*H = G =
* = H =
* = =
@Z[\
VZ[\
@ E *#
V
@H 4.101
=
= 0.506
VH 8.101
@ E *H 4.320 '2)0.506
=
= 0.844
V
6.320
@ E * 4.320 '2)0.844
=
= 0.956
V
7.143
* = =
@ E * 12 '2)0.956
=
= 0.994
V
14
1.2
central
upwind
anal
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
x
Figure. Numerical solution of the linear steady state Burgers equation using upwind differencing (UD) for
the convection term. Prediction with central differencing (CD) included for