{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Economics Dynamics Problems 89

Economics Dynamics Problems 89 - NDSolve command...

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

View Full Document Right Arrow Icon
Continuous dynamic systems 73 the independent variable. Given the following initial value problem dy dt = f ( y ( t ) , t ) y (0) = y 0 the input instruction is NDSolve[{y’[t]==f[y[t],t],y[0]==y0}, y[t],{t,tmin,tmax}] Mathematica provides output in the form of an InterpolatingFunction that rep- resents an approximate function obtained using interpolation. This Interpolating- Function can then be plotted. Since it is usual to plot an InterpolatingFunction, then it is useful to give the output a name. For example, given the problem dy dt = sin(3 t y ) y (0) = 0 . 5 , t [0 , 10] the instruction is sol=NDSolve[{y’[t]==Sin[3t-y[t]],y[0]==0.5}, y[t],{t,0,10}] Although the output is named ‘sol’, the solution is still for the variable y ( t ). So the plot would involve the input Plot[y[t] /. sol, {t,0,10}] Note that the range for t in the plot is identical to the range given in the
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NDSolve command. Higher-order ordinary differential equations are treated in the same way. For example, given the initial value problem d 2 y dt 2 + . 5 dy dt + sin( y ) = , y (0) = − 1 , y ± (0) = , t ∈ [0 , 15] the input instruction is sol=NDSolve[{y’’[t]+0.5y’[t]+Sin[y[t]]==0, y[0]==-1,y’[0]==0}, y[t],{t,0,15}] with plot Plot[y[t] /. sol, {t,0,15}] 2.12 Solving differential equations with Maple 2.12.1 First-order equations Maple has a built in command for dealing with differential equations, which is the dsolve command. This command is used to ±nd a symbolic solution to a differential equation. The command dsolve(. . . , numeric) ±nds a numerical approximation. Consider the following ±rst-order differential equation dy dt = f ( y , t )...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern