[Scilab-users] Output Argument from the SCILAB ode function

Samuel Enibe samuel.enibe at unn.edu.ng
Sat Jun 27 23:20:24 CEST 2015


I would like to use the SCILAB ode function with the option of second
or more output arguments activated. In the example shown below (also
attached), I would like to pass the variable dd in line 3 of the
function linear.

When the ode function is called without the second output argument as
in line 12, it works, but when the second output argument is included
as in line 13, it does not work.

Any help in correcting this will be greatly appreciated.

///////////////////////////////////////////////////////////////////
function [xdot, dd] =linear(t, x, A, u, B, omega)
    xdot=A*x+B*u(t,omega);
    dd = cos(A);
endfunction
function ut=u(t, omega)
    ut=sin(omega*t)
endfunction
A=[1 1;0 2];
B=[1;1];
omega=5;
y0=[1;0];
t0=0;
t=[0.1,0.2,0.5,1];
[y] = ode(y0,t0,t,list(linear,A,u,B,omega))
[y1, dd] = ode(y0,t0,t,list(linear,A,u,B,omega))
///////////////////////////////////////////////////////////
-- 
Samuel Ogbonna Enibe
BEng (Nig), MSc (Reading, England), PhD (Nig)
Professor of Mechanical Engineering
Dean, Faculty of Engineering
University of Nigeria, Nsukka, Nigeria
Tel: +2348063646798
Email: samuel.enibe at unn.edu.ng
     enibesam at yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example-ode.sce
Type: application/x-scilab-sce
Size: 321 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20150627/453a867b/attachment.bin>


More information about the users mailing list