Documente Academic
Documente Profesional
Documente Cultură
Finite Difference
Solving Finite Difference Problems
Summary
Dr. Johnson
School of Mathematics
Semester 1 2008
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
dg = −J−1 (g )φ(g )
dg = −J−1 (g )φ(g )
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
T HE P ROBLEM
Let us consider
d2 y
µ ¶
1 dy
= 32 + 2x3 − y , 1 ≤ x ≤ 3,
dx2 8 dx
43
y(1) = 17, y(3) = 3.
T HE P ROBLEM
Let us consider
d2 y
µ ¶
1 dy
= 32 + 2x3 − y , 1 ≤ x ≤ 3,
dx2 8 dx
43
y(1) = 17, y(3) = 3.
D ISCRETISATION
wi−1 wi+1
wi
h
a b
x0 x1 x2 ... xi ... xn
D ISCRETISATION
wi−1 wi+1
wi
h
a b
x0 x1 x2 ... xi ... xn
A PPROXIMATING D ERIVATIVES
and
d2 y ¯¯
¯
w − 2wi + wi−1
2
= i+1 + O ( h2 ) .
dx x=xi
¯ h2
A PPROXIMATING D ERIVATIVES
and
d2 y ¯¯
¯
w − 2wi + wi−1
2
= i+1 + O ( h2 ) .
dx x=xi
¯ h2
A PPROXIMATING D ERIVATIVES
1 2 d2 y ¯¯
¯ ¯
dy ¯¯
yi+1 = yi + h ¯ + h +...
dx x=xi 2 dx2 ¯x=xi
1 2 d2 y ¯¯
¯ ¯
dy ¯¯
yi−1 = yi − h ¯ + h −...
dx x=xi 2 dx2 ¯x=xi
A PPROXIMATING D ERIVATIVES
1 2 d2 y ¯¯
¯ ¯
dy ¯¯
yi+1 = yi + h ¯ + h +...
dx x=xi 2 dx2 ¯x=xi
1 2 d2 y ¯¯
¯ ¯
dy ¯¯
yi−1 = yi − h ¯ + h −...
dx x=xi 2 dx2 ¯x=xi
T HE D ISCRETISED P ROBLEM
x3i
µ ¶
wi+1 − 2wi + wi−1 wi+1 − wi−1
= 4 + − wi ,
h2 4 16h
for i = 1, 2, . . . , n − 1.
Boundary conditions are w0 = 17 and wn = 43/3.
These equations are nonlinear.
T HE D ISCRETISED P ROBLEM
x3i
µ ¶
wi+1 − 2wi + wi−1 wi+1 − wi−1
= 4 + − wi ,
h2 4 16h
for i = 1, 2, . . . , n − 1.
Boundary conditions are w0 = 17 and wn = 43/3.
These equations are nonlinear.
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
(k −1) (k −1)
à !
1 (k ) wi+1 − wi−1 2 (k ) 1 (k ) x3i
w + − 2 wi + w = 4 + ,
h2 i+1 16h h h2 i−1 4
(k −1) (k −1)
à ! à !
1 w (k ) 2 (k ) 1 w (k ) x3i
2
+ i wi+1 − 2 wi + 2
− i wi−1 = 4 +
h 16h h h 16h 4
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
N EWTON L INEARISATION
Suppose that we have a guess for the solution Wi ∼ wi .
Seek a correction δwi such that wi = Wi + δwi satisfies the
system.
Substituting wi = Wi + δwi into equations and linearising
gives:
N EWTON L INEARISATION
Suppose that we have a guess for the solution Wi ∼ wi .
Seek a correction δwi such that wi = Wi + δwi satisfies the
system.
Substituting wi = Wi + δwi into equations and linearising
gives:
N EWTON L INEARISATION
Suppose that we have a guess for the solution Wi ∼ wi .
Seek a correction δwi such that wi = Wi + δwi satisfies the
system.
Substituting wi = Wi + δwi into equations and linearising
gives:
µ ¶ µ ¶
1 W Wi+1 − Wi−1 2
2
+ i δwi+1 + − 2 δwi
h 16h 16h h
µ ¶
1 W
+ − i δwi−1 = Fi + O(δw2 )
h2 16h
N EWTON L INEARISATION
Suppose that we have a guess for the solution Wi ∼ wi .
Seek a correction δwi such that wi = Wi + δwi satisfies the
system.
Substituting wi = Wi + δwi into equations and linearising
gives:
x3
µ ¶
Wi+1 − Wi−1 Wi+1 − 2Wi + Wi−1
Fi = 4 + i − Wi − ,
4 16h h2
O UTLINE
1 R EVIEW
2 F INITE D IFFERENCE
Discretising the Problem
4 S UMMARY
αi ui−1 + β i ui + γi ui+1 = δi , i = 0, 1, . . . , n.
1 Wi Wi + 1 − W i − 1 2 1 Wi
αi = h2
+ 16h , βi = 16h − h2
, γi = h2
− 16h , and δi = Fi .
αi ui−1 + β i ui + γi ui+1 = δi , i = 0, 1, . . . , n.
1 Wi Wi + 1 − W i − 1 2 1 Wi
αi = h2
+ 16h , βi = 16h − h2
, γi = h2
− 16h , and δi = Fi .
Au = b
and the solution is
u = A−1 b
β 0 γ0
α1 β 1 γ1
α2 β 2 γ2
A=
.. .. ..
. . .
α n−2 β n−2 γn−2
αn−1 β n−1 γn−1
αn βn
β 0 γ0
α1 β 1 γ1
α2 β 2 γ2
A=
.. .. ..
. . .
α n−2 β n−2 γn−2
αn−1 β n−1 γn−1
αn βn
β 0 γ0
0 β 1 γ1
0 β2 γ2
A=
.. .. ..
. . .
0 β n−2 γn−2
0 β n−1 γn−1
0 βn
β 0 γ0
0 β 1 γ1
0 β2 γ2
A=
.. .. ..
. . .
0 β n−2 γn−2
0 β n−1 γn−1
0 βn
αi ui−1 + β i ui + γi ui+1 = δi , i = 0, 1, . . . , n.
αi ui−1 + β i ui + γi ui+1 = δi , i = 0, 1, . . . , n.