Title: Ordinary Differential Equations
1Ordinary Differential Equations
2Contents
- Review
- Eulers method
- 2nd order methods
- Midpoint
- Heuns
- Runge-Kutta Method
- Systems of ODE
- Stability Issue
3Review
- DE (Differential Equation)
- An equation specifying the relations among the
rate change (derivatives) of variables - ODE (Ordinary DE) vs. PDE (Partial DE)
- The number of independent variables involved
4Review (cont)
- Solution of DE vs. Solution of Equation
5Review (cont)
Need additional conditions to specify a solution
- Solution of an differential equation
6Review (cont)
- Order of an ODE
- The highest derivative in the equation
- nth order ODE requires n conditions to specify
the solution - IVP (initial value problem) All conditions
specified at the same (initial) point - BVP (boundary value problem) otherwise
7IVP VS. BVPRevisit Shooting Problem
8IVP vs. BVP
Physical meaning
9Review (cont)
- Linearity
- No product nor nonlinear functions of y and its
derivatives - nth order linear ODE
10Focus of This Chapter
- Solve IVP of nth order ODE numerically
- e.g.,
11ODE (IVP)
- First order ODE (canonical form)
- Every nth order ODE can be converted to n first
order ODEs in the following method
12(No Transcript)
13Example
14End of Review
15The Canonical Problem
This is Eulers method
16Example
17Example (cont)
18Error Analysis(Geometric Interpretation)
Think in terms of Taylors expansion
If the true solution were a straight line,
then Euler is exact
19Error Analysis(From Taylors Expansion)
Eulers
Eulers truncation error O(Dx2) per step
1st order method
20Cumulative Error
y
x
Remark Dx? Error ? But computation time?
x 0
x T
Number of steps T/Dx Cumulative Err. (T/Dx) ?
O(Dx2) O(Dx)
21Example (Eulers)
22Methods to Improve Euler
- Motivated by Geometric Interpretation
23Midpoint Method
24Example (Midpoint)
25Heuns Method
26Example (Heuns)
27Remark
- Comparison of Euler, Heun, midpoint
- 1st order Euler
- 2nd order Heun, midpoint
- order
- All are special cases of RK (Runge-Kutta) methods
28RK Methods
29RK Methods (cont)
30Taylors Expansion
31RK 1st Order
32RK 2nd Order
33RK 2nd Order (cont)
34RK 4th Order
- Mostly commonly used one
- Higher order more evaluation, but less gain on
accuracy
35System of ODE
- Convert higher order ODE to 1st order ODEs
- All methods equally apply, in vector form
36Example (Mass-Spring-Damper System)
- Governing Equation
- After setting the initial conditions x(0) and
x(0), compute the position and velocity of the
mass for any t gt 0
37Example (cont)
38Example (cont)
set Dt0.1
39Stability Symptom
40Stability (cont)
Conditionally stable
41Discussion
- Different algorithm different stability limit
- Check Midpoint Method
- Different problem different stability limit
- use the previous problem as benchmark
42Implicit Method (Backward Euler)
43Example
- Remark
- Always stable (for this problem)
- Truncation error the same as Euler (only improve
the stability)
44Linear System of ODE with Constant Coefficients
45Semi-Implicit Euler
- Not guaranteed to be stable, but usually is
46(No Transcript)
47(No Transcript)
48Stiff Set of ODE
Use the change of variable
Get the following solution
49(No Transcript)
50Adaptive Stepsize
- Solving ODE numerically tracing the integral
curve y(x) - whats wrong with uniform step size
- Uniformly small waste effort
- Uniformly large might miss details
51Step Doubling
- Idea
- Estimate the truncation error by taking each step
twice one full step, two half steps - control the step size such that the estimated
error is not too big.
1?(2h1)
2?(h1)
Desired h0
52Ex RK 2nd Order
Overhead of f(x,y) evaluations 2?42 6
53Example
54Ex (Semi-implicit Euler)
55(No Transcript)