System of differenital equations with odesolve
01-26-2024, 08:10 AM
Post: #1
 Sabaism Junior Member Posts: 1 Joined: Jan 2024
System of differenital equations with odesolve
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.

Best wishes,
Jo
01-27-2024, 08:36 PM
Post: #2
 parisse Senior Member Posts: 1,327 Joined: Dec 2013
RE: System of differenital equations with odesolve
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.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)