Economics Dynamics Problems 207

Economics Dynamics Problems 207 - Systems of first-order...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Systems of first-order differential equations sol1=NDSolve[eq1,var,trange] sol2=NDSolve[eq2,var,trange] graph1=ParametricPlot[Evaluate[{x[t],y[t]} /.sol1], {t,0,20},PlotPoints->500, DisplayFunction->Identity]; graph2=ParametricPlot[Evaluate[{x[t],y[t]} /.sol2], {t,0,20},PlotPoints->500, DisplayFunction->Identity]; Show[{graph1,graph2},AxesLabel->{` ’,` ’}, `x’ `y’ DisplayFunction->$DisplayFunction]; The more trajectories that are required the more cumbersome these instructions become. It is then that available packages, such as the one provided by Schwalbe and Wagon (1996), become useful. For instance, figure 4.36(b) can be produced using the programme provided by Schwalbe and Wagon with the following set of instructions: PhasePlot[{x’[t]==1-y[t],y’[t]==x[t]^2+y[t],^2}, {x[t],y[t]},{t,0,3},{x,-2,2},{y,-1,3}, InitialValues->{{-2,-1},{-1.75,-1},{-1.5,-1}, {-1,0},{-1,-1},{-0.5,-1},{0,-1},{-1.25,0}, {0.5,-1},{1,-1}}, PlotPoints->500, ShowInitialValues->False, DirectionArrows->False, AspectRatio->1, AxesLabel->{x,y}] When considering just one trajectory in the phase plane, the simple instructions given above can suffice. For instance, consider the Lorenz curve, given in equation (4.34), with parametric values σ = 10, r = 28, and b = 8/3. We can construct a three-dimensional trajectory from the initial point (x0, y0, z0) = (5, 0, 0) using the following input instructions: eqs:={x’[t]==10(y[t]-x[t]) ,y’[t]==28x[t]-y[t]-x[t]z[t], z’[t]==x[t]y[t]-(8/3)z[t], x[0]==5,y[0]==0,z[0]==0} var:={x,y,z} lorenzsol=NDSolve[eqs,var,{t,0,30},MaxSteps->3000] lorenzgraph=ParametricPlot3D[ Evaluate[x[t],y[t],z[t]} /.lorenzsol], {t,0,30},PlotPoints->2000,PlotRange->All]; The resulting phase line is shown in figure 4.37. This goes beyond the possibilities of a spreadsheet, and figure 4.37 should be compared with the three twodimensional plots given in figure 4.35. 191 ...
View Full Document

Ask a homework question - tutors are online