Numerical Modelling Workshop
Numerical Modelling Workshop
1
1. Introduction
The aim of this report is solving a physical problem represented by wave
equation, which is nothing but 2nd order partial differential equation using an
appropriate numerical methodology to model and solve our wave equation.
Besides, the numerical modelling we will go not so far through the analytical
solution of the wave equation to feel how much the numerical modelling
facilitate our way for solving the mathematical models.
2. Wave Equation
The wave equation is an important second-order linear partial
differential equation for the description of waves—as they occur in classical
physics—such as mechanical waves.
The wave equation is one of the most important equations in mechanics. It
describes not only the movement of strings and wires, but also the movement
of fluid surfaces, e.g., water waves. The wave equation is surprisingly simple to
derive and not very complicated to solve although it is a second order PDE.
The equation is a good description for a wide range of phenomena because it is
typically used to model small oscillations about an equilibrium, for which
systems can often be well approximated by Hooke's law. Solutions to the wave
equation are of course important in fluid dynamics, but also play an important
role in electromagnetism, optics, gravitational physics, and heat transfer.
Especially important are the solutions to the Fourier transform of the wave
equation, which define Fourier series, spherical harmonics, and their
generalizations.
The wave equation for a plane wave traveling in the x direction is
where v is the phase velocity of the wave and y represents the variable, which
is changing as the wave passes. This is the form of the wave equation which
applies to a stretched string or a plane electromagnetic wave. The
mathematical description of a wave makes use of partial derivatives.
2
In two dimensions, the wave equation takes the form:
3. Physical Problem
Our physical problem is to model and solve an oscillation of an elastic
string with 2 fixed ends as in figure 1:
Figure 1
So, we assume that the problem is 1D problem represented by the simple form
of the wave equation:
=𝑐 ------------------------------------ (1)
U: vertical displacement
C: wave propagation speed in m/s
x: spatial coordinate
t: time
C^2=T/R T: force of tension on the string R: Mass per unit length
BCs: U (0, t)=0 U (L, t)=0 L: the length of the string
ICs: U(x,0)=F(x) Ut(x,0)=G(x)
3
My assumptions in the problem:
Thin flexible string with negligible weight
The two ends of the string are clamped, so the displacements are zero at the ends
Initial displacement profile is given
Initial velocity is considered zero
=𝑐
So, we will use separation of variables technique which we can convert the 2nd
order PED to 2 ODES easy to solve.
Step 1:
Apply the method of Separation of variables obtain 2 ODEs to from PED.
Step 2:
Determine solution for ODEs satisfy BCs.
Step 3:
Use Fourier’s series for compose solution from step 2 to get a solution to PDE
that also satisfy the ICs.
1. 𝑢 = 0 @ 𝑢(0, 𝑡 )
2. 𝑢 = 0@𝑢(𝑙, 𝑡)
4
ICS:
1. 𝑈(𝑋, 0) = 𝐹(𝑋)
F(x) specify initial deflection.
2.Ut (𝑡 = 𝑜) = 𝑔(𝑥)
G(x) specify initial velocity profile assume ~ 0 means string was not in motion.
= 𝑓(𝑥) 𝑔(𝑡) _2
5
Mechanical analogy undamped oscillator
Not trivial only if K< 0 lets assume it k= −𝑝
𝑓(𝑥) = 𝐴 cos 𝑃𝑋 + 𝐵 sin 𝑃𝑋
Applying the 2 BCs we get:
A= 0 P= 𝑁∈𝑍
𝑛𝜋𝑥
𝐵𝑛 sin = 𝑓(𝑥)
𝑙
𝐵𝑛 = ∫ 𝑔 𝑥 sin 𝑑𝑥 𝑛𝜖𝑧
6
For solving the equations check MATLAB numerical code in appendix 1, Here is
the simulation results of the analytical solution:
5. Numerical Solution
We are going to attempt to solve this physical problem using the finite
difference method as an application of the numerical mythology for
solving the mathematical models.
7
Finite difference methods convert ordinary differential equations (ODE)
or partial differential equations (PDE), which may be nonlinear, into a system of
linear equations that can be solved by matrix algebra techniques. Modern
computers can perform these linear algebra computations efficiently which,
along with their relative ease of implementation, has led to the widespread use
of FDM in modern numerical analysis. Today, FDM are one of the most
common approaches to the numerical solution of PDE, along with finite
element methods.
8
Central difference formulas from the Taylor’s series expansion:
Solution Steps:
9
Transformation to algebraic equation:
10
Now we can code our system of equations using MATLAB (Appendix 2) to
simulate the solution of the wave equation using the numerical method.
11
6. Numerical Stability Check
For the scheme to be numerically stable, you have to choose sufficiently
small-time steps.
Inputs Inputs
L=4 L=4
C=400 C=400
T=0.01 sec T=0.01 sec
Output Output
Max(u)=1.4 Max(u)=1.35
12
7. Skills Learnt and Problems over tackled
Through this workshop I have learnt the concept of mathematical
modelling and the how to think regarding the modelling of a specific
physical problem to be modelled in mathematical form to be ready for
solving either in analytical method or numerical method.
After that, I have got a dive through the analytical solution I have learnt
what is meant by the method of characteristics and how to use it to
transform the PDEs into ODE can be treated in much easier way and
solved, besides that I touched myself the importance of a preliminary
analytical solution for giving me an idea about the results that I should
obtain from the numerical model.
13
APPENDIX 1
ANALYTICAL SOLUTION MATLAB CODE
14
APPENDIX 2
NUMERICAL SOLUTION MATLAB CODE
15
REFRENCES
16