HP Forums
System of differenital equations with odesolve - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: System of differenital equations with odesolve (/thread-21207.html)



System of differenital equations with odesolve - Sabaism - 01-26-2024 08:10 AM

Dear community,

I want to solve a system of differential equations numerically by using the odesolve command.
I think it should be possible, but I am not able to figure out the correct syntax to do so.
By searching the web I have found the following example:
Code:

DE1:=diff(y1(x),x)=y2(x)
DE2:=diff(y2(x),x)=-y1(x)

IC1:=y1(0)=1
IC2:=y2(0)=0

odesolve({DE1,DE2},{y1(x),y2(x)},{IC1,IC2},x)
However, I know the {} cannot be correct, so I replaced them with [], but it does not work either.
Could somebody please give me a hint to solve this.

Thank you in advance.
Best wishes,
Jo


RE: System of differenital equations with odesolve - parisse - 01-27-2024 08:36 PM

Here is an example:
Code:

f(t,v):=[-v[2],v[1]];
odesolve(0..pi,f,[0,1])
The second argument of odesolve must be a function of the time variable and of a vector, returning a vector of the same vector space.