Economics Dynamics Problems 238

Economics Dynamics - Example 5.8(cont The input instructions for each programme are Mathematica Clear[x,y,t x[0:=10 y[0:=5 x[t:=x[t]=-5 0.25x[t-1

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

View Full Document Right Arrow Icon
222 Economic Dynamics Figure 5.3. 5.5.2 Trajectories with Mathematica and Maple The spreadsheet is ideal for displaying recursive systems and the resulting trajecto- ries. But occasionally it is useful to display these trajectories within Mathematica or Maple . In doing this care must be exercised in writing the simultaneous equa- tions for computation so that the programmes remember earlier results and do not recompute all previous values on each round. This leads to more cumbersome input instructions – which is why the spreadsheet is so much easier for many problems. We shall consider once again examples 5.8 and 5.9.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Example 5.8 (cont.) The input instructions for each programme are Mathematica Clear[x,y,t] x[0]:=10; y[0]:=5; x[t-]:=x[t]=-5+0.25x[t-1]+0.4y[t-1] y[t-]:=y[t]=10-x[t-1]+y[t-1] data:=Table[{x[t],y[t]},{t,0,20}]; ListPlot[data,PlotJoined->True,PlotRange->All] Maple t:=’t’: x:=’x’: y:=’y’: x:=proc(t)option remember;-5+0.25*x(t-1)+0.4*y(t-1)end: y:=proc(t)option remember; 10-x(t-1)+y(t-1) end: x(0):=10: y(0):=5: data:=[seq([x(t),y(t)],t=0. .20)]; plot(data); The Maple instructions join the points by default. If just a plot of points is required...
View Full Document

This note was uploaded on 12/14/2011 for the course ECO 3023 taught by Professor Dr.gwartney during the Fall '11 term at FSU.

Ask a homework question - tutors are online