[Scilab-users] How to use champ

Serge Steer Serge.Steer at inria.fr
Tue Dec 15 09:53:58 CET 2015


Here is an example

//First draw the "champ". System1 does not depend on time so the time value is not used
xr=130:10:290;yr=5:0.3:9;t=0;
clf();fchamp(System1, t, xr, yr)

//now draw the trajectory from given initial point
t=0:0.1:30; //It is not useful to ask for too many points,
              //here t gives the instants of observation of the solution not the integration step
y=ode (y0,t0,t,System1);

plot(y(1,:),y(2,:));


Le 14/12/2015 08:47, shahriqeen a écrit :
> I am a new user to this scilab. How to plot the champ of this system
>
> function f=System1(t, y);
>   f = zeros (2,1);
>
>   f(1) = A*y(1)-(B*y(1)*y(2));
>   f(2) = (-C*y(2))+(D*y(1)*y(2))
>
> endfunction
>
> A=0.4;
> B=0.06;
> C=0.12;
> D=0.0006;
> t0=0;
> y0=[140;6];
> t=0:0.001:150;
>      y=ode (y0,t0,t,System1);
>      
>      plot2d(y(1,:),y(2,:),1);
>      xtitle ('System1');
>      xlabel('x');
>      ylabel ('y');
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/How-to-use-champ-tp4033219.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>




More information about the users mailing list