Ordinary Differential Equations (ODEs)

25
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

description

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 - PowerPoint PPT Presentation

Transcript of Ordinary Differential Equations (ODEs)

Page 1: 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

Page 2: Ordinary Differential Equations (ODEs)

Example: RLC circuit

VdtiCdt

diLRi

1

L

Vq

LCdt

dq

L

R

dt

qd

12

2

Page 3: Ordinary Differential Equations (ODEs)

To illustrate: Population dynamics• 1798 Malthusian catastrophe• 1838 Verhulst, logistic growth• Predator-prey systems, Volterra-Lotka

Page 4: Ordinary Differential Equations (ODEs)

Population dynamics

• Malthus:

• Verhulst:

Logistic growth

rNdt

dN rteNN 0

NK

Nr

dT

dN )(1

000 )(1

1N

eKN

KN

Nrt

Page 5: Ordinary Differential Equations (ODEs)

Population dynamics

Hudson Bay Company

Page 6: Ordinary Differential Equations (ODEs)

Population dynamics

12121

1 axbx

x

preyofbiomass

predatorsofbiomass

2

1

x

x

V .Volterra, commercial fishing in the Adriatic

12122

2 xbax

x

Page 7: Ordinary Differential Equations (ODEs)

In the x1-x2 plane

)(1212

1212

1

2

1

2

axb

xba

x

x

dx

dx

Page 8: Ordinary Differential Equations (ODEs)

State space

)(1212

1212

1

2

1

2

axb

xba

x

x

dx

dx

1212121212 ln.ln xaxbconstxaxb

Produces a family of concentric closed curves as shown… How to compute?

Integrate analytically!

Page 9: Ordinary Differential Equations (ODEs)

Population dynamics

12121

1 axbx

x

22212122

2 xcxbax

x

self-limiting term

stable focus

Delay limit cycle

Page 10: Ordinary Differential Equations (ODEs)

As functions of time

Page 11: Ordinary Differential Equations (ODEs)

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

Page 12: Ordinary Differential Equations (ODEs)

Putting equations in state-space form

)(tfyyy )(tbfAxx

12

2

21

21

)(

)(

so;;

xxtf

yytfyx

xx

yxyx

Page 13: Ordinary Differential Equations (ODEs)

Traditional state space: planevs. xx

Example: the (nonlinear) pendulum

McMaster

0sin)/( g

Page 14: Ordinary Differential Equations (ODEs)

Linear pendulum: small θ

1

cos

sin

0

22

t

t

For simplicity, let g/l = 1

Circles!

Page 15: Ordinary Differential Equations (ODEs)

Pendulum in the phase plane

Page 16: Ordinary Differential Equations (ODEs)

Varieties of Behavior

• Stable focus• Periodic• Limit cycle

Page 17: Ordinary Differential Equations (ODEs)

Varieties of Behavior

• Stable focus• Periodic• Limit cycle• Chaos

…Assignment

Page 18: Ordinary Differential Equations (ODEs)

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

Page 19: Ordinary Differential Equations (ODEs)

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

Page 20: Ordinary Differential Equations (ODEs)

Euler

• Local error = O(h2)

• Global accumulated) error = O(h)

(Roughly: multiply by T/h )

Page 21: Ordinary Differential Equations (ODEs)

Euler

• Local error = O(h2)• Global (accumulated)

error = O(h)

h

xxxfx 0100 )(

)( 001 xfhxx Euler step

Page 22: Ordinary Differential Equations (ODEs)

Euler

• Local error = O(h2)• Global (accumulated)

error = O(h)

)(2

)(2

001 fhxfhxx Taylor’s series

with remainderEuler step

Page 23: Ordinary Differential Equations (ODEs)

Second-order Runge-Kutta (midpoint method)

• Local error = O(h3)

• Global (accumulated) error = O(h2)

Page 24: Ordinary Differential Equations (ODEs)

Fourth-order Runge-Kutta

• Local error = O(h5)

• Global (accumulated) error = O(h4)

Page 25: Ordinary Differential Equations (ODEs)

Additional topics

• Stability, stiff systems

• Implicit methods

• Two-point boundary-value problems

shooting methods

relaxation methods