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

classic Classic list List threaded Threaded
1 message Options
marko marko
Reply | Threaded
Open this post in threaded view
|

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

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))

... makes 'plot', an empty 3-d box. This makes sense, because scilab says
the 'y' variable is a simple '1x3003' row vector.
No matter how I ask for the LHS output, (examples: [y],
[y1,y2,y3,]...[y(1),y(2),y(3)...],) I get only errors or empty plot.
'Help' claims 'y' should be a vector "or matrix", but the "matrix" never
shows up at all. Scilab 'help' has no examples of simple matrix systems of
all 1st order DE's, and I cannot find any such examples online.

Some older references (including books) suggest indexing like '[y(1,:),
y(2,:), y(3,:)]'. This just gives 'indexing error' in 6.0.2.

This is easily solved with fortran using the ancient Netlib 'RKF45' package.
THEN I can plot the parametric solution by reading the matrix into scilab.
Scilab is one of the few plotting packages that will plot a curve in 3D -
parametric plot.

 But I cannot quite understand how to get any useful solution for this
simple system from scilab. Maybe there is a way to 'partition' the simple
row vector output into what SHOULD BE a 3 x 1001 matrix (or 1001 x 3,
whatever).

What am I doing wrong? Many thanks for any help here.

marko



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users