Post new question
Question
Reply
 
Highlighted
Intern
Posts: 28
Member Since: ‎02-08-2017
Message 1 of 5 (300 Views)
Accepted Solution

Solving a differential equation numerically

Can the HP Prime calculator solve differential equations numerically?

Reply
0
Accepted Solution

Re: Solving a differential equation numerically

Thank you. A very clear, complete and thoughtful answer. I appreciate that you took the time.
View solution in context
Master's Graduate
Posts: 310
Member Since: ‎02-04-2014
Message 2 of 5 (280 Views)

Re: Solving a differential equation numerically

Perhaps the ODESOLVE function will do what you need.  Here's its help screen:

 

Syntax:


odesolve(Expr, VectVar, VectInit, FinalVal, [tstep=Val, curve])

 

Ordinary Differential Equation solver

 

Solves an ordinary differential equation given by Expr, with variables declared in VectVar and initial conditions for those variables declared in VectInit. For example, odesolve(f(t,y),[t,y],[t0,y0],t1) returns the approximate solution of y'=f(t,y) for the variables t and y with initial conditions t=t0 and y=y0.

 

Example:

 

odesolve(sin(t*y),[t,y],[0,1],2) --> [1.82241255674]

 

Disclaimer: I don't work for HP, but HP calculators work for me.

-Joe-
Intern
Posts: 28
Member Since: ‎02-08-2017
Message 3 of 5 (240 Views)

Re: Solving a differential equation numerically

I appears that this command, ODESOLVE, might solve differential equations numerically, but there's only that one brief paragraph description in the manual and it leaves me with questions. For instance, what's the difference between ODESOLVE and DESOLVE?

 

Since the HP 50g can solve D.E.'s numerically, I would assume the HP Prime can, too.  I guess I have to experment.  Thank you for pointing out ODESOLVE. 

Teacher
Posts: 87
Member Since: ‎09-23-2016
Message 4 of 5 (189 Views)

Re: Solving a differential equation numerically


Bvond wrote:

I appears that this command, ODESOLVE, might solve differential equations numerically, but there's only that one brief paragraph description in the manual and it leaves me with questions. For instance, what's the difference between ODESOLVE and DESOLVE?

 

Since the HP 50g can solve D.E.'s numerically, I would assume the HP Prime can, too.  I guess I have to experment.  Thank you for pointing out ODESOLVE. 


The Prime command odesolve does the same thing as the 50g’s numeric differential equation solver.

 

Let us follow the example given by the Prime manual:

 

odesolve(sin(t*y),[t,y],[0,1],2).

 

This means: solve the differential equation:

 

dy/dt=sin(t*y).

 

So t is the independent variable and y the solution variable, like the 50g calls them.

We have to enter these 2 variables in the form of a vector in the second argument of odesolve, which is [t,y]

 

When we want to solve differential equations numerically we always have to give the beginning conditions, these are the two 50g’s Init values, one for the independent variable and one for the solution variable.

 

In the Prime we have to enter them once more in the form of a vector, say [0,1], which means that at the beginning t=0 and y=1, so y(0)=1

 

Next we have to specify the value of t for which we want to know what the value of y will be.

This is the 50g’s Final independent value.

 

In our case this is the last argument 2.

 

So the solution of a differential equation is a function of t (when t is the independent variable) and odesolve allows us to get the value of this function for a particular value of t.

 

In many cases it is possible, not only to get the value of y for one particular value of t but to get the solution in the form of an exact function of t.

We can use desolve for that. But this will not be possible for all differential Equations of the form dy/dt=f(t,y).

 

An alternative for odesolve is to plot the graph of the solution in the geometry app.

In its Synbolic view choose from the menu :

Cmds - Plot – Ode – plotode.

 

For instance: plotode(sin(x*y),[x,y],[0,1])

Intern
Posts: 28
Member Since: ‎02-08-2017
Message 5 of 5 (176 Views)

Re: Solving a differential equation numerically

Thank you. A very clear, complete and thoughtful answer. I appreciate that you took the time.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation