Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
/Conversion of 1. Decimal number to Binary number,
/2. Binary number to Decimal number
/3. Octal number to Decimal numbar
#include<iostream>
using namespace std;
int main()
cfw_
int num, rem, sum=0, j=1;
char ch, ch1;
cout<"Choose from the following optio
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Treatment of Irregular Boundaries
In real applications, it is very common that the elliptic pde are solved over a domain
which are irregular. The above approximation of derivatives therefore cannot be applied at the
nodes , near the boundary. In such case
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Alternating Direction Implicit Method
While dealing with Elliptic Equations in the Implicit form , the number of equations to be
solved are M N , which are quite large in number. Though the coefficient matrix has many
zeros, but it is not a banded system.
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Successive Over Relaxation Method
Any second order Elliptic Equation e.g. Laplace Equation, while solving by FD
method, always reduces to a equation containing u i , j , u i 1, j , u i 1, j and u i , j 1 which for different
values of ( i, j) may be conver
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Methods for Solving tridiagonal System
This lecture consists of solution of an important problem arising in many process,
whether we are solving Parabolic or Elliptic PDE . While applying implicit techniques in any
of the method, we usually come across wi
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Stability of onedimensional Parabolic PDE
For a given PDE, let u(x,t) be the solution of finite difference approximation and at the fixed
point (x0, t0) , let u(x0, t0) be computed as u(x0, t0) + due to range of error . The solution is thus
continued for
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Compatibility of onedimensional Parabolic
PDE
There are variety of schemes for solving Parabolic PDE, as discussed earlier. The
implementation of these depends on three basic concepts. Let the PDE be L = f , where L is
the linear operator . e.g.
2
L 2
t
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
ConvergenceofonedimensionalParabolicPDE
Whenever a Parabolic PDE is approximated by any finite difference scheme, it is very
important to verify whether the solution U of FD scheme approaches to exact solution u as
x 0, t 0 This is what we call converge
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Three Time Level scheme
Various two time level schemes, as discussed earlier are quite efficient. Richardson,
developed a scheme by replacing the time derivative with central difference scheme and
space derivative by the usual central difference approxim
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Explicit Method for Solving Parabolic PDE
One of the simplest second order Parabolic Differential Equation in onedimension is the
Heat Conduction Equation, written as:
2
u
2 u
c
t
x 2
where 0 x L, t 0
(1.1)
which arises in many real problems.
The appropr
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
EllipticPartialDifferentialEquationinPolarSystem
It is not possible always that the problem of Elliptic PDE can always be dealt with
Cartesian coordinates. Due to variety of applications of Elliptic Equations, we frequently need to
solve it in Circular do
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
EllipticPartialDifferentialEquations
(SolutioninCartesiancoordinatesystem)
Other category of second order PDE, which are basically used to characterize steady state
systems are called as Elliptic PDE. More prevalent examples are Laplace Equation and Poiss
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
The method of characteristics as discussed in the previous lecture seems to
involve sufficient computations. But when it is used as an iterative scheme,
computations using coding gives the results quite efficiently.
There are many advantages of this metho
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Solution 5
#include<iostream>
#include<cmath>
using namespace std;
int main()
cfw_
double a,b,c,d,p;
double x,x1,x2;
cout<"ax^2+bx^+c=0 is the quadratic equation "<endl;
cout<"enter the value of a =";
cin>a;
cout<"enter the value of b =";
cin>b;
cout<"ent
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
#include<iostream>
#include<cmath>
using namespace std;
int main()
cfw_
double a,b,c,d,p;
double x,x1,x2;
cout<"ax^2+bx^+c=0 is the quadratic equation "<endl;
cout<"enter the value of a =";
cin>a;
cout<"enter the value of b =";
cin>b;
cout<"enter the valu
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
/ pROGRAM TO CONVERT A NUMBER IN OTHER BASES
#include<iostream>
#include<cmath>
using namespace std;
int main()
cfw_
int num,rem,j=1;int sum=0;char opt;
cout<"A. Decimal to Binary\nB. Binary to decimal\nC. octal to Decimal\n
Enter the option :";
cin>opt;
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
/
#include<iostream>
#include<cmath>
using namespace std;
int main()
cfw_
double a[3][4];
cout<"Enter elements of matrix.\n";
for (int i=0;i<3;i+)
cfw_
for (int k=0;k<4;k+)
cfw_
cout<"Enter a["<i<"]["<k<"]
cin>a[i][k];
cout<endl;
";
cout<"\nDisplaying t
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
/ program 2 in ass 2
#include<iostream>
using namespace std;
int check(int,int);
void input();
void display();
int a,b,c,d,e,i,n,j;
int main()
cfw_
input();
display();
system("pause");
return 0;
void input()
cfw_
for(i=0;i<=4;i+)
cfw_
cout <"\nenter "< i
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Implicit Method
2
2
In order to solve the Wave equation u u by finite difference, one can
t 2 u 2
use implicit methods also. There are variety of implicit schemes. Replacing the time
derivative by CD and space derivative by the average at (j 1)th and (j+
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Convergence & Stability
As shown in the rectangular grid in the adjacent figure, the value of u at P
depends on the points marked by cross. This set of points is called numerical domain of
dependence. If the initial conditions about AB & CD are changed (d
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Explicit Method for Solving Hyperbolic PDE
One of the important class of second order PDE are the hyperbolic partial
differential equation where B2 4AC 0 corresponding to the equation:
A
2u
2u
2u
u u
B
C
F ( x, y , u , v, , ) 0
xy
x y
x 2
y 2
(1)
2u
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Method of Characteristics
If the hyperbolic pde is defined with the initial Conditions which have no
discontinuity, FD schemes are quite efficient. However with discontinuities, the
propagation of discontinuities with the solution domain is difficult to d
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Implicit Scheme
The assumption of Crank Nicholson scheme with a fictitious time level and taking the
average of space derivative at jth and ( j+1)th time level was ignored by O Brein, who developed
the scheme known as Implicit Method. In this scheme, the
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Crank Nicolson Scheme
Due to some limitations over Explicit Scheme, mainly regarding convergence and stability,
another schemes were developed which have less truncation error and which are
unconditionally convergent and stable. Crank and Nicolson in the
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Finite Difference Representation
The ultimate goal for the solution of a PDE over a continuous domain is to reduce it to
discrete model which are suitable for high speed computers. One of the standard approach is
using Finite Difference Methods which are
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Module 2
Lecture 2
Multi Step Methods
Predictor corrector Methods
Contd
Keywords: iterative methods, stability
A predictorcorrector method refers to the use of the predictor equation with one
subsequent application of the corrector equation and the value
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Module 2
Lecture 4
Multi Step Methods
Adams Moulton method
keywords: closed integration, local truncation error
Second Order Adams Moulton formula
Backward Taylor series is used for integrand in the closed integration formula:
t j1
y j1 y j
t j1
f(t, y(t
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
NPTEL Syllabus
Numerical Solution of Ordinary and Partial
Differential Equations  Web course
COURSE OUTLINE
A . N umerical Solution of Ordinary Differential Equations
1. N umerical solution of first order ordinary differential equations: Piccards
method
Numerical Solution of Ordinary and Partial Differential Equations
MATH 545

Spring 2014
Module1: Numerical Solution of Ordinary Differential Equations
Lecture 1
Numerical solution of first order ordinary differential equations
Keywords: Initial Value Problem, Approximate solution, Picard method, Taylor series
Solution of first order ordinary