Economics Dynamics Problems 204

# Economics Dynamics Problems 204 - g(x(t,y(t,t...

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

188 Economic Dynamics Mathematica DSolve[{x’[t]==f[x[t],y[t],t],y’[t]==g[x[t],y[t],t], x(0)==x0,y(0)==y0},{x[t],y[t]},t] Maple dsolve(({diff(x(t),t)=f(x(t),y(t),t),diff(y(t),t) =g(x(t),y(t),t), x(0)=x0,y(0)=y0},{x(t),y(t)}); It is often easier to deFne the equations, variables and initial conditions Frst. Not only is it easier to see, but much easier in correcting any mistakes. ±or instance in Mathematica deFne eq:={x’[t]==f[x[t],y[t],t],y’[t]==g[x[t],y[t],t], x[0]==x0,y[0]==y0} var:={x[t],y[t]} and then solve using DSolve[eq,var,t] In Maple deFne: eq:=diff(x(t),t)=f(x(t),y(t),t),diff(y(t),t)=
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g(x(t),y(t),t); init:=x(0)=x0,y(0)=y0; var:={x(t),y(t)}; and then solve using dsolve({eq,init},var); Example 4.4 in the text can then be solved in each package as follows Mathematica eq:={x’[t]==x[t]-3y[t], y’[t]==-2x[t]+y[t], x[0]==4,y[0]==5} var:={x[t],y[t]} DSolve[eq,var,t] Maple eq:=diff(x(t),t)=x(t)-3*y(t), diff(y(t),t)=-2*x(t)+y(t); init:=x(0)=4,y(0)=5; var:={x(t),y(t)}; dsolve({eq,init},var); Although the output looks different in the two cases, they are equivalent and identical to that provided in the text....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online