{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Economics Dynamics Problems 94

Economics Dynamics Problems 94 - Feld plot Step 7 Combine...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
78 Economic Dynamics Step 3 Solve the differential equation using the DSolve command (not available prior to version 2.0) sol=DSolve[ y’[x]+y[x]==2x, y[x], x] Note the double equal sign in the equation. Step 4 Derive an arbitrary path by extracting out the second term in the previous result. This is accomplished with the line path=sol[[1,1,2]] Step 5 Derive a series of trajectories in the form of a table using the Table command. trajectories=Table[sol[[1,1,2]]/.C[1]->a,{a,-2,2,.5}] Note the following: (a) the solution to the differential equation is evaluated by letting C[1], the constant of integration, take the value of a . This is accomplished by adding the term ‘/. C[1]-> a (b) a is then given values between 2 and 2 in increments of 0.5. Step 6 Plot the trajectories using the Plot and Evaluate commands plottraj=Plot[ Evaluate[trajectories], {x,-2,2} ] Note that it is important to give the domain for x the same as in the direction
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Feld plot. Step 7 Combine the direction Feld plot and the trajectories plot using the Show command (not available prior to version 2.0) Show[arrows,plottraj] This Fnal result is shown in Fgure 2.8. Figure 2.9(a) (p. 46) This follows similar steps as for Fgure 2.8, and so here we shall simply list the input lines, followed by a few notes. (1) Input <<Graphics`PlotField` (2) Input malthus[t-, k-,p0-]=p0 E^(k t) (3) Input malthus[0,0.01,13] (4) Input malthus[150,0.01,13] (5) Input pop1=Plot[ malthus t,0.01,13 ], {t,0,150} ] (6) Input arrows=PlotVectorField[{1, 0.01p}, {t,0,150}, {p,0,60}] (7) Input Show[pop1,arrows, AxesOrigin->{0,0}, AxesLabel->{"t","p"} ] Input (2) and (3) are simply to check the initial population size and the Fnal population size. Input (6) has { 1, kp } (with k = 0.01) as the Frst element in the...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online