Sunteți pe pagina 1din 10

This document was generated at 4:34 PM, 08/28/12

Copyright 2012 Richard T. Woodward



2. The basics of differential equations
1

AGEC 637 Fall 2012
I. What is a differential equation?
A differential equation is an equation that involves a derivative of a function. In our
applications, typically the equation will define a function that is equal to the derivative
with respect to time, e.g.,
( )
( ) , ,
x t
f x z t
t

.
The LHS of this equation will frequently be written ( ), or just .
t
x t x x
Note that differential equations are used when time is measured continuously. The term
difference equation is used for the discrete-time analog.

Part of the difficulty (i.e., hassle) of optimal control is that the first order conditions yield
differential equations, which we have to integrate to obtain a closed form solution. Hence,
to solve optimal control problems we have to understand differential equations and be able
to solve them.

Notation: We will frequently write x(t), x
t
or just x, all meaning the same thing. Mostly
we'll use x
t
for completeness and concision. Hopefully, the correct meaning will always be
understood in context; if not, ask.

Example 1: Suppose x
t
is the distance traveled since you left home at t=0.
t
x is the rate of
change in distance with respect to a single unit of time, such as miles traveled per hour.
But you can choose your speed at any instant, a choice variable we will refer to as z
t
.
Hence, the differential equation describing this relationship is
t t
x z = . In that case the
distance youve traveled after k hours is
0
k
t t
x z dt =

. If your speed is constant, i.e. z


t
=z,
then the solution to the differential equation
0
0
k
t t
x z dt k z x = = +

. Since you left home at


t=0, x
0
=0 so x
t
=kz. So if k=0.5 hours and z=50 miles per hour, then x
k
=25 miles. Another
option would be to travel 50 miles per hour for 15 minutes and 70 miles per hour for 15
minutes, which would give us
0.25 0.25
0 0
50 70 30
t
x dt dt = + =

.


It is important to recognize when integrating over time, the integrand (what is inside the
integral, z in the case above) is always a rate. So, for example, if we changed our units
from miles per hour to miles per minute, then the value of z would change from, say z to
z'=z/60, and we would integrate not from 0 to k but from 0 to 60k. If instead of putting a

1
These notes are based primarily on chapter 2 of Lonard and Van Long.
2- 2
speed in the integral we put a utility function, then the correct interpretation of the utility
function is also a rate at which utility is being created, i.e., utility enjoyed per unit of time.
2


Example 2: Suppose an investment of x
0
dollars at time t=0 is put in an account so that the
balance grows continuously at the rate of interest r, i.e.,
0
rt
t
x x e = .
In this case the differential equation is
0
0
rt
rt
t t
x e
x rx e rx
dt

= = = or
t
t
x
r
x
=

.

Often, however, we are given the differential equation itself,
x rx = ,
which we need to solve. An easy way to integrate this expression is to note that since we
can write this as .
x
r
x
=


We want to solve for x as a function of other stuff, so we start by integrating both sides,

t t
x
dt rdt
x
=

. (1)
We know that
( ) ln 1
t t
x x x
t x t x

= =

, so the LHS can be easily integrated ( ) ln


t
t
x
dt x
x
=


.
The RHS is just rt. So (1) can be rewritten
( ) ln
t
x rt K = + ,
where K is the constant of integration. Taking the exp of both sides, we obtain
rt K K rt rt
t
x e e e Ae
+
= = = , where
K
A e = has an unknown value.

If we know the value of x at some point in time, e.g. if
0
x x = (i.e. we have x dollars in
the bank at time t=0) then, substituting for t=0, we can solve for A,

0 r
x Ae A

= = .
Hence, the specific solution is
rt
t
x xe = .

This example demonstrates the standard process of solving differential equations: first find
the general solution, then use prior information about value(s) at point in time to get the
specific solution. (What would the answer look like if instead of knowing, x
0
we knew that
5
x K = for s>0?)

2
An interesting side note: The psychological literature has found evidence that people do not seek to
maximize the integral of utility over time. The best-selling book Thinking Fast and Slow by Daniel
Kahneman (Nobel Prize in Economics) talks a lot about how people seem to pay more attention the peak and
end points in an experience. If this is righ, then the discounted utility model of economists may be a very
poor descriptive model of behavior. Still, it is what economists normally use and there are decent theoretical
reasons why discounted utility is a rational objective.
2- 3
II. Normal differential equations
The equation x rx = is a first-order differential equation (FODE), first order in the sense
that
t
x is the first derivative of x
t
with respect to t. In general, an ordinary m
th
order
differential equation is an equation of the form
( ) ( ) ( ) ( )
( ) t x x x x x g x
t
x
m m m
m
m
, , , ,..., ,
2 2 1

.
For example, a FODE would have
t
x on the LHS and x
t
and t on the RHS. A second order
differential equation would have
2 2
t x x = on the LHS could have and x , x and t on the
RHS.
If you have the m
th
order equation, in principle you can get back to an equation for x
t
as a
function of t by integrating m times. Solving the m
th
order differential equation will lead to
an m1
th
order differential equation, and solving that will lead to an m2
th
order differential
equation, and so on. However, each time you integrate, you end up with a new constant of
integration like A above. Hence, to reach a particular solution to an m
th
order equations
you will need m boundary conditions (i.e. the exact value of x, , x x , or some other
derivative up to
( ) 1 m
x

at some t. Despite their name, these values do not need to be known
at any boundary; the value at any point in time will do.
III. Equilibrium
An equilibrium in a dynamic system is a point at which all the variables do not change
over time. (Students often confuse equilibrium with optimum; be sure you understand the
difference.)
If ( )
t t
x g x = and ( ) 0 = x g then x is an equilibrium value of x.
What's the equilibrium for the FODE b ax x + = ?
What's the equilibrium for the FODE rx x = ?
What's the equilibrium for the FODE c bx ax x + + =
2
?
What's the equilibrium if
1 2 1
3 x x x = and
2 1
4 x x = + ?
IV. Linear first-order differential equations (FODE)
Linear first-order differential equations are the simplest form of differential equations, and
the one we'll be using most often. A linear FODE is an equation of the form b ax x + = .

It is instructive to walk through one way to solve such equations. First we multiply both
sides by e
-at
and reorganize:
at at at
e x e ax e b

= .
The LHS of this equation is the time-derivative of e
-at
x
t
(using the product rule). The RHS
can easily be integrated,
at at
b
e bdt e C
a

= +

.
Hence, integrating the LHS and the RHS we obtain
1
at at
t
e x e b C
a

= +

, or , canceling
at
e

,
2- 4

at
t
Ce
a
b
x + = . (2)
You should be able to solve linear FODEs in an exam situation.

It is always a good idea to check your integration. In this case, taking the derivative of (2)
with respect to t we obtain
at t
t
x
x aCe
t

= =

.
But, rewriting (2) we know that
at
t
b
Ce x
a
= + , so we can write
t t
b
x a x
a

= +


, or
t t
x ax b = + .
Other relatively simple FODEs:
Suppose we have a FODE that can be written in the form
( ) ( ). x h x g t =
If we let ( ) ( ) 1 f x h x = , then our FODE can be rewritten ( ) ( ) f x x g t = .
Then both sides can be integrated w.r.t. t to obtain
( )
x
f x
t

dt ( )
( ) ( )
g t dt
f x dx g t dt
=
=




If ( ) ( ) t b x t a x = + where a and b are now functions of t, then we can write
( ) ( ) ( ) ( )
1
x t I t I t b t dt

=


where ( ) ( ) exp I t a t dt

=



If you have to deal with more complicated differential equations there are a number of
good computer programs that can help. Given the sophisticated software available today
(e.g., Matlab, Maple, & Mathematica), solving complicated differential equations by hand
makes about as much sense as doing OLS with a calculator. We will go over the use of
such software in the computer lab (and see the Matlab tutorial that accompanies these
notes)
V. Autonomous ODEs
A differential equation is said to be autonomous if it does not depend on t. More formally,
according to Weissteins MathWorld, For an autonomous ODE, the solution is
independent of the time at which the initial conditions are applied. In economics, we
frequently seek to specify our problems to be autonomous since we typically feel that
economic changes are a function of the state of the system, the choices made, and random
shocks, not the calendar date.

2- 5
For example, the differential equation
t
x at bx = + is not autonomous, since the rate of
change in x depends not only on the value of x but the time, t. On the other hand, the
function
t t
x y bx = + is autonomous, at least as long as y is not a function of time.
VI. Systems of differential equations and phase diagrams
Frequently in OC we have to deal with more than one differential equation at a time. In
the simplest OC problems, for example, we have an equation in x and the co-state
variable,

. In other cases we might have two state variables, e.g., two interdependent fish
stocks or the market shares of two competing firms.

Without solving explicitly for the entire time path of the two variables, we can learn quite a
lot about the nature of a two-variable system using what is called a phase diagram. Phase
diagrams demonstrate the dynamics of the system; they graphically show the equilibria of
the model and the models' stability and dynamic evolution. Phase diagrams are
appropriate only if you have two autonomous differential equations. An example of a
phase diagram is shown below. We will discuss the steps to developing a phase diagram
toward the end of these notes.

The type of system portrayed here is known as a saddle point and is frequently encountered
in economic models. The solid lines are called isoclines, indicating that along these lines
2- 6
there is no direct pressure on one of the variables to change, 0
i
x
t

. The equilibrium
occurs where the isoclines cross where both variables do not change. The dashed lines
heading toward the equilibrium are called separatrices since they separate the space in that
no trajectory ever crosses these lines; if a path reaches a separatrix it never leaves it. The
dotted lines portray representative trajectories not on the separatrices. Note that when a
trajectory crosses an isocline its slope is consistent with the isocline. For example, the
bottom right trajectory is horizontal at the point where it crosses the
2
0 x = isocline.

Homogeneous and non-homogeneous systems
Consider first a system of linear differential equations
1 1 1 11 12
21 22 2 2 2
x x b a a
a a x x b

=


or, using matrix notation,
3.

= x Ax b.
Using a phase diagram, the equilibrium of this system could easily be identified as the
point where = Ax b , i.e. the equilibrium values of x are at
1
= x A b. But it is also
frequently interesting to know how variables behave around the equilibrium. For example,
do x
1
and x
2
tend toward the equilibrium, or away from it? It turns out that except in a
special case (see L&VL p. 101), the dynamics of the system in 3 will be identical to the
dynamics of the related homogeneous system in which the b is dropped:
4.

= x Ax ,
with the equilibrium simply relocated from A
-1
b to the origin.

Analysis of the nature of the equilibria in systems of differential equations
The nature of the equilibrium of a system of differential equation can be determined by
looking at the Eigen values of the system.

The first step in identifying the Eigen values is to guess that the solution to the
homogenous differential equation system takes a form analogous to the scalar case
discussed above. That is, we could guess that the solution will look something like x=ae
t

where a is a vector of constants, not all zero. Taking the time derivative of this function we
obtain,
5.
t
e

= x a
.
So, setting the RHSs of 4 and 5 equal, we get
t t
e e

Aa Ax a = = .
Canceling e
t
, we get
a=Aa or
[A I]a=0.
or
1 11 12
21 22 2
0
a a a
a a a



For nontrivial solutions, i.e., a0, this requires that [A I] be singular, i.e., |A I|=0. A
value that satisfies this is called an Eigen value or a characteristic root.
2- 7

For any real 22 matrix A, the Eigen values form part of a matrix B such that there exists a
real matrix T such that T
1
AT=B. B can take one of four forms,
( ) ( )
( ) ( )

B B
B B
d c
b a
,
1
0
0
0
,
0
0
2
1

where
1
and
2
are distinct real roots, is a double root and i are conjugate complex
roots where 1 i = . Depending on the roots, the stability of the system falls into six
categories (see Lonard and van Long p.98) and these determine whether the system is
stable (converging towards the equilibrium) or unstable.

You can calculate these by hand by solving the equation |A I|=0, or you can use a
software package to solve for the Eigen values. The following sequence of Matlab
commands will calculate Eigen values of a 22 matrix.

EDU>> syms A B a b c d
EDU>> A=[a,b;c,d]
a b
A
c d

=



EDU>> B=eig(A)
With the result being
B =
[ 1/2*a+1/2*d+1/2*(a^2-2*a*d+d^2+4*b*c)^(1/2)]
[ 1/2*a+1/2*d-1/2*(a^2-2*a*d+d^2+4*b*c)^(1/2)]

As noted by L&VL (p. 100):
i. Such a system has a stable equilibrium if and only if its characteristic roots have
negative real parts.
ii. A Saddle point occurs if and only if the determinant of A is negative
iii. A sufficient condition for instability is that the trace of A>0.

For all but case d above, the determinant of A, |A|=
1

2
and tr A=
1
+
2
, so conditions ii
and iii can be evaluated with the roots, or with the original A matrix.
Nonlinear systems
Of course, the above analysis is only directly relevant to linear systems. However, it can
be shown that if a linear approximation of the system is stable (unstable), then the true
system is also stable (unstable) in the neighborhood of the equilibrium. We present a
nonlinear example below.
Here are steps that I use to analyze the dynamics of a system of two differential equations
There are a variety of approaches to drawing phase diagrams; this is a way that I find quite
intuitive and helps me avoid careless mistakes.
2- 8
1. Find a reduced form for the expressions
1 2
and x x in terms of only
1 2
and x x and
exogenous parameters. All other variables must be eliminated from the equations or
assumed to be constant.
2. Solve for the inequalities 0 and 0
2 1
x x . This should leave you with two
inequalities in terms of x
1
and x
2
that, if satisfied, mean that 0 and 0
2 1
x x .
3. Find the equilibria: the values of x
1
and x
2
such that
1 2
0 x x = = .
4. Graph the isoclines, i.e. the functions 0 and 0
2 1
= = x x in the (x
1
, x
2
) plane
5. Using the inequalities found in 2, determine the trajectories for x
1
and x
2
on either side
of the isoclines. That is, on which side of the isoclines is each variable is increasing
(
1 2
0 and 0 x x > > ) and where are they decreasing (
1 2
0 and 0 x x < < ).
Hint: it is easiest if you carry out steps 4 and 5 separately for each isocline first before
putting the two together.
6. Take a linear approximation of the systems dynamics in the neighborhood of each
equilibrium and express it as a matrix of the form

= x Ax .
7. Check to see if any of the three conditions from L&VL p. 100 are satisified. Then, if
necessary, find the Eigen values of this linear system of equations and, following
Lonard and Van Long points i-iii above and (p. 98), evaluate the systems stability.
Example
Consider the following example from Lonard and Van Long (p. 102):
x
1
is capital stock and x
2
is the stock of pollution. Capital growth is assumed to be a
constant fraction, s, of output, x
1

with <1, and depreciates at the rate , so that the rate of


change in capital can be written
1 1 1
x sx x

= .
The stock of pollution, x
2
, grows as a function of capital x
1

(>1) but decays at the rate


<1,
2 1 2
x x x

= .
A fool-proof approach to creating phase diagrams
Step 1: Automatic:
1 1 1
x sx x

= and
2 1 2
x x x

=
Step 2: Solve for
1 2
0 and 0 x x and identify associated spaces in the phase diagram.
( )
( )
1 1 1
1 1
1
1
1 1
1
0 0 1
2
3
4
x sx x
sx x
x s
x s


2 1 2
1 2
2 1
0 0 x x x
x x
x x


note: since x
1
>0 by assumption, the inequality does not flip when dividing by x
1
at
step 3, while since 1<0, the inequality does flip as from 3 to 4.
2- 9

Step 3: Identify the analytical equilibrium,
1
1
1
1 1 1 1 1
0 0 x sx x x x
s s

| |
= = = =
|
\

and
2 1
x x

= .
Substituting in the value for x
1
yields ( )
( ) 1
2
1
x s

= .
Step 4: Graph the isoclines,
1 2
0 and 0 x x = =
( )
( ) 1 1
1
x s


= and
2 1
x x

= . (see below)

Step 5: Identify the regions where x
1
and x
2
are increasing and decreasing using the results
from the first step: ( )
( ) 1 1
1 1
0 x x s


and
2 2 1
0 x x x

. This means
that x
1
is increasing to the left of its isocline, and x
2
is increasing below its isocline.
x
1
x
2
( )
( ) 1 1
s


x
1
=0
x
1
>0 x
1
<0

x
1
x
2
x
2
=0
x
2
>0
x
2
<0

Putting the two together yields
x
1
x
2
x
2
=0
( )
( ) 1 1
s


x
1
=0

2- 10
Step 6: Find a linear approximation of the dynamics of the system.
( )
( )
( ) ( )
1 2
1
1 1 1 1 1 1
1
2 1 2 1 1 1 2 2
Let and be the equilibria identified above. In the neigborhood around this point


x x
x sx x sx x x
x x x x x x x x



+
+


We know that in most cases in the neighborhood of the equilibrium, the dynamics will be
the same as that of the homogeneous system of equations
( )
( )
( ) ( )
1
1 1 1 1
1
2 1 1 1 2 2


x sx x x
x x x x x x

=
=

or
( )
1
1 1 1 1
1
2 2 2
1
0

sx x x x
x x x
x

.

Step 7: Solving for the Eigen values, yields
2
= , and
( ) 1
1 1
sx

= , which at the
equilibrium value of ( )
( ) 1 1
1
x s


= , simplifies to ( )
1
1 = . These are both negative,
implying that we fall in case b, (with opposite arrows) so that it is globally stable in the
neighborhood the equilibrium.

What would happen if production were adversely affected by pollution, i.e. if output took
the form x
1

/ x
2
?
Separatrices
As noted above, in some models there exists an important line called a separatrix. These
are important economically for they can help us understand how state variables will change
over time as they approach an equilibrium or otherwise change over time. Karp (lecture
notes) defines a separatrix as a line in the phase space that trajectories never cross. The
reason this happens is that the slope of a separatrix is the same as the slope of the
trajectory. That is, along the separatrix, in the x
1
, x
2

plane the separatrix is the set of points
along which
2
1
2
1
x
x
x
x

.
How do we find the separatrix? Recalling that the homogeneous system is set so that the
equilibrium is at the origin, this means that we're looking for a function of the form x
2
=K x
1

so that x
2
/ x
1
=K. We then solve the equation K
x
x
=
2
1

by simply plugging in the two


state equations and solving. In linear systems there are two separatrices.
In nonlinear equations the same basic principle would hold, but the equation would be non-
linear (and no doubt more difficult).
VII. Reading for next lecture:
Lonard & Van Long pp. 127-151
VIII. References
Weisstein, Eric W. Autonomous. From MathWorldA Wolfram Web Resource.
http://mathworld.wolfram.com/Autonomous.html. [Originally accessed May 27,
2004].

S-ar putea să vă placă și