Solve System of differential equations
01-03-2019, 09:09 AM
Post: #1
 PepePepe Junior Member Posts: 2 Joined: Jan 2019
Solve System of differential equations
How can I solve a system of differential equations in the HP Prime? Something like this:

x1'=x1+2*x2
x2'=3*x1+2*x2

I've tried to use desolve, but it seems it only works for one differential equation.

Thanks!
01-03-2019, 12:44 PM
Post: #2
 parisse Senior Member Posts: 1,269 Joined: Dec 2013
RE: Solve System of differential equations
desolve(y'=[[1,2],[3,2]]*y,t,y)
01-03-2019, 07:39 PM
Post: #3
 PepePepe Junior Member Posts: 2 Joined: Jan 2019
RE: Solve System of differential equations
But it seems that HP Prime it's doing something wrong if I do that. For example:

desolve(y'=[[1,0],[0,2]]*y,t,y)

gives the same solution as

desolve(y'=[[1,0],[0,2]]*y + [,] ,t,y)

I think it is because the calculator is interpreting [[1,0],[0,2]]*y as [[y,0],[0,2y]] (it doesn't take into account that y is a vector)

How could I solve this? Am I doing something wrong?

Thanks!
01-05-2019, 08:47 PM
Post: #4
 parisse Senior Member Posts: 1,269 Joined: Dec 2013
RE: Solve System of differential equations
Correct syntax for second member is
s:=desolve(y'=[[1,0],[0,2]]*y + [3,4] ,t,y)
The reason is that y is a line vector, not a column vector. Indeed desolve returns a list of generic solutions, even for linear ODE, because you might get several generic solutions for non linear ODE. That mean that the solution y is s, i.e. a line vector.
 « Next Oldest | Next Newest »

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