Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Basic Problem
We wish to solve the following problem: Wave Equation:
2 2u u 2 =c 2 t x 2
Boundary Conditions:
u(0,t) = 0
and u(L, t) = 0
for all t
Initial Conditions
Discretisation Method
We consider a mesh in one space and one time dimension xi xN = L x1 x2 x3 x4 x0
t0 t1 t2 t3
x
x i = x 0 + i x
t (xi, tj)
where N x = L and t j = t 0 + j t
tj
and about x - h is
Adding these two equations and keeping terms to second order in h, we obtain
CM3900 Lecture 4
CM3900 Lecture 4
i.e.
CM3900 Lecture 4
CM3900 Lecture 4
u i, j+1 2u i, j + u i, j1 ( t )
2
=c
u i+1, j 2u i, j + u i1, j ( x ) 2
or
i.e.
where
ct = x
CM3900 Lecture 4 8
we can construct a diagram to show the relative contribution of the preceding points to ui,j+1
CM3900 Lecture 4 9
There is however a problem with the initial step from t0 to t1. Because the wave equation is a p.d.e. which is second order in the time variable, the discretised version approximates the function at on the next time-slice by using information from the preceding, as well as the current time.
10
CM3900 Lecture 4
u derivative function t
= g( x )
t =0
CM3900 Lecture 4
11
u( x i , t j + t ) u( x i , t j t ) u (x i , t j ) = 2t t =
setting j = 0, we get:
u i, j+1 u i, j1 2t
Hence
u i,1 = (u i+1,0 + u i1,0 ) + (2 2)u i,0 u i,1 1 = { (u i+1,0 + u i1,0 ) + (2 2)u i,0 + 2t g( x i )} 2 = [u i+1,0 + u i1,0 ] + (1 )u i,0 + t g( x i ) 2
CM3900 Lecture 4 13
/2
1-
/2
t g(xi)
t = t0
t = t1
CM3900 Lecture 4
14
Summary
For the initial step we use:
j = 0: j = 1:
CM3900 Lecture 4
15
Example
2 2 u u 2 Numerically solve the 1-D wave equation = c 2 2 t x with c = 1, subject to
i) ii)
u(0, t) = u(1, t) = 0
for all t
using x = 0.1 and t = 0.05 i.e. find u(x, t) for x = 0.0 to 1.0 in steps of 0.1 and t = 0.00 to 2.00 in steps of 0.05.
CM3900 Lecture 4 16
Solution
We first calculate = Initial step:
1/8 3/4 1/8 t = t0
1 ct = 4 x
t = t1
CM3900 Lecture 4
17
Solution
Subsequently
-1
1/4
3/2
1/4
CM3900 Lecture 4
18
Solution
The calculation can be set out as a table
x 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 t 0.05 0.000 0.100 0.200 0.300 0.400 0.500 0.400 0.300 0.200 0.100 0.000 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 etc
CM3900 Lecture 4 19
Solution
The solution can be graphed for various values of t
0.5 u0,i u2,i u5,i 0 u8,i u10,i 0.2 0.4 0.6 0.8 1 0.5
0.5 0.5 0 xi 1
CM3900 Lecture 4
20