Lecture 1&2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Numerical Solutions of Partial

Differential Equations

Prof. Dr. habil. Shamsul Qamar


Introduction
• PDEs are frequently used to model phenomena in
– Science
– Engineering
– Economics
For example: They are used to study
– Chemical reactions
– Astrophysical phenomena
– Aircraft design (structural mechanics)
– Biological population
– Financial models, etc
• To write down a model, a knowledge of basic scientific
background is required.
• Same knowledge is needed for their solutions.
Tasks in NUM PDEs
 To develop efficient algorithms for computing numerical
solutions of PDEs, especially practical problems.
 Beyond learning basic techniques, it is crucial to understand
that
• how algorithms are constructed
• why they work and
• what are their limitations.

Error estimates
Mathematical information about the accuracy of
calculated numerical solution.
Source of Errors
• Model error: The inexactness of the matheamtical model for
the underlying Physical phenomena.
• Data error: Errors in the measurement of parameters entering
the model.
• Round-off errors: Error in the computer arithmetic.
• Truncation Error: Errors in the numerical method used to
solve the full mathematical system.

Main Tasks of Numerical Analysis


• Construction (development) of numerical methods.
• Convergence analysis (i.e. mathematical proof that
approximate solution converges to the desired exact solution).
PDEs
Linear PDE of order 1:
PDEs

x
x
Different PDEs and their applications
Different PDEs and their applications
Different PDEs and their applications

3:
Some well-Known PDEs

Scalar PDEs (single equation):


Some well-known PDEs
Some well-known PDEs

System of PDEs (more than one equations)


Some well-known PDEs
Well Posed Problems
(as defined by Hadamard 1902)

A problem is well posed if:


• A solution exists.
• The solution is unique.
• The solution depends continuously on the
data (boundary and/or initial conditions).

Problems which do not fulfill these criteria are ill-posed.


Well posed problems have a good chance to be solved
numerically with a stable algorithm.

Examples: Dirichlet problems for Laplace’s equation and


heat equations with specified initial conditions
Ill-posed problems
• Ill-posed problems play an important role
in some areas, for example for inverse problems
like tomography, inverse heat equation, and
nonlinear hyperbolic equations.
• Problem needs to be reformulated for
numerical treatment.
• => Add additional constraints, for example
smoothness of the solution.
• Input data need to be regularized / preprocessed.
Numerical solutions of PDEs
Numerical Solution Techniques

• Finite Difference Method


• Finite Volume Method
• Finite Element Method
Finite differences
Remember the definition of differential quotient:

• How to compute differential quotient


numerically?
• Just apply the formular above for a finite h.
• For simplicity we use an equidistant grid in
x=[0,h,2h,3h,......(n-1) h] and evaluate f(x)
on the corresponding grid points xi.
• Grid resolution h must be sufficiently high.
Depends strongly on function f(x)!
Accuracy of finite differences
We approximate the derivative of f(x)=sin(n x) on
a grid x=0 ...2 Pi with 50 (and 500) grid points by
df/dx=(f(x+h)-f(x))/h and compare
with the exact solution df/dx= n cos(n x)

Average error done by


discretisation:
50 grid points: 0.040
500 grid points: 0.004
Accuracy of finite differences
We approximate the derivative of f(x)=sin(n x) on
a grid x=0 ...2 Pi with 50 (and 500) grid points by
df/dx=(f(x+h)-f(x))/h and compare with the exact solution
df/dx= n cos(n x)

Average error done by


discretisation:
50 grid points: 2.49
500 grid points: 0.256
Higher accuracy methods

Can we use more points for higher accuracy?


Higher accuracy: Central differences

• df/dx=(f(x+h)-f(x))/h computes the derivative


at x+h/2 and not exactly at x.
• The alternative formular df/dx=(f(x)-f(x-h))/h
has the same shortcomings.
• We introduce central differences:
df/dx=(f(x+h)-f(x-h))/(2 h) which provides
the derivative at x.
• Central differences are of 2. order accuracy
instead of 1. order for the simpler methods
above.
How to find higher order formulas?
For sufficient smooth functions we describe the function
f(x) locally by polynomial of nth order. To do so n+1
grid points are required. n defines the order of the scheme.
Make a Taylor expansion (Definition ):
How to find higher order formulas?

And by linear combination we get the central difference:

At boundary points central differences might not be


possible (because the point i-1 does not exist at the
boundary i=0), but we can still find schemes of the
same order by one-sited (here right-sited) derivative:

Alternatives to one sited derivatives are periodic


boundary conditions or to introduce ghost-cells.
Higher derivatives
How to derive higher derivatives?
From the Taylor expansion

we derive by a linear combination:

Basic formular used to discretise


2.order Partial Differencial Equations
Higher order methods
By using more points (higher order polynomials) to
approximate f(x) locally we can get higher orders,
e.g. by an appropriate combination of

we get 4th order central


differences:
Accuracy of finite differences
We approximate the derivative of f(x)=sin(n x) on
a grid x=0 ...2 Pi with 50 (and 500) grid points with
1th, 2th and 4th order schemes:
1th order 2th order 4th order
n=1, 50 points 0.04 0.0017 5.4 10-6
n=1, 500 points 0.004 1.7 10-5 4.9 10-6
n=8, 50 points 2.49 0.82 0.15
n=8, 500 points 0.26 0.0086 4.5 10-5
n=20, 50 points 13.5 9.9 8.1
n=20, 500 points. 1.60 0.13 0.0017
What scheme to use?
• Higher order schemes give significant better
results only for problems which are smooth
with respect to the used grid resolution.
• Implementation of high order schemes makes
more effort and take longer computing time,
in particular for solving PDEs.
• Popular and a kind of standard are
second order methods.
• If we want to feed our PDE-solver with
(usually unsmooth) observed data higher
order schemes can cause additional
problems.
Consistency and Stability
• A numerical scheme is consistent if the truncation
error tends to zero for h→0 and k→0.

• Von-Neumann stability analysis:


– Fourier Transforms and Parcival’s identity are used as basic
tools to do stability analysis.

CAAM 452 Spring 2005


Finite Volume Method
• Function values are calculated at discrete places on a meshed geometry.
• Finite volume refers to small volume surrounding each node point on a
mesh.
• In the finite volume method, volume integrals that contain a divergence term
are converted to surface integrals, using the divergence theorem. These
terms are then evaluated as fluxes at the surfaces of each finite volume.
• Because the flux entering a given volume is identical to that leaving the
adjacent volume, these methods are conservative.
• Another advantage of the finite volume method is that it is easily formulated
to allow for unstructured meshes.
• The method is used in many computational fluid dynamics packages.
• In summary, FVM applies to integral form of conservation law, handles
discontinuities in solutions, natural choice for heterogeneous material as
each grid cell can be assigned different material parameters, and there exist
theory for convergence, accuracy and stability.
Finite Element Method (FEM)
In a FEM the solution is expanded in terms of a set of basis
functions superimposed on a family of elements which in turn
span the region in which the solution of the differential
equation is sought.

The basis functions are chosen (given) in advance, for


example:
Finite Element Methods
The coefficients are determined by requirements on the residual

1. Galerkin Method: The residual is orthogonal to basis functions.

2. Collocation Method: The residual is zero on N discrete points.

3. Rayleigh-Ritz Method: PDE is transformed into equivalent


minimization Problem (Euler-Lagrange equation).

You might also like