[Scilab-users] How to get matrix output from ODE ?

Samuel Gougeon sgougeon at free.fr
Mon Apr 22 15:20:38 CEST 2019


Hello,

Le 22/04/2019 à 14:48, Richard a écrit :
> Hello - using scilab 6.0.2 on windows 7 pro;
> I'm pretty much a newbie here, but somewhat familiar with differential 
> equations.
> However, I cannot find a way to get a matrix (NOT a VECTOR!) output 
> from the scilab 'ode' function. No matter what, all it gives is a row 
> vector.
> Example code (nonlinear Rossler equations):
>
>  function [ydot]=rdv(t,y)
>      ydot(1) = -(y(2) + y(3))
>      ydot(2) = y(1) + 0.2*y(2)
>      ydot(3) = 0.2 + y(3)*(y(1) - 5.7)
> endfunction
> t=0:0.05:50;
> t0=0;y0=[-1.0,0.0,0.0];
> y=ode(y0,t0,t,list(rdv,a,b,c));
> param3d(y(1),y(2),y(3))

y0  =  [-1.0,0.0,0.0]';
y  =  ode(y0,t0,t,rdv);
param3d(y(1,:),y(2,:),y(3,:)) works: But the fact that y and t must be 
of "orthogonal shapes" is not clearly indicated or highlighted in the 
ode() help page. This clearly misses. There are some (rather unclear) 
explanation for y being even a matrix ! but for simpler multivariable 
cases, nothing. We should improve the page.

Anyway, writting param3d(y(1),y(2),y(3)) plots only one point. HTH Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190422/93c7de99/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nbelkeehglbkpgha.png
Type: image/png
Size: 8397 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20190422/93c7de99/attachment.png>


More information about the users mailing list