Professional Documents
Culture Documents
© McGraw Hill 1
Ordinary Differential Equations (ODEs)
dv c v = dependent variable
g v
dt m t = independent variable
© McGraw Hill 2
Mathematical Background
When a function involves one independent variable, the
equation is called an ordinary differential equation (or
ODE). A partial differential equation (or PDE)
involves two or more independent variables.
Differential equations are also classified as to their
order.
• A first-order equation includes a first derivative as its
highest derivative.
• A second-order equation includes a second derivative.
© McGraw Hill 3
ODEs and Engineering Practice 1
Figure PT7.1
Access the text alternative for slide images
© McGraw Hill 4
ODEs and Engineering Practice 2
© McGraw Hill 5
CONVERTING HIGHER ORDER ODEs
INTO SYSTEM OF FIRST-ORDER ODEs 1
d 2 x1
m1 2 k x1 k ( x2 x1 )
dt
d 2 x2
m2 2 k ( x2 x1 ) k x2
dt
Define:
dx1 dx2
v1 v2
dt dt
d 2 x1 dv1 d 2 x2 dv2
2
2
dt dt dt dt
© McGraw Hill 6
CONVERTING HIGHER ORDER ODEs
INTO SYSTEM OF FIRST-ORDER ODEs 2
dx1
v1
dt
d 2 x1 dx2
m1 2 k x1 k ( x2 x1 ) v2
dt dt
d 2 x2
m2 2 k ( x2 x1 ) k x2 dv1 k x1 k ( x2 x1 )
dt
dt m1
dv2 k ( x2 x1 ) k x2
dt m2
© McGraw Hill 7
The Falling Parachutist Problem from
Chapter 1
Figure pt7.2
Access the text alternative for slide images
© McGraw Hill 8
Runga-Kutta Methods Chapter 25
dv cd v v
g
dt m
dv
f (t , v, g , cd , m)
dt
dv
f (t , v)
dt
© McGraw Hill 9
RK (RUNGE-KUTTA) METHODS
dy
f (t , y )
dt
yi 1 yi h
INCREMENT
FUNCTION
© McGraw Hill 10
Euler’s Method 1
Figure 25.2
Access the text alternative for slide images
© McGraw Hill 11
Euler’s Method 2
Figure 25.2
Access the text alternative for slide images
© McGraw Hill 12
Euler’s Method 3
© McGraw Hill 13
Euler’s Method 4
Figure 25.3
Access the text alternative for slide images
© McGraw Hill 14
Error Analysis for Euler’s Method 1
• Round-off errors.
© McGraw Hill 15
Error Analysis for Euler’s Method 2
Figure 25.4
(a) Comparison of two
numerical solutions with
Euler’s method using step
sizes of 0.5 and 0.25.
© McGraw Hill 17
Improvements of Euler’s method
A fundamental source of error in Euler’s method is that
the derivative at the beginning of the interval is assumed
to apply across the entire interval.
Two simple modifications are available to circumvent this
shortcoming:
• Heun’s Method.
• The Midpoint (or Improved Polygon) Method.
© McGraw Hill 18
Heun’s method 1
Predictor: yi01 yi f ( xi , yi )h
f ( xi , yi ) f ( xi 1 , yi01 )
Corrector: yi 1 yi h
2
© McGraw Hill 19
Heun’s method 2
• Predictor
• Corrector
Figure 25.9
Access the text alternative for slide images
© McGraw Hill 20
Heun’s Method Iteration
Figure 25.10
Access the text alternative for slide images
© McGraw Hill 21
The Midpoint (or Improved Polygon)
Method 1
Figure 25.12
Access the text alternative for slide images
© McGraw Hill 22
The Midpoint (or Improved Polygon)
Method 2
h
yi 1/2 yi f (ti , yi )
2
© McGraw Hill 23
Runge-Kutta Methods (RK) 1
Increment function
a1k1 a2 k2 an kn
where a’s = constants
k1 f ( xi , yi )
k2 f ( xi p1h, yi q11k1h)
k3 f ( xi p3 h, yi q21k1h q22 k2 h)
kn f ( xi pn 1h, yi qn 1k1h
qn 1,2 k2 h qn 1,n 1 kn 1 h)
© McGraw Hill 24
Runge-Kutta Methods (RK) 2
yi 1 yi (a1k1 a2 k2 )h
k1 f ( x i , yi )
k2 f ( xi p1h, yi q11k1h)
© McGraw Hill 25
Derivation of a Second-order RK Method 1
• Values of a1, a2, p1, and q11 are evaluated by setting the
second-order equation to a second-order Taylor series
expansion. Comparing like terms leads to the following
3 equations to evaluate the 4 unknowns constants.
a1 a2 1
A value is assumed for one
1
a 2 p1 of the unknowns to solve
2
for the other three.
1
a2 q11
2
© McGraw Hill 26
Derivation of a Second-order RK Method 2
Figure 25.14
© McGraw Hill 28
Systems of Equations
• Many practical problems in engineering and science require the
solution of a system of simultaneous ordinary differential
equations rather than a single equation:
dy1
f1 x, y1 , y2 , , yn
dx
dy2
f 2 x, y1 , y2 , , yn
dx
dyn
f n x, y1 , y2 , , yn
dx
• Solution requires that n initial conditions be known at the starting
value of x.
© McGraw Hill 29
Adaptive Runge-Kutta Methods
• For an ODE with an
abrupt changing
solution, a constant
step size can
represent a serious
limitation.
Figure 25.20
Access the text alternative for slide images
© McGraw Hill 30
Step-Size Control of Runge-Kutta
Methods 1
• The strategy is to increase the step size if the error is too small
and decrease it if the error is too large. Press et al. (1992) have
suggested the following criterion to accomplish this:
new
hnew hpresent
present
© McGraw Hill 31
Step-Size Control of Runge-Kutta
Methods 2
© McGraw Hill 32
The Results of Adaptive Step-Size Control
Figure (a) A bell-shaped forcing function that induces an abrupt change in the solution of an ODE
[Eq. (E25.14.1)]. (b) The solution. The points indicate the predictions of an adaptive
step-size routine.
© McGraw Hill 33