Download Computerised Mathematical Methods in Engineering

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Compressed sensing wikipedia , lookup

Linear least squares (mathematics) wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Eisenstein's criterion wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Quartic function wikipedia , lookup

Finite element method wikipedia , lookup

Multidisciplinary design optimization wikipedia , lookup

System of polynomial equations wikipedia , lookup

Dynamic substructuring wikipedia , lookup

Matrix multiplication wikipedia , lookup

System of linear equations wikipedia , lookup

Horner's method wikipedia , lookup

Newton's method wikipedia , lookup

Calculus of variations wikipedia , lookup

Gaussian elimination wikipedia , lookup

False position method wikipedia , lookup

Root-finding algorithm wikipedia , lookup

Transcript
Computerised Mathematical Methods in Numerical Differentiation
Forward Difference Approximation
Engineering (HG3MCE)
Nonlinear functions
๐‘“ โ€ฒ (๐‘ฅ) โ‰ˆ
๐‘“(๐‘ฅ+โˆ†๐‘ฅ)โˆ’๐‘“(๐‘ฅ)
โˆ†๐‘ฅ
โˆ†๐‘ฅโ†’0
Bisection method
Half the interval between 2 points successively to find
root.
๐‘=
๐‘Ž+๐‘
2
Centred Difference Approximation
, if f(c)>0, a=c; if f(c)<0, b=c; iterate.
๐‘ฅ = โˆš๐‘Ž โŸน ๐‘“(๐‘ฅ) = ๐‘ฅ 2 โˆ’ ๐‘Ž
๐‘“(๐‘ฅ๐‘› )
๐‘“โ€ฒ (๐‘ฅ๐‘› )
๐‘ฅ=
1
๐‘Ž
โŸน ๐‘“(๐‘ฅ) = ๐‘Ž โˆ’
๐‘ฅ๐‘› = ๐‘ฅ๐‘›โˆ’1 โˆ’
h = ฮ”x
h
h/2
h/4
โ€ฆ
๐‘โˆ’๐‘Ž
3
โ„Ž
1
2
2๐‘›โˆ’1 โˆ’1
๐‘๐‘› (โ„Ž) = ๐‘๐‘›โˆ’1 ( ) +
ฮ”x=h
h/2n
h/2n
โ€ฆ
fโ€™n(x)
a
b
โ€ฆ
N1(h)=fโ€™(x)
#
#
#
โ€ฆ
N2(h)
#
#
โ€ฆ
โ€ฆ
#
โ€ฆ
โ„Ž
[๐‘๐‘›โˆ’1 ( ) โˆ’ ๐‘๐‘›โˆ’1 (โ„Ž)]
2
N1(h) = fโ€™(x) (using a difference approximation)
Numerical Integration (Quadrature)
Uses parabolas (quadratic
functions) using 3 points that use
the x-axis intercept as the next
approximation
๐‘±โˆš๐‘2 โˆ’4๐‘Ž๐‘
โ„Ž2
Richardsonโ€™s Extrapolation
๐‘ฅ๐‘›โˆ’1 โˆ’๐‘ฅ๐‘›โˆ’2
2๐‘
๐‘“(๐‘ฅ+โ„Ž)โˆ’2๐‘“(๐‘ฅ)+๐‘“(๐‘ฅโˆ’โ„Ž)
๐‘“โˆ— = ๐‘ +
๐‘“(๐‘ฅ๐‘›โˆ’1 )โˆ’๐‘“(๐‘ฅ๐‘›โˆ’2 )
Mullerโ€™s method
๐‘“ โ€ฒ (๐‘ฅ) โ‰ˆ
n
0
1
โ€ฆ
2โ„Ž
1
๐‘ฅ
Secant method
Uses straight lines dictated by 2 points on the graph that
close in on the root
๐‘ฅ๐‘› = ๐‘ฅ๐‘›โˆ’1 โˆ’ ๐‘“(๐‘ฅ๐‘›โˆ’1 )
๐‘“(๐‘ฅ+โ„Ž)โˆ’๐‘“(๐‘ฅโˆ’โ„Ž)
Extrapolation Techniques ฯƒ(h2)
Find better estimate by using 2 approximations (a & b)
and cancel errors.
Newton Raphson method
Differentiate function, ๐‘ฅ๐‘›+1 = ๐‘ฅ๐‘› โˆ’
๐‘“ โ€ฒ (๐‘ฅ) โ‰ˆ
๐‘
๐ผ = โˆซ๐‘Ž ๐‘“(๐‘ฅ) ๐‘‘๐‘ฅ
Fixed Point Theorem
Recast function into fixed point form, g(x):
Trapezoidal Rule (1 subinterval)
f(x)=0 ๏ƒจ x=โ€ฆ=g(x) ๏ƒจ |gโ€™(x)|max <1 ๏ƒจ only one root
Composite Trapezoid Rule
Divide h into n smaller subintervals of width h/n:
๐‘
๐ผ โ‰ˆ โˆซ๐‘Ž ๐‘ƒ1 (๐‘ฅ) ๐‘‘๐‘ฅ =
If xn+1 iteration converges, |gโ€™(root)|<1
๐‘“(๐‘Ž)+๐‘“(๐‘)
2
โ„Ž where ๐’‰ =
๐’ƒโˆ’๐’‚
๐‘ต
โ„Ž
๐ผ โ‰ˆ [๐‘“(๐‘Ž0 ) + 2๐‘“(๐‘Ž1 ) + 2๐‘“(๐‘Ž3 ) + โ‹ฏ + 2๐‘“(๐‘Ž๐‘›โˆ’1 ) + ๐‘“(๐‘)]
Interpolation
2
Straight lines: f(x0) = mx0 + d, ๐‘š =
๐‘“(๐‘ฅ1 )โˆ’๐‘“(๐‘ฅ0 )
Simpsons Rule (2 subintervals)
Interpolate with a quadratic polynomial:
๐‘ฅ1 โˆ’๐‘ฅ0
Polynomials: f(xn) = axi3 + bxi2 + cxi + d
Lagrange Polynomials
๐‘ƒ(๐‘ฅ) = ๐‘ƒ0 (๐‘ฅ) + ๐‘ƒ1 (๐‘ฅ) + โ‹ฏ + ๐‘ƒ๐‘› (๐‘ฅ)
i
xi
f(xi)
x0
0
1
2nd order, ๐‘ƒ0 (๐‘ฅ) = (๐‘ฅ
nth
0 โˆ’๐‘ฅ1 ) (๐‘ฅ0 โˆ’๐‘ฅ2 )
f(x0)
(๐‘ฅโˆ’๐‘ฅ๐‘›โˆ’1 )
๐‘› โˆ’๐‘ฅ0 ) (๐‘ฅ๐‘› โˆ’๐‘ฅ1
๐‘› โˆ’๐‘ฅ๐‘›โˆ’1
order, ๐‘ƒ๐‘› (๐‘ฅ) = (๐‘ฅ
โ€ฆ (๐‘ฅ
)
f(x1)
โ„Ž๐‘›
3
๐‘“(๐‘ฅ๐‘› )
)
๐‘Ž1 = ๐‘“[๐‘ฅ0 , ๐‘ฅ1 ] =
0
a0
a1
a2
โ€ฆ
f[xi, xi+1,โ€ฆ, xn]
an
๐‘Ž2 = ๐‘“[๐‘ฅ0 , ๐‘ฅ1 , ๐‘ฅ2 ] =
๐‘“[๐‘ฅ1 ,๐‘ฅ2 ]โˆ’๐‘Ž1
๐‘Ž๐‘› = ๐‘“[๐‘ฅ๐‘– , โ€ฆ , ๐‘ฅ๐‘› ] =
๐‘“[๐‘ฅ๐‘–+1 ,โ€ฆ,๐‘ฅ๐‘› ]โˆ’๐‘“[๐‘ฅ1 ,โ€ฆ,๐‘ฅ๐‘›โˆ’1 ]
Pn(xi) = f(xi)
๐‘ฅ2 โˆ’๐‘ฅ0
๐‘ฅ๐‘› โˆ’๐‘ฅ๐‘–
[๐‘“(๐‘Ž0 ) + 4๐‘“(๐‘Ž1 ) +
[(๐‘“0 + ๐‘“2๐‘› ) + 4๐‘œ๐‘‘๐‘‘๐‘  + 2๐‘’๐‘ฃ๐‘’๐‘›๐‘ ]
๐ผโ‰ˆ
i
xi
f[xi]
f[xi, xi+1]
f[xi, xi+1, xi+2]
โ€ฆ
๐‘ฅ1 โˆ’๐‘ฅ0
3
3/8 Simpsons Rule using Newton-Cotes formula for N=3 (3
subintervals)
For nth order polynomial: ๐‘ƒ๐‘› (๐‘ฅ) = ๐‘Ž0 + ๐‘Ž1 (๐‘ฅ โˆ’ ๐‘ฅ0 ) +
๐‘Ž2 (๐‘ฅ โˆ’ ๐‘ฅ0 )(๐‘ฅ โˆ’ ๐‘ฅ1 ) + โ‹ฏ + [๐’‚๐’ (๐’™ โˆ’ ๐’™๐ŸŽ ) โ€ฆ (๐’™ โˆ’ ๐’™๐’โˆ’๐Ÿ )]
๐‘“(๐‘ฅ1 )โˆ’๐‘“(๐‘ฅ0 )
โ„Ž๐‘›
2๐‘“(๐‘Ž2 ) + 4๐‘“(๐‘Ž3 ) + 2๐‘“(๐‘Ž4 ) + โ‹ฏ + 4๐‘“(๐‘Ž2๐‘›โˆ’1 ) + ๐‘“(๐‘)] =
Divided Difference method
nth order polynomial from (n+1) points.
๐‘Ž0 = ๐‘“[๐‘ฅ0 ] = ๐‘“(๐‘ฅ0 )
3
Divide b-a into 2n subintervals: ๐ผ โ‰ˆ
๐‘“(๐‘ฅ0 )
(๐‘ฅโˆ’๐‘ฅ0 ) (๐‘ฅโˆ’๐‘ฅ1 )
โ„Ž
Composite Simpsons Rule
x1
(๐‘ฅโˆ’๐‘ฅ1 ) (๐‘ฅโˆ’๐‘ฅ2 )
๐‘
๐ผ โ‰ˆ โˆซ๐‘Ž ๐‘ƒ2 (๐‘ฅ) ๐‘‘๐‘ฅ = [๐‘“(๐‘Ž) + 4๐‘“(๐‘Ž1 ) + ๐‘“(๐‘)]
1
-
3โ„Ž
8
[๐‘“(๐‘Ž) + 3๐‘“(๐‘Ž1 ) + 3๐‘“(๐‘Ž2 ) + ๐‘“(๐‘)]
f(x)
P(x)
Extrapolation for ฯƒ(h4)
๐ผ โˆ— = ๐ผ2๐‘› + ๐œ€ = ๐ผ2๐‘› +
2
-
โ€ฆ
โ€ฆ
โ€ฆ
โ€ฆ
โ€ฆ
n
-
๐ผ2๐‘› โˆ’๐ผ๐‘›
15
h
a0=a
Richardsonโ€™s Extrapolation
โ„Ž
1
2
4 ๐‘›โˆ’1 โˆ’1
๐‘๐‘› (โ„Ž) = ๐‘๐‘›โˆ’1 ( ) +
N=2
subintervals
h
a1
an=b
โ„Ž
[๐‘๐‘›โˆ’1 ( ) โˆ’ ๐‘๐‘›โˆ’1 (โ„Ž)]
2
N1(h) corresponds to composite trapezoid rule, N2(h)
corresponds to Simpsons Rule, N2(h/2) corresponds to
composite Simpsons Rule
N
2
4
8
โ€ฆ
N1(h)
#
#
#
โ€ฆ
N2(h)
#
#
โ€ฆ
โ€ฆ
#
โ€ฆ
Linear Algebra
Numerical methods for ODEs
Gaussian Elimination for solving a linear system of equations
Ax=b where โ€œAโ€ is a nxn matrix of the left hand side of
equations, โ€œbโ€ is a vector of the right hand side, and the
๐‘ฅ
vector โ€œxโ€=(๐‘ฆ). Place โ€œAโ€ and โ€œbโ€ alongside each other in
๐‘ง
a table and manipulate each row until โ€œAโ€ becomes an
upper triangle matrix.
Can write nth order ODE as n first order ODEs
Forward Euler Method
Initial condition: y(x0) = y0
yn+1 = yn + hf(xn, yn)
xn = x0 + nh
n
0
1
2
Modified Euler Method
1
๐‘ฆ๐‘›+1 = ๐‘ฆ๐‘› + (๐‘˜1 + ๐‘˜2 )
xn
x0
x0+h
x0+2h
yn
y0
y1
y2
k1
-
k2
-
2
This method wonโ€™t work when the |pivot element| <<
|any other element of that row|.
๐‘˜1 = โ„Ž๐‘“(๐‘ฅ๐‘› , ๐‘ฆ๐‘› )
With Scaled Partial Pivoting
Matrix, ๐ด = ๐‘Ž[๐‘Ÿ๐‘œ๐‘ค ๐‘›๐‘ข๐‘š๐‘๐‘’๐‘Ÿ],[๐‘๐‘œ๐‘™๐‘ข๐‘š๐‘› ๐‘›๐‘ข๐‘š๐‘๐‘’๐‘Ÿ] = ๐‘Ž๐‘–,๐‘—
๐‘˜2 = โ„Ž๐‘“(๐‘ฅ๐‘›+1 , ๐‘ฆ๐‘›+1 ) = โ„Ž๐‘“(๐‘ฅ๐‘›+1 , ๐‘ฆ๐‘› + ๐‘˜1 )
Index vector, k = (1, 2, 3, 4)
2nd order
๐‘ฆ๐‘›+1 = ๐‘ฆ๐‘› + ๐‘Ž๐‘˜1 + ๐‘๐‘˜2
Runge-Kutta Methods
Largest elements of each row, s = (-, -, -, -)
๐‘˜1 = โ„Ž๐‘“(๐‘ฅ๐‘› , ๐‘ฆ๐‘› )
Index for iterations, m = 1 (for first step)
๐‘˜2 = โ„Ž๐‘“(๐‘ฅ๐‘› + ๐›ผโ„Ž, ๐‘ฆ๐‘› + ๐›ฝ๐‘˜1 )
Pivot row,
๐‘—=
Mod Euler when a=b=0.5, ฮฑ=ฮฒ=1; Midpoint method
when a=0, b=1, ฮฑ=ฮฒ=0.5
|๐‘Ž๐‘˜๐‘– , ๐‘š |
โˆถ ๐‘– = 1, 2, 3, 4
๐‘ ๐‘˜๐‘–
Pick kj = first index j with largest number and then swap
this with km in index vector. The number in km = pivoting
row (for all manipulations to be based upon in this turn).
k (=k1+k2) is a weighted sum of 1 (a+b=1).
4th order
1
๐‘ฆ๐‘›+1 = ๐‘ฆ๐‘› + (๐‘˜1 + 2๐‘˜2 + 2๐‘˜3 + ๐‘˜4 )
6
Matrix Inversion
1 0
Inverted matrix, A-1 ๏ƒ  ๐ด๐ดโˆ’1 = ๐ผ = [0 1
0 0
0
0]
1
๐‘˜1 = โ„Ž๐‘“(๐‘ฅ๐‘› , ๐‘ฆ๐‘› )
Determinants
The det of an upper triangular matrix is simply the
product of the diagonal elements.
Iterative Methods
Matrix needs to be diagonally dominant for methods to
converge i.e. |๐‘Ž๐‘–,๐‘— | > โˆ‘๐‘—:๐‘—โ‰ ๐‘–|๐‘Ž๐‘–,๐‘— |
Gauss-Jacobi Method
Ax=b ๏ƒจ (D+R)x=b ๏ƒจ Dx=b-Rx where D is the diagonal
of A and R is the remainder.
=
D-1(b
โ€“
Rx(n))
n
x1(n+1)
(n+1)
x2
x3(n+1)
โ€ฆ
-1 (start value)
-
Gauss-Seidel Method
Improves the Gauss-Jacobi by using the already
computed values of x(n+1) for the (n+1) stage.
๐‘˜1
2
2
โ„Ž
๐‘˜2
2
2
๐‘˜3 = โ„Ž๐‘“ (๐‘ฅ๐‘› + , ๐‘ฆ๐‘› +
Can only use: New row = Old row + Multiple of another
row
x(n+1)
โ„Ž
๐‘˜2 = โ„Ž๐‘“ (๐‘ฅ๐‘› + , ๐‘ฆ๐‘› +
0
-
1
-
Ill-conditioned Matrices
๏‚ท
When |largest element in A| x |largest element in
A-1| >> size of matrix, n.
๏‚ท
Eigenvalues differ by 2 orders of magnitude or
more.
)
)
๐‘˜4 = โ„Ž๐‘“(๐‘ฅ๐‘› + โ„Ž, ๐‘ฆ๐‘› + ๐‘˜3 )
k (inside brackets) is a weighted sum of 6.
Multistep Methods
Use (k+1) past values of y to interpolate a polynomial,
and then evaluate yn+1 from integration. yโ€™(x)=f(x,y) ๏ƒจ
๐‘ฅ
๐‘ฅ
y=f(x,y)dx ๐‘ฆ๐‘›+1 = โˆซ๐‘ฅ ๐‘›+1 ๐‘ฆ๐‘› = โˆซ๐‘ฅ ๐‘›+1 ๐‘“(๐‘ฅ, ๐‘ฆ)๐‘‘๐‘ฅ
๐‘›
Adams-Bashford (predictor)
3rd point 2nd order polynomial:
๐‘ฆ
ฬ…ฬ…ฬ…ฬ…ฬ…ฬ…
๐‘›+1 = ๐‘ฆ๐‘› +
โ„Ž
12
๐‘›
x
f(x)
(23๐‘“๐‘› โˆ’ 16๐‘“๐‘›โˆ’1 + 5๐‘“๐‘›โˆ’2 )
ฬ…ฬ…ฬ…ฬ…ฬ…ฬ…
๐‘“๐‘›+1 = ๐‘“(๐‘ฅ๐‘›+1 , ฬ…ฬ…ฬ…ฬ…ฬ…ฬ…)
๐‘ฆ๐‘›+1
Adams-Moulton (corrector)
โ„Ž
ฬ…ฬ…ฬ…ฬ…ฬ…ฬ…
๐‘ฆ๐‘›+1 = ๐‘ฆ๐‘› + (9๐‘“
๐‘›+1 + 19๐‘“๐‘› โˆ’ 5๐‘“๐‘›โˆ’1 + ๐‘“๐‘›โˆ’2 )
24
-2h
f-2
-h
f-1
0
f0
PDEs
For unknown function, c(x, y), ๐ด
๐‘“(
๐œ•๐‘ ๐œ•๐‘
,
๐œ•๐‘ฅ ๐œ•๐‘ฆ
๐œ•2 ๐‘
๐œ•๐‘ฅ 2
+๐ต
๐œ•2 ๐‘
๐œ•๐‘ฅ๐œ•๐‘ฆ
+๐ถ
๐œ•2 ๐‘
๐œ•๐‘ฆ 2
+
No-flux boundary condition:
, ๐‘ฅ, ๐‘ฆ, ๐‘) = 0
๐œ•๐‘
B2-4AC <0 : elliptic
=0 : parabolic
>0 : hyperbolic
Ellipse
Parabola Hyperbola
๏‚ท
Dirichlet boundary condition: ฯ†(x,y) on S
๏‚ท
Neumann boundary condition:
๏‚ท
Mixed boundary condition: ฯ• + โˆ‡ฯ• = 0
๐œ•๐œ™
๐œ•๐‘ฅ
๐œ•๐‘ฅ 2
+
๐œ•2 ๐œ™
๐œ•๐‘ฆ 2
=0
Compare with general formula, A=1, B=0, C=1 so
satisfies B2-4AC<0
Let ฯ†i,j = ฯ†(xi, yj) where xi=hi and yj=kj (spacing of a 2D
grid) then use centred difference approximation to get:
๐œ™๐‘–,๐‘— =
๐‘˜2
2โ„Ž2 +2๐‘˜ 2
๏‚ท
๏‚ท
๏‚ท
(๐œ™๐‘–โˆ’1,๐‘— + ๐œ™๐‘–+1,๐‘— ) +
โ„Ž2
2โ„Ž2 +2๐‘˜ 2
(๐œ™๐‘–,๐‘—โˆ’1 + ๐œ™๐‘–,๐‘—+1 )
Boundary conditions give the values of ฯ†(x,0)
ฯ†(0,y) ฯ†(x,M) ฯ†(N,y) so only internal points
need to be solved
This problem is symmetrical around y=x, so
ฯ†i,j=ฯ†j,i (i.e. only 1 half of the grid needs to be
solved)
Linear system of equations for unknown points
can be solved using Gaussian elimination
Parabolic PDEs
Heat equation in 1 dimension:
๐œ•๐‘
๐œ•๐‘ก
= โˆ‡2 c =
๐œ•2 ๐‘
๐œ•๐‘ฅ 2
๏ƒจ A=1, B=C=0
Use forward difference approximation on time derivative,
centred difference on spatial derivative:
๐‘๐‘–,๐‘—+1 โˆ’ ๐‘๐‘–,๐‘— ๐‘๐‘–+1,๐‘— โˆ’ 2๐‘๐‘–,๐‘— + ๐‘๐‘–โˆ’1,๐‘—
=
๐‘˜
โ„Ž2
โŸน ๐‘๐‘–,๐‘—+1 = ๐‘Ÿ๐‘๐‘–+1,๐‘— + (1 โˆ’ 2๐‘Ÿ)๐‘๐‘–,๐‘— + ๐‘Ÿ๐‘๐‘–โˆ’1,๐‘—
Where ci,j = c(x,t) at spatial position xi and time tj (=jk)
and ๐‘Ÿ =
โ‰ˆ
๐‘๐‘+1,๐‘— โˆ’๐‘๐‘โˆ’1,๐‘—
2โ„Ž
๐œ•๐‘
๐œ•๐‘ฅ
= 0 at x=hN
= 0 โŸน ๐‘๐‘+1,๐‘— = ๐‘๐‘โˆ’1,๐‘—
This means that all ci,j are determined by values inside
the boundaries
Initial condition [e.g. c(x,0)=sin(xฯ€)] must satisfy
boundary conditions [e.g. c(0,t)=0]
= โˆ‡ฯ• = 0
Elliptic PDE
Describes steady state behaviour, e.g.2D Laplaceโ€™s:
๐œ•2 ๐œ™
|
๐œ•๐‘ฅ x=hN
Data on boundary, S = boundary condition
โˆ‡2 ๐œ™ =
This suggests the solution of next time point (j+1) can
be found given all values of i for time point j are known.
cj = Acj-1 where state vector at time jk,
cj=[c1,j, c2,j, โ€ฆ, cn,j]t and A is nxn matrix:
๐‘จ=[
1 โˆ’ 2๐‘Ÿ
โ‹ฎ
๐‘Ÿ
โ‹ฏ
๐‘Ÿ
โ‹ฑ
โ‹ฎ ] but only valid for rโ‰ค0.5
โ‹ฏ 1 โˆ’ 2๐‘Ÿ
Crank-Nicholson Method
Acj+1 = Bcj + bj where bj = boundary data vector, ๐‘จ =
2 + 2๐‘Ÿ โ‹ฏ
โˆ’๐‘Ÿ
2 โˆ’ 2๐‘Ÿ โ‹ฏ
๐‘Ÿ
[ โ‹ฎ
โ‹ฑ
โ‹ฎ ] and ๐‘ฉ = [ โ‹ฎ
โ‹ฑ
โ‹ฎ ]
โˆ’๐‘Ÿ
โ‹ฏ 2 + 2๐‘Ÿ
๐‘Ÿ
โ‹ฏ 2 โˆ’ 2๐‘Ÿ
Hyperbolic PDEs
Wave equation:
๐œ•2 ฯ•
๐œ•t2
โˆ’ ๐‘2
๐œ•2 ฯ•
๐œ•x2
= 0 ๏ƒจ A=1, B=0, C<0
ฯ†=(ฯ†,v) where u=x+ct and v=x-ct
Approximate ฯ†i,j using centred difference approximation
at time jk and position ih:
๐œ™๐‘–,๐‘—+1 โˆ’ 2๐œ™๐‘–,๐‘— + ๐œ™๐‘–,๐‘—โˆ’1
๐œ™๐‘–+1,๐‘— โˆ’ 2๐œ™๐‘–,๐‘— + ๐œ™๐‘–โˆ’1,๐‘—
= ๐‘2
๐‘˜2
โ„Ž2
2
โŸน ๐œ™๐‘–,๐‘—+1 = 2๐œ™๐‘–,๐‘— โˆ’ ๐œ™๐‘–,๐‘—โˆ’1 + ๐‘Ÿ (๐œ™๐‘–+1,๐‘— โˆ’ 2๐œ™๐‘–,๐‘— + ๐œ™๐‘–โˆ’1,๐‘— )
where ๐‘Ÿ =
๐‘˜๐‘
โ„Ž
For t=k (j=1) use Taylor expansion:
๐œ™๐‘–,1 โ‰ˆ ๐œ™(๐‘–โ„Ž, ๐‘˜) = ๐œ™(๐‘–โ„Ž, 0) + ๐‘˜
๐œ•๐œ™(๐‘–โ„Ž,0)
๐œ•๐‘ก
+
k2 ๐œ•2 ฯ•(ih,0)
2
๐œ•t2
Where the first 2 terms are found from initial conditions
and 3rd term from wave eq
Valid for kcโ‰คh
S
ฯ†(x,M)
ฯ†N,M
๐‘˜
โ„Ž2
ฯ†i,j+1
ฯ†i-1,j
ฯ†(0,y)
ฯ†i,j
h
k
ฯ†i+1,j
h
k
ฯ†i,j-1
ฯ†0,0
ฯ†(x,0)
ฯ†(N,y)