Read Differential Equations text version

This document was generated at 4:34 PM, 08/28/12 Copyright 2012 Richard T. Woodward

2. The basics of differential equations1 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 x ( t ) , xt or just 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), xt or just x, all meaning the same thing. Mostly we'll use xt for completeness and concision. Hopefully, the correct meaning will always be understood in context; if not, ask. Example 1: Suppose xt is the distance traveled since you left home at t=0. xt 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 zt. Hence, the differential equation describing this relationship is xt = zt . In that case the

distance you've traveled after k hours is xt = zt dt . If your speed is constant, i.e. zt=z,

0

k

then the solution to the differential equation xt = zt dt = k z + x0 . Since you left home at

0

k

t=0, x0=0 so xt=kz. So if k=0.5 hours and z=50 miles per hour, then xk=25 miles. Another option would be to travel 50 miles per hour for 15 minutes and 70 miles per hour for 15

0.25

minutes, which would give us xt =

50dt + 70dt = 30 .

0 0

0.25

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 60×k. If instead of putting a

1

These notes are based primarily on chapter 2 of Léonard 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 x0 dollars at time t=0 is put in an account so that the balance grows continuously at the rate of interest r, i.e., xt = x0ert . In this case the differential equation is x x e rt xt = 0 = rx0 e rt = rxt or t = r . dt xt 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 x can write this as = r. x We want to solve for x as a function of other stuff, so we start by integrating both sides, x (1) x dt = rdt . t t

We know that

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

=

ln ( xt )

If we know the value of x at some point in time, e.g. if x0 = x (i.e. we have x dollars in the bank at time t=0) then, substituting for t=0, we can solve for A, x = Aer 0 = A . Hence, the specific solution is xt = xert . 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, x0 we knew that x5 = K for s>0?)

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

2- 3 II. Normal differential equations The equation x = rx is a first-order differential equation (FODE), first order in the sense that xt is the first derivative of xt with respect to t. In general, an ordinary mth order differential equation is an equation of the form mx x (m ) = g (x (m-1) , x (m- 2 ) ,..., x (2 ) , x, x, t ) . m t For example, a FODE would have xt on the LHS and xt and t on the RHS. A second order

differential equation would have = 2 x t 2 on the LHS could have and x , x and t on the x RHS. If you have the mth order equation, in principle you can get back to an equation for xt as a function of t by integrating m times. Solving the mth order differential equation will lead to an m-1th order differential equation, and solving that will lead to an m-2th 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 mth order equations x you will need m "boundary conditions" (i.e. the exact value of x, x, , or some other

derivative up to 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.

m -1

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 xt = g ( xt ) and g ( x ) = 0 then x is an equilibrium value of x.

· · · ·

What's the equilibrium for the FODE x = ax + b ? What's the equilibrium for the FODE x = rx ? What's the equilibrium for the FODE x = ax 2 + bx + c ? What's the equilibrium if x1 = 3x2 - x1 and x2 = 4 + x1 ?

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 x = ax + b .

It is instructive to walk through one way to solve such equations. First we multiply both sides by e-at and reorganize: e- at x - e - at ax = e- at b . The LHS of this equation is the time-derivative of e-atxt (using the product rule). The RHS b can easily be integrated, e - at b dt = e- at +C. -a Hence, integrating the LHS and the RHS we obtain 1 - at e - at xt = e b + C , or , canceling e - at , -a

2- 4

b + Ce at . a You should be able to solve linear FODEs in an exam situation. xt = -

(2)

It is always a good idea to check your integration. In this case, taking the derivative of (2) x with respect to t we obtain t = xt = aCeat . t b But, rewriting (2) we know that Ceat = xt + , so we can write a b xt = a xt + , or xt = axt + b . a Other relatively simple FODEs: · Suppose we have a FODE that can be written in the form x = h ( x ) g (t ) .

If we let f ( x ) = 1 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 x + a(t )x = b(t ) where a and b are now functions of t, then we can write

I ( t ) b ( t ) dt where I ( t ) = exp 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 Weisstein's 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.

x (t ) = I (t )

-1

2- 5 For example, the differential equation x = at + bxt 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 x = yt + bxt 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 . In other cases we might have two state variables, e.g., two interdependent fish variable, 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 = 0 . The equilibrium t 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 x2 = 0 isocline. xi

there is no direct pressure on one of the variables to change,

Homogeneous and non-homogeneous systems Consider first a system of linear differential equations x1 a11 a12 x1 b1 x = a - 2 21 a22 x2 b2 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 x = A -1b . But it is also frequently interesting to know how variables behave around the equilibrium. For example, do x1 and x2 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-1b 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=aet where a is a vector of constants, not all zero. Taking the time derivative of this function we obtain, 5. x = aet . So, setting the RHSs of 4 and 5 equal, we get ae t = Ax = Aae t . Canceling et, we get a=Aa or [A-I]a=0. or a12 a1 a11 - a =0 a22 - a2 21

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 2×2 matrix A, the Eigen values form part of a matrix B such that there exists a real matrix T such that T-1AT=B. B can take one of four forms, 0 0 (a ) B = 1 , (b ) B = 0 0 2

(c ) B =

0 , 1

(d ) B =

-

where 1 and 2 are distinct real roots, is a double root and ±i are conjugate complex roots where i = -1 . Depending on the roots, the stability of the system falls into six categories (see Léonard 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 2×2 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|=12 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 x1 and x2 in terms of only x1 and x2 and exogenous parameters. All other variables must be eliminated from the equations or assumed to be constant. 2. Solve for the inequalities x1 0 and x2 0 . This should leave you with two inequalities in terms of x1 and x2 that, if satisfied, mean that x1 0 and x2 0 .

3. Find the equilibria: the values of x1 and x2 such that x1 = x2 = 0 . 4. Graph the isoclines, i.e. the functions x1 = 0 and x2 = 0 in the (x1, x2) plane 5. Using the inequalities found in 2, determine the trajectories for x1 and x2 on either side of the isoclines. That is, on which side of the isoclines is each variable is increasing ( x1 > 0 and x2 > 0 ) and where are they decreasing ( x1 < 0 and x2 < 0 ). 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 system's 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 Léonard and Van Long points i-iii above and (p. 98), evaluate the system's stability. Example Consider the following example from Léonard and Van Long (p. 102): x1 is capital stock and x2 is the stock of pollution. Capital growth is assumed to be a constant fraction, s, of output, x1 with <1, and depreciates at the rate , so that the rate of change in capital can be written x1 = sx1 - x1 . The stock of pollution, x2, grows as a function of capital x1 (>1) but decays at the rate

<1, x2 = x1 - x2 . A fool-proof approach to creating phase diagrams Step 1: Automatic: x1 = sx1 - x1 and x2 = x1 - x2 Step 2: Solve for x1 0 and x2 0 and identify associated spaces in the phase diagram.

x1 0 sx1 - x1 0 sx1 x1 x1 -1 s

1 ( -1)

1 2 3

x2 0 x1 - x2 0 x1 x2 x2 x1

x1 ( s ) 4 note: since x1>0 by assumption, the inequality does not flip when dividing by x1 at step 3, while since -1<0, the inequality does flip as from 3 to 4.

2- 9

Step 3: Identify the analytical equilibrium,

x1 = 0 sx1 - x1 = 0 x1 -1 = and x2 = x1 .

x1 = s s

1

-1

Substituting in the value for x1 yields x2 =

1

( s )

( -1)

.

Step 4: Graph the isoclines, x1 = 0 and x2 = 0 x1 = ( s )

1 ( -1)

and x2 = x1 . (see below)

Step 5: Identify the regions where x1 and x2 are increasing and decreasing using the results

from the first step: x1 0 x1 ( s ) and x2 0 x2 x1 . This means that x1 is increasing to the left of its isocline, and x2 is increasing below its isocline.

1 ( -1)

x2

x1=0

x2

x2<0

x2=0

x1>0

x1<0

( s ) (

1 -1)

x1

x2

x1=0 x2=0

x2>0

x1

Putting the two together yields

( s )

1 ( -1)

x1

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

^ ^ ^ -1 x1 sx1 - x1 + sx1 -

(

)

) ( x - x^ )

1 1

^ ^ ^ -1 ^ ^ x2 x1 - x2 + x1 ( x1 - x1 ) - ( x2 - x2 ) 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 ^ x1 = sx1 - ( x1 - x1 ) ^ -1 ^ x1 ( sx1 - ) 0 x1 - x1 or = . ^ ^ - x2 - x2 x2 x1 -1 ^ -1 ^ ^ x2 = x1 ( x1 - x1 ) - ( x2 - x2 )

(

^ Step 7: Solving for the Eigen values, yields 2= -, and 1 = sx1(

1 ( -1)

-1)

- , which at the

equilibrium value of x1 = ( 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 x1/ x2?

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 x1, x2 plane the separatrix is the set of points x x along which 1 = 1 . x2 x2 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 x2=K x1 x so that x2/ x1=K. We then solve the equation 1 = K by simply plugging in the two x2 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 nonlinear (and no doubt more difficult). VII. Reading for next lecture: Léonard & Van Long pp. 127-151 VIII. References Weisstein, Eric W. "Autonomous." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Autonomous.html. [Originally accessed May 27, 2004].

Information

Differential Equations

10 pages

Find more like this

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

1226981


You might also be interested in

BETA
femsln~1.dvi
Microsoft Word - ANAENG15-ariel12-1.doc
Interphase Mass Transfer