2 Handout
2 Handout
2. Euler’s formula
Euler’s formula is very useful in the analytical study of water waves. It states that
where A and B are some coefficients (they may be complex numbers), is a solution to the
LSWE in constant depth, (2).
Under this notation, the flow velocity is calculated from the second equation in (1) as
gk ikx −iωt gk −ikx −iωt
U (x, t) = Ae e − Be e . (5)
ω ω
1
ESOE 5136 2021 March 8 - Handout Lo
Thus, we see that (6) essentially states “η(x, t) is the Fourier transform of ζ(x, t)”. Con-
sequently, ζ(x, ω) is the inverse Fourier transform of η(x, t):
Z ∞
1
η(x, t)eiωt dt = F −1 η(x, t)
ζ(x, ω) = √
2π −∞
Z ∞ . (9)
1
ζ(x, ω)e−iωt dω = F ζ(x, ω)
η(x, t) = √
2π −∞
The use of Euler’s formula together with Fourier transform are very helpful in the analytical
study of LSWE. Some reasons include:
(a) We only need to solve the problem for one single wave frequency ω, and then just
integrate over the frequency domain to get the desired wave form.
(b) Fourier transform simplifies differentiation. For example, ηt = −iωη.
(c) Many functions have tabulated Fourier transforms, allowing us to obtain closed-form
analytical solutions.
有限 差 分 法 )
4. Basic finite difference methods (有
The Taylor series expansion of a function f (x) about a point x = x0 is
If we keep only the first term, we end up with the first-order accurate forward-
difference formula:
f (x0 + ∆x) − f (x0 )
f 0 (x0 ) = + O(∆x). (12)
∆x
Using this approximation, we know the largest truncation error scales with ∆x – the other
truncation terms are O(∆x2 ), O(∆x3 ), etc. If ∆x is small (which is what we want), the
higher-order terms will be much smaller than the leading-order term. Therefore, when we
decrease the size of ∆x, we expect the approximation to become more accurate, at a rate of
O(∆x) – this is called the rate of convergence (收 收斂 速率). Since the convergence rate of
the forward-difference formula (18) is first-order in terms of ∆x, we call this approximation
to be first-order accurate.
2
ESOE 5136 2021 March 8 - Handout Lo
3
ESOE 5136 2021 March 8 - Handout Lo
where ∆t is the step size in time, ∆x is the step size in space, the subscript i is used to
denote the i-th discretized node in space, the superscript (n) is used to denote variables
at the current time step, and the superscript (n + 1) is used to denote variables at the new
time step.
Substituting these approximations into the 1DH LSWE (1), we obtain
(n) (n)
(n+1) (n)
∂η ∂(U h) ηi − ηi Ui+1 hi+1 − Ui−1 hi−1
∂t = − ⇒ = −
∂x ∆t 2∆x
. (22)
(n+1) (n) (n) (n)
∂U = −g ∂η ⇒ Ui
− Ui ηi+1 − ηi−1
= −g
∂t ∂x ∆t 2∆x
From these two equations, we acquire means to update ηi and Ui in time:
(n+1) (n) ∆t (n) (n)
η i = η i − Ui+1 hi+1 − U i−1 hi−1
2∆x
. (23)
(n+1) (n) ∆t
(n) (n)
Ui
= Ui − g ηi+1 − ηi−1
2∆x
In addition, numerical boundary conditions need to be imposed at the two ends.
The numerical scheme (23) is a very intuitive way to solve the 1DH LSWE (1). It is
first-order accurate in time and second-order accurate in space. However, this method is
actually “unconditionally unstable”, which means that the numerical results will eventually
“blow up” regardless of the sizes of ∆x and ∆t. Therefore, while this scheme is helpful
for learning numerical methods, it is never used in practice. We will discuss an improved
(yet still very basic) method next.
4
ESOE 5136 2021 March 8 - Handout Lo
While the Lax-Friedrichs method is easy to understand and numerically stable, it has
significant numerical dissipation. This means that the numerical solution is damped as if
there were artificial friction – it becomes smaller and smaller over time. As you will see
in Assignment#2, the wave height will decrease quickly over time due to this numerical
dissipation. As a result, the Lax-Friedrichs method is also quite useless in practice without
further modification.
If we plug the exact solutions, η(x, t) and U (x, t), of the 1DH LSWE (1) into (28), the
equation will not equal zero, because (28) is different from the original PDE. This difference
is the local truncation error L(x, t):
η(x+∆x,t)+η(x−∆x,t)
η(x, t + ∆t) − 2
∆t
. (30)
U (x + ∆x, t)h(x + ∆x) − U (x − ∆x, t)h(x − ∆x)
+ = L(x, t)
2∆x
5
ESOE 5136 2021 March 8 - Handout Lo
9. Global error
What we are ultimately interested in is the global error; that is, overall, how well the
numerical solution approximates the true solution. A commonly used measure is the L2 -
norm (範 範 數). At the n-th time step, the L2 -norm based on the free surface elevation is
calculated as
v
u
u1 X N
2 (n) (n) (n) (n)
L -norm = t (ηi,num − ηi,true )2 = ||ηnum − ηtrue ||2 , (33)
N
i=1
where N is the number of discretized nodes in space, ηi,true is the true solution at the
location of the i-th node, ηi,num is the model-predicted value at the i-th node, and the
superscript (n) denotes the current time step.
A numerical scheme is said to be convergent in the L2 -norm if
L2 -norm → 0 (34)