Ordinary Differential Equations (ODEs)
description
Transcript of Ordinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs)• Differential equations are the ubiquitous, the
lingua franca of the sciences; many different fields are linked by having similar differential equations
• ODEs have one independent variable; PDEs have more
• Examples: electrical circuits Newtonian mechanics chemical reactions population dynamics economics… and so on, ad infinitum
Example: RLC circuit
VdtiCdt
diLRi 1
LVq
LCdtdq
LR
dtqd
1
2
2
To illustrate: Population dynamics• 1798 Malthusian catastrophe• 1838 Verhulst, logistic growth• Predator-prey systems, Volterra-Lotka
Population dynamics
• Malthus:
• Verhulst: Logistic
growth
rNdtdN
rteNN 0
NKNr
dTdN )(1
000 )(1
1 Ne
KN
KNN
rt
Population dynamics
Hudson Bay Company
Population dynamics
12121
1 axbxx
preyofbiomasspredatorsofbiomass
2
1
xx
V .Volterra, commercial fishing in the Adriatic
12122
2 xbaxx
In the x1-x2 plane
)(1212
1212
1
2
1
2
axbxba
xx
dxdx
State space
)(1212
1212
1
2
1
2
axbxba
xx
dxdx
1212121212 ln.ln xaxbconstxaxb
Produces a family of concentric closed curves as shown… How to compute?
Integrate analytically!
Population dynamics1212
1
1 axbxx
22212122
2 xcxbaxx
self-limiting term
stable focus
Delay limit cycle
As functions of time
Do you believe this?
• Do hares eat lynx, Gilpin 1973
Do Hares Eat Lynx? Michael E. Gilpin The American Naturalist, Vol. 107, No. 957 (Sep. - Oct., 1973), pp. 727-730 Published by: The University of Chicago Press for The American Society of Naturalists Stable URL: http://www.jstor.org/stable/2459670
Putting equations in state-space form
)(tfyyy )(tbfAxx
12
2
21
21
)()(
so;;
xxtfyytfyx
xxyxyx
Traditional state space: planevs. xx
Example: the (nonlinear) pendulum
McMaster
0sin)/( g
Linear pendulum: small θ
1
cos
sin0
22
t
t
For simplicity, let g/l = 1
Circles!
Pendulum in the phase plane
Varieties of Behavior
• Stable focus• Periodic• Limit cycle
Varieties of Behavior
• Stable focus• Periodic• Limit cycle• Chaos …Assignment
Numerical integration of ODEs
• Euler’s Method simple-minded, basis of many others
• Predictor-corrector methods can be useful
• Runge-Kutta (usually 4th-order) workhorse, good enough for our work, but not state-of-the-art
Criteria for evaluating
• Accuracy use Taylor series, big-Oh, classical numerical analysis
• Efficiency running time may be hard to predict, sometimes step size is adaptive
• Stability some methods diverge on some problems
Euler
• Local error = O(h2)• Global accumulated) error = O(h)
(Roughly: multiply by T/h )
Euler
• Local error = O(h2)• Global (accumulated)
error = O(h)
hxxxfx 01
00 )(
)( 001 xfhxx Euler step
Euler
• Local error = O(h2)• Global (accumulated)
error = O(h)
)(2
)(2
001 fhxfhxx Taylor’s series with remainder
Euler step
Second-order Runge-Kutta (midpoint method)
• Local error = O(h3)• Global (accumulated) error = O(h2)
Fourth-order Runge-Kutta• Local error = O(h5)• Global (accumulated) error = O(h4)
Additional topics• Stability, stiff systems• Implicit methods• Two-point boundary-value problems shooting methods relaxation methods