logo

M345N10 Maths Matlab Assignment 2022

Solve the one-dimensional wave equation numerically for a given initial condition and boundary conditions.

12 Pages2842 Words15 Views
   

Added on  2022-09-16

M345N10 Maths Matlab Assignment 2022

Solve the one-dimensional wave equation numerically for a given initial condition and boundary conditions.

   Added on 2022-09-16

ShareRelated Documents
Maths
Matlab assignment
Computational PDEs M345N10, 2019-2020,
Project 3 and 4
Student Name –
Student ID -
M345N10 Maths Matlab Assignment 2022_1
3a)
Here, the solution of 1 – D wave equation is found by using the Leap frog scheme. The
boundary conditions provided have been used.
The one-dimensional wave equation for u ( x ; t ) is represented as follows :
utt = uxx ; ( 1 )
Here, x represents a spatial coordinate and t represents the time.
The initial conditions are given by :
At t = 0,
U ( x ; 0 ) = cos ( ∏ x / 2 δ )
. du / dt ( x ; 0 ) = 0; for -δ < = x < = δ ; ( 2 )
At other points when x > + / - δ and t = 0, u ( x , 0 ) = du / dt = 0.
Here, this equation is solved numerically for the domain x < = + / - 2, by taking δ = 0.01, 0.1
and 0.5 (an arbitrary parameter ) ( Celledoni, 2012 ).
The solution to equation 1 is found and its evolution for t > 0 is investigated. The equation is
discretised to make it second-order accurate in time and space using the Leapfrog scheme.
U k+1, j – 2 Ukj + Uk-1j / ( ∆t ) 2 = Ukj-1 - 2Ukj + Ukj+1 ( ∆x ) 2 : (3)
At the computational end points, that is x = + / - 2, the boundary conditions considered are :
Minimal numerical reflections off the outer boundaries; i.e. the waves pass through the
boundaries and the solid wall condition.
By the help of proper calculations, the accuracy of the numerical solution is investigated,
discussed and demonstrated. The plot shows the basic features. The equation 3 represents the
modified PDE which gives an optimal value of the discretisation parameters giving the most
exact solution. The discrete dissipation-dispersion analysis helps to explain the numerical
observations.
M345N10 Maths Matlab Assignment 2022_2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-1.5
-1
-0.5
0
0.5
1
1.5
Figure 1
Leapfrog method :
This method helps to find solution of an equation by the help of approximation. The equation
can be linearised by the perturbation method which helps to investigate them analytically. It
can be used to solve non linear system equations. It is a type of numerical method. The
differential equations can be formulated using the finite difference method, finite element
method and spectral method. In the finite difference method the derivatives are approximated
by using an equation which is the difference between two adjacent points in time or space.
This converts the differential equation into a difference equation. The analytical problem
which was difficult to solve becomes an algebriac problem which is very easy to solve. The
degree of freedom is changed from infinity to a finite value. The contineous problem now
becomes a discrete problem.
The Taylor’s series expansion can be used to find the approximated expressions. This is done
by neglecting the higher order terms. The concept of forward and backward difference is used
here. Another method is using the centered differences. The two factors which need to be
M345N10 Maths Matlab Assignment 2022_3
considered are accuracy and efficiency. The centered difference method has a greater
accuracy. Another factor on which the accuracy of numerical method depends is the size of
grid step. If the grid size is small and the resolution is high. Then more computation needs to
be done.
In the one dimensional motion for the flow of a fluid, the linearisation can be done about the
mean flow by assuming the velocity as a constant. The differential equation can be
approximated to a finite difference equation in the time and space domain by using the
centered differences for the derivatives. The continuous variables which were used earlier are
changed to grid points which are discrete in nature. The method used is called leapfrog
method due to the leap of time. Here, the grid is splited into two sub - grids which are
independent of one another. Every time one time step is used to advance to the final solution.
The values of the grid steps must be small to make the results accurate. The result contains
two parts one is the physical mode and other is the computational mode. The solution for the
differential equation is represented by the physical mode. It is the analytical solution. The
amplitude for the computational mode is determined by the initial conditions. In case of
computational instability the solutions amplitude grows without bound with time. So the
numerical solution also grows without any limit with time. Hence the space grid must be
refined by decreasing the space and time step.
3b)
The two-dimensional ( 2D ) wave equation for u ( x ; y ; t ) is given by
utt = uxx + quyy ; ( 4 )
Here x; y represent spatial coordinates and q is a positive constant.
The initial conditions can be described as :
At t = 0, u ( x ; y ; 0 ) = cos ( ∏ r / 2 δ )
. du/dt ( x ; y ; 0 ) = 0; for r < = + / - δ; ( 5 )
Here , r = sqrt ( x . x + y . y )
At other points when r > + / - δ and t = 0;
M345N10 Maths Matlab Assignment 2022_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Numerical Solutions of PDE | Assignment
|12
|2653
|103

SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES
|10
|1396
|83

Linear Advection Equation - Accuracy, Stability, Convergence.
|27
|1906
|380

Engineering Mathematics
|20
|2432
|67

Solving Nonlinear System of Equations and Poisson's Equation with Dirichlet Boundary Conditions
|7
|1012
|295

Two Dimensional Non-Linear Equations
|6
|886
|15