2 DPoisson Heat Wave
2 DPoisson Heat Wave
2 DPoisson Heat Wave
..
.
y3
y2
y1
y0
x0 x1 x2 x3 ... xm xm+1 = a
34
conditions:
Using central difference approximations for Uxx and Uyy then the finite dif-
ference approximations for equation (5.1) are given by:
35
y4 = yn+1 = b
y3 ❤ ❤ ❤
U13 U23 U33
y2 ❤ ❤ ❤
U12 U22 U32
y1 ❤ ❤ ❤
U11 U21 U31
y0
x0 x1 x2 x3 x4 = xm+1 = a
Thus we need to solve for the interior values marked with a circle above
as the boundary values are already given. We let the vector of interior values
we are solving for be defined as:
U11
U12
U13
U21
~ =
U
U22
, vector of interior values we are solving for.
U23
U31
U32
U33
36
Uk+1,j + Uk−1,j − 4Uk,j + Uk,j+1 + Uk,j−1 = h2 fk,j becomes:
k=1 −4 1 0 1 0 0 0 0 0
U11
j=1
Uk,j Uk,j+1 Uk+1,j
k=1 1 −4 1 0 1 0 0 0 0
U12
j=2
Uk,j−1 Uk,j Uk,j+1 Uk+1,j
k=1 0 1 −4 0 0 1 0 0 0
U13
j=3
Uk,j−1 Uk,j Uk+1,j
k=1
1 0 0 −4 1 0 1 0 0
U21
j=1
Uk−1,j Uk,j Uk,j+1 Uk+1,j
k=1
0 1 0 1 −4 1 0 1 0
U22
j=2
Uk−1,j Uk,j−1 Uk,j Uk,j+1 Uk+1,j
k=2 0 0 1 0 1 −4 0 0 1
U23
j=3
Uk−1,j Uk,j−1 Uk,j Uk+1,j
k=2 0 0 0 1 0 0 −4 1 0
U31
j=1
Uk−1,j Uk,j Uk,j+1
k=3 0 0 0 0 1 0 1 −4 1
U32
j=2
Uk−1,j Uk,j−1 Uk,j Uk,j+1
k=3 0 0 0 0 0 1 0 1 −4
U33
j=3 Uk−1,j Uk,j−1 Uk,j
U10 + U01
f11
Uk,j−1 + Uk−1,j
U02
f12
Uk−1,j
U14 + U03
f13
Uk,j+1 + Uk−1,j
U20
f21
Uk,j−1
0
2
+ = h f22
U24
f23
Uk,j+1
U30 + U41
f31
Uk,j−1 + Uk+1,j
U42
f32
Uk+1,j
U34 + U43
f33
Uk,j+1 + Uk+1,j
37
ie:
−4 1 0 1 0 0 0 0 0 U11
1 −4 1 0 1 0 0 0 0
U12
0 1 −4 0 0 1 0 0 0
U13
1 0 0 −4 1 0 1 0 0
U21
0 1 0 1 −4 1 0 1 0 U22
0 0 1 0 1 −4 0 0 1
U23
0 0 0 1 0 0 −4 1 0
U31
0 0 0 0 1 0 1 −4 1 U32
0 0 0 0 0 1 0 1 −4 U33
h2 f11 − g10 − g01
h2 f12 − g02
2
h f13 − g14 − g03
h2 f21 − g20
=
h2 f22
,
h2 f23 − g24
2
h f31 − g30 − g41
h2 f32 − g42
h2 f33 − g34 − g43
or ~ = f~.
AU (5.3)
38
• If we use explicit forward Euler scheme as we did for the 1-D heat
equation the stability criteria is even stricter than for 1-D:
∆x2 + ∆y 2
∆t ≤
8β
→ this is less attractive because the time step is much smaller.
Ut = β(Uxx + Uyy )
U (tk , xi , yj ) = Uijk
∂ 2 Uijk k
Ui+1,j − 2Uijk + Ui−1,j
k
= at time tk ,
∂x2 | ∆x
{z
2
}
EARLY STEP
∂ 2 Uijk+1 k+1
Ui,j+1 − 2Uijk+1 + Ui,j−1
k+1
= at time tk+1 .
∂y 2 ∆y 2
39
This introduces an ‘early’ bias which evaluates Uxx (tk ) at an earlier time
than Uyy (tk+1 ). This bias is compensated by also evaluating Uxx (tk+2 ) at
tk+2 ; Uyy (tk+1 ) again at tk+1 and Ut (tk+3/2 ) at mid-point between tk+1 and
tk+2 :
k+3/2
∂Uij Uijk+2 − Uijk+1
= ,
∂t ∆t
∂ 2 Uijk+2 k+2
Ui+1,j − 2Uijk+2 + Ui−1,j
k+2
=
∂x2 | ∆x{z
2
}
LATE STEP
∂ 2 Uijk+1
and as before.
∂y 2
k k
The boundary conditions specify Uoj , Um+1,j , Uiok , Ui,p+1
k
, and initial condi-
0
tions specify Uij . So we are solving for 1 ≤ k ≤ m, 1 ≤ i ≤ m, 1 ≤ j ≤ p.
ie. for each interior point at time tk .
We solve the problem for both time steps tk+1 and tk+2 at the same time
using early and late definitions. If we let sx = β∆t/∆x2 , sy = β∆t/∆y 2
then Ut = β(Uxx + Uyy ) becomes:
Early step:
Late step:
40
Initial condition for plucked string
250
200
150
U
100
50
0
0 5 10 15 20 25 30 35 40 45 50
x
Figure 8.3: Initial conditions in (a) and matlab solution using explicit central
difference method for 1D wave equation with friction in (b)
..
.
y3
y2
y1
y0
x0 x1 x2 x3 ... xn xn+1 = a
T a b
We discretise: ∆t = m , ∆x = n+1 , ∆y = p+1 , tk = k∆t, xi = i∆x, yj =
j∆y0 ≤ k ≤ m, 0 ≤ i ≤ n + 1, 0 ≤ j ≤ p + 1, and let Uijk = U (tk , xi , yj )
68
Suppose we solve for n = 3 and p = 3 and have Dirichlet boundary
conditions:
k k k
U (0, y, t) = 0 = Uoj , U (a, y, t) = 0 = Un+1,j = U4j , U (x, 0, t) = 0 =
k k k
Ui0 , U (x, b, t) = 0 = Ui,p+1 = Ui4
and initial conditions:
U (x, y, 0) = f (x, y) = fij Ut (x, y, 0) = g(x, y) = gij .
Since we have Dirichlet boundary conditions: the outer boundaries of the
k k k k
region we are solving for are known: U0,j , Un+1,j , Ui,0 , Ui,p+1 , and we need to
k
find the interior values: Ui,j for 1 ≤ i ≤ n and 1 ≤ j ≤ p.
y4 = yp+1 = b
y3 ❤ ❤ ❤
U13 U23 U33
y2 ❤ ❤ ❤
U12 U22 U32
y1 ❤ ❤ ❤
U11 U21 U31
y0
x0 x1 x2 x3 x4 = xn+1 = a
β∆t2 β∆t2
We let sx = ∆x2
, sy = ∆y 2
and substitute the central difference approx-
69
imations into our PDE, Utt = β(Uxx + Uyy ) we solve for Uijk+1 :
computing U ~ k and U
~ k+1 uses the solution at U ~ k−1 .
1 0 −1
For first time step Uij needs Uij and Uij . Again we need to use the initial
conditions to find the ghost point, Uij−1 :
∂Uij0 U 1 − Uij−1
= Ut (x, y, 0) = ij = g(xi , yj ) = gij ⇒ Uij−1 = Uij1 − 2∆tgij
∂t 2∆t
Solution at first time step k = 1:
sx 0 sy 0
Uij1 = Uij0 (1 − sx − sy ) + ∆tgij + (U 0
+ Ui−1,j ) + (Ui,j+1 0
+ Ui,j−1 )
2 i+1,j 2
k
U11
Uk
12
k
U13
Uk
21
~k =
If we let U U22k
k
U
23
Uk
31
k
U32
k
U33
then for time steps, k > 1, the solution is:
U ~ k + ~b − U
~ k+1 = AU ~ k−1
where:
λ sy 0 sx 0 0 0 0 0
s
y λ sy 0 sx 0 0 0 0
0 sy λ 0 0 sx 0 0 0
s
x 0 0 λ sy 0 s x 0 0
A = 0 sx 0 sy λ sy 0 s x 0
0 0 sx 0 sy λ 0 0 sx
0 0 0 sx 0 0 λ sy 0
0 0 0 0 s x 0 sy λ sy
0 0 0 0 0 sx 0 sy λ
and λ = 2(1 − sx − sy )
70
k k
sx U01 + sy U10
k
sx U02
k k
sx U03 + sy U14
k
sy U20
b = 0
k
sy U24
k k
sx U41 + sy U30
k
sx U42
k
sx U43 + sy sk34
where
E
8.1 ⇒ EUxx = ρUtt or Utt = Uxx
ρ
q
E
elastic waves propagate with speed ρ
c2 ∇2 E = Ë and c2 ∇2 B = B̈ (8.2)
∂E
∇ · B = 0, ∇ × B = µ0 ε 0 (8.4)
∂t
taking curl of 8.3 and ~ ~ 2~
8.4 and using ∇ × (∇ × V ) = ∇(∇ · V ) − ∇ V
and ∇(∇ · E) = ∇ ǫρ0 = 0, ∇(∇ · B) = 0 gives Equation 8.2 where
q
1
c= µ0 ε 0
= 3 × 108 m/s.
71
3. Schrödinger’s Wave Equation
∂Ψ
ih̄ = HΨ
∂t
• for a wavefunction Ψ of a quantum system defined by Hamiltonian,
H.
2 2
eg. H = KE + P E = − h̄2m ∇
+ V (r)
R∞
• numerical solutions also need to satisfy −∞ |Ψ(x)|2dx = 1
72