[Scilab-users] Simulation Problem in Scilab to be converted to MATLAB

Debola Abduljeleel boljeleel at yahoo.com
Tue Aug 27 10:53:35 CEST 2013


Hi Everyone,

I seek an assistance to convert the following program to MATLAB. It was originally written in FORTRAN and now in Scilab.

Thanks as I anticipate your kind response/asssistance.


// //Right hand side of ODE // function y=D(t, u) V=u(1) H=u(2) VDOT=0.0107*H-0.00205*V^2 HDOT=0.311-0.0624*V y=[VDOT;HDOT] endfunction t0=0; t=[0:20:1200]; // //First initial condition // V1=3.40; H1=2.05; y0=[V1;H1]; mprintf('INITIAL CONDITIONS: V= %f, H=%f',V1,H1) u=ode(y0,t0,t,D); mprintf('TIME      V             H') disp([t',u']) scf(1001); plot2d(t,u(1,:)); xtitle("Gravity-Flow Tank Simulation V1,H1", "Process time, s", "h, ft") scf(1001); plot2d(t,u(2,:)); // //Second initial condition // V2=2.50; H2=1.2; y0=[V2;H2]; mprintf('INITIAL CONDITIONS: V= %f, H=%f',V2,H2) u=ode(y0,t0,t,D); mprintf('TIME      V             H') disp([t',u']) scf(1002); plot2d(t,u(1,:)); xtitle("Gravity-Flow Tank Simulation V2,H2", "Process time, s", "h, ft") scf(1002); plot2d(t,u(2,:)); //end


 
ABDULJELEEL A. OSUNKUNLE
SCIENTIFIC
 OFFICER
PROJECTS DEVELOPMENT INSTITUTE, P.M.B. 01609, EMENE INDUSTRIAL LAYOUT, ENUGU, NIGERIA.
+2347058408440.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130827/bf7c5cf7/attachment.htm>


More information about the users mailing list