Professional Documents
Culture Documents
Lecture 2: Introduction To Ordinary Differential Equations BY
Lecture 2: Introduction To Ordinary Differential Equations BY
Nonlinear Analysis)
Lecture 2: Introduction to
Ordinary
Differential Equations
BY:
Abdul Ghani Khan
M.tech
School of ICT,GBU
Why bother?
• Last week we considered Minsky’s Financial Instability
Hypothesis as an expression of the “endogenous
instability” explanation of volatility in finance (and
economics)
• The FIH claims that expectations will rise during periods
of economic stability (or stable profits).
• That can be expressed as
– % rate of change of expectations = f(rate of growth),
or in symbols
1 dE 1 dY
f
E dt Y dt
This is an ordinary differential equation (ODE); exploring
this model mathematically (in order to model it) thus
requires knowledge of ODEs
Why bother?
• In general, ODEs (and PDEs) are used to model real-life
dynamic processes
– the decay of radioactive particles
– the growth of biological populations
– the spread of diseases
– the propagation of an electric signal through a circuit
• Equilibrium methods (simultaneous algebraic equations
using matrices etc.) only tell us the resting point of a
real-life process if the process converges to equilibrium
(i.e., if the dynamic process is stable)
• Is the economy static?
Economies and economic methodology
• Economy clearly dynamic, economic methodology primarily
static.Why the difference?
• Historically: the KISS principle:
– “If we wished to have a complete solution ... we should
have to treat it as a problem of dynamics. But it would
surely be absurd to attempt the more difficult question
when the more easy one is yet so imperfectly within our
power.” (Jevons 1871 [1911]: 93)
– “...dynamics includes statics... But the statical solution…
is simpler...; it may afford useful preparation and
training for the more difficult dynamical solution; and it
may be the first step towards a provisional and partial
solution in problems so complex that a complete
dynamical solution is beyond our attainment.” (Marshall,
1907 in Groenewegen 1996: 432)
Economies and economic methodology
• A century on, Jevons/Marshall attitude still dominates most
schools of economic thought, from textbook to journal:
– Taslim & Chowdhury, Macroeconomic Analysis for Australian
Students: “the examination of the process of moving from
one equilibrium to another is important and is known as
dynamic analysis. Throughout this book we will assume that
the economic system is stable and most of the analysis will be
conducted in the comparative static mode.” (1995: 28)
– Steedman, Questions for Kaleckians: “The general point
which is illustrated by the above examples is, of course, that
our previous 'static' analysis does not 'ignore' time. To the
contrary, that analysis allows enough time for changes in
prime costs, markups, etc., to have their full effects.”
(Steedman 1992: 146)
Economies and economic methodology
• Is this valid?
– Yes, if equilibrium exists and is stable
– No, if equilibrium does not exist, is not stable, or is one of
many...
• Economists assume the former. For example, Hicks on Harrod:
– “In a sense he welcomes the instability of his system,
because he believes it to be an explanation of the tendency
to fluctuation which exists in the real world. I think, as I
shall proceed to show, that something of this sort may well
have much to do with the tendency to fluctuation. But
mathematical instability does not in itself elucidate
fluctuation. A mathematically unstable system does not
fluctuate; it just breaks down. The unstable position is one in
which it will not tend to remain.” (Hicks 1949)
Lorenz’s Butterfly
• So, do unstable situations “just break down”?
– An example: Lorenz’s stylised model of 2D fluid flow
under a temperature gradient
• Lorenz’s model derived by 2nd order Taylor expansion of
Navier-Stokes general equations of fluid flow. The result:
dx
a y x x displacement
dt
dy
b z x y y displacement
dt
dz
dt
xy cz temperature gradient
a 5 x 3.742 3.742 0
b 15 So that the y 3.742 , 3.742 , 0
c 1 equilibria are z 14 14 0
Lorenz_Any.vsm
Lorenz’s Butterfly
• Now you know where the “butterfly effect” came from
– Aesthetic shape and, more crucially
• All 3 equilibria are unstable (shown later)
– Probability zero that a system will be in an equilibrium
state (Calculus “Lebesgue measure”)
• Before analysing why, review economists’ definitions of
dynamics in light of Lorenz:
– Textbook: “the process of moving from one equilibrium
to another”. Wrong:
– system starts in a non-equilibrium state, and moves
to a non-equilibrium state
– not equilibrium dynamics but far-from equilibrium
dynamics
Lorenz’s Butterfly
– Founding father: “mathematical instability does not in
itself elucidate fluctuation. A mathematically unstable
system does not fluctuate; it just breaks down”. Wrong:
• System with unstable equilibria does not “break down” but
demonstrates complex behaviour even with apparently
simple structure
• Not breakdown but complexity
– Researcher: “static … analysis allows enough time for
changes in prime costs, markups, etc., to have their full
effects”. Wrong:
• Complex system will remain far from equilibrium even if
run for infinite time
• Conditions of equilibrium never relevant to systemic
behaviour
When economists are right
• Economist attitudes garnered from understanding of linear
dynamic systems
– Stable linear systems do move from one equilibrium to
another
– Unstable linear dynamic systems do break down
– Statics is the end point of dynamics in linear systems
• So economics correct to ignore dynamics if economic
system is
– linear, or
– nonlinearities are minor;
– one equilibrium is an attractor; and
– system always within orbit of stable equilibrium
• Who are we kidding?…Nonlinearity rules:
Nonlinearities in economics
• Structural
– monetary value of output the product of price and
quantity
• both are variables and product is quasi-quadratic
• Behavioural
– “Phillips curve” relation
• wrongly maligned in literature
• clearly a curve, yet conventionally treated as linear
• Dimensions
– massively open-multidimensional, therefore numerous
potential nonlinear interactions
• Evolution
– Clearly evolving system, therefore even more complex
than “simple” nonlinear dynamics…
Why bother?
2
X with b=15
-0
-2
-4
-6
-8
0 10 20 30 40 50 60 70 80 90 100
Time
Why Bother?
• Lorenz’s bizarre graphs indicate
– Highly volatile nonlinear system could still be
systemically stable
• cycles continue forever but system never exceeds
sensible bounds
– e.g., in economics, never get negative prices
• linear models however do exceed sensible bounds
– linear cobweb model eventually generates negative
prices
– Extremely complex patterns could be generated by
relatively simple models
• The “kiss” principle again: perhaps complex systems could
be explained by relatively simple nonlinear interactions
Why Bother?
• But some problems (and opportunities)
– systems extremely sensitive to initial conditions and
parameter values
– entirely new notion of “equilibrium”
• “Strange attractors”
– system attracted to region in space, not a point
• Multiple equilibria
– two or more strange attractors generate very
complex dynamics
– Explanation for volatility of weather
• El Nino, etc.
Why bother?
in time path
-0
-2
of system.
-4 And behind
-6 the chaos,
-8
strange
0 10 20 30 40 50 60 70 80 90 100 attractors...
Tim e
Why bother?
Linear Non-linear
essentially
Algebraic trivial easy impossible very difficult very difficult impossible
Ordinary essentially
Differential easy difficult impossible very difficult impossible impossible
Partial essentially
Differential difficult impossible impossible impossible impossible impossible
Maths and the real world
• To model the vast majority of real world systems that
fall into the bottom right-hand corner of that table, we
– numerically simulate systems of ODEs/PDEs
– develop computer simulations of the relevant process
• But an understanding of the basic maths of the solvable
class of equations is still necessary to know what’s going
on in the insoluble set
– Hence, a crash course in ODEs, with some refreshers
on elementary calculus and algebra...
From Differentiation to Differential…
• In Maths 1.3, you learnt to handle equations of the form
dy
Dependent variable f x Independent variable
dx
dy
• Where f is some function. For sin x
dx
example dy
dx dx sin x dx
y cos x c
• On the other hand, differential equations are of the
form
dy • The rate of change of y is a function of its
f x, y value: y both independent & dependent
dx
• So how do we handle them? Make them look like the
stuff we know:
From Differentiation to Differential…
• The simplest differential equation is
dy
y (we tend to use t to signify time, rather than x
dt
for displacement as in simple differentiation)
• Try dy
y Divide both sides by y
solving dt
dy
this for
dt 1 A trick :
yourself: y
d
ln y 1 dy Rewrite the equation in this form :
dt y dt
d
ln y 1 Integrate both sides w.r.t. t :
dt
d
dt ln y dt ln y 1dt t c Continued...
From Differentiation to Differential…
y 0 C e s i p p 0 C e 0 C 1 C
y C e f t dt
f t e sin t
bt
Back to Calculus!
Then f f u u v v
10
d f f f
f x lim
dx x 0 x 5
lim
u u v v u v
x 0 x u( x )
u v u v u v v u u v
v( x )
0
lim u( x ) .v( x )
x 0 x
u v u v v u
lim 5
x 0 x x x
dv du
u v
dx dx 10 10
10 5 0 5 10
10 x 10
reworked to give us
“integration by parts” for
complex integrals:
Back to Calculus!
d dv du
u v u v
dx dx dx
d u v u dv v du Treat integration as a
multiplication operator
u dv d u v v du
u dv u v v du
• Convert difficult integration into an easier one by either
– reducing “u” component to zero by repeated
differentiation
– repeating “u” and solving algebraically
Back to Calculus!
• Practically
– choose for “u” something which either
• gets simpler when integrated; or
• cycles back to itself when integrated more than once
– For our example:
f t e sin t
bt
• Stage Two:
X functiona (t ) functionb t X
1 functionb t X functiona (t )
functiona (t )
X e bt
sin t dt
1 functionb t
• Finally, Stage Three: we were trying to solve the ODE:
dy bt
e sin t y 0
dt
Back to Differential Equations!
• We got to the point where the equation was in soluble form:
dy
y sin t dt
bt
e
dy
f t y 0
dt
• These are known as:
– First order
• because only a first differential is involved
– Linear
• Because there are no functions of y such as sin(y)
– Homogeneous
• Because the RHS of the equation is zero
Back to Differential Equations!
• Next stage is to consider non-homogeneous equations:
dy
f t y gt
dt
• g(t) can be thought of as a force acting on a system
• We can no longer “divide through by y” as before,
since this yields
dy g t
f t dt
y y
• which still has y on both sides of the equals sign, and
if anything looks harder than the initial equation
• So we apply the three fundamental rules of
mathematics:
The three fundamental rules of mathematics
• (1) What have you got that you don’t want?
– Get rid of it
• (2) What haven’t you got that you do want?
– Put it in
• (3) Keep things balanced
• Take a look at the equation again
dy
What does this look almost like? f t y gt
dt
d d d
The product rule: u v u v v u
dx dx dx
Non-Homogeneous First Order Linear ODEs
• The LHS of the expression
dy
f t y g t is almost in product rule
dt form
• Can we do anything to put it exactly in that
form?
– Multiply both sides by an expression (t)
dy
so that t t f t y t gt
dt
• Now we have to find a (t) such that
d
t y t dy t f t y
dt dt
• This is only possible if d t t f t
dt
The Integrating Factor Approach
• This is a first order linear homogeneous ODE, which we
already know how to solve (the only thing that makes it
apparently messy is the explicit statement of a
dependence on t in (t), which we can drop for a while):
d
f t
dt
d
f t dt
d
f t dt
This is known as the “integrating factor” ln f t dt
t e f t dt
The Integrating Factor Approach
• So if we multiply
f t y g t by t e
dy f t dt
we get
dt
f t dt dy f t dt d f t dt f t dt
e
f t e y ye
g t e
dt dt
f t dt
gt e dt
y
f t dt
e
• This is a bit like line dancing: it looks worse than it
really is.
dy
– Let’s try a couple of examples: firstly, try dt 2 t y t
dy
• The first one 2 t y t becomes
dt
dy
2t y t using the integrating factor
dt
d dy
• Now we need a such y 2 t y
dt dt
that
d
• Which is only possible 2 t
dt
if
• This is a first order homogeneous DE: piece of cake!
d
2 t dt ln 2 t dt t e
2 t 2
The Integrating Factor Approach
• Thus we multiply
dy
2 t y t by e t to yield
2
dt
t 2 dy
dt
t 2
e y 2t e
dt
d t 2
e y te t 2
• Then we integrate:
Back to basics #2:
d t 2
dt e y dt e y t e dt
t 2 t 2 the Chain Rule in
reverse
t e
t 2
dt
d t 2 t dt so u t 2
1
• Or in differential form:
2
d t 2
dt e y dt e y t e dt
t 2 t 2
1 t 2
• Putting it all together: e t 2
y e C
2
1 t 2
e C
2 1 C 1
y t 2
t 2 C e is the solution to
t2
e 2 e 2
dy
2t y t
dt
Rate of change of 10
10
other
If F x f g x
u( x )
v( x )
0
v( u( x ) )
* slope of other
• In reverse, the 5
substitution method of
=slope of composite
integration: 10 10
10 5 0 5 10
F gt C
Back to Differential Equations!
• Try the technique with
dy 2
t y 1
dt
dy 2
• Stage One: Finding : t y 1 Times integrating factor :
dt
dy 2 d
t y y iff
dt dt
d
t2
dt
d
t 2 dt
d 1 3
ln t 2
dt t
3
1 3
t
e 3
Linear First Order Non-Homogeneous
• Stage Two: apply :
1
dy 2 t3
t y 1 Times integrating factor e 3
dt
dy 2
1 3
t dy
1 3
t d 1 3
t 1 3
t
t y e t e y e y e
3 2 3 3 3
dt dt dt
d 3t 3
1 1 3 1 3
t t
dt e y dt e y e dt c
3 3