[Scilab-users] xcos : xcos_simulate(scs_m, 1) or xcos_simulate(scs_m, 4)

Clément David clement.david at scilab-enterprises.com
Tue Sep 30 15:52:06 CEST 2014


Hello Quentin,

First, The difference is due to the fact that calling xcos_simulate will
always force a do_eval call even with needcompile=1.

Then, when you update the Scilab variable you have to push these
variables in the Xcos context and you can use a similar approach to the
PID optimization example [1].

[1]: http://wiki.scilab.org/Xcos/Examples/PID

--
Clément

Le mardi 23 septembre 2014 à 07:45 -0700, Quentin Mazué a écrit :
> Hello,
> 
> I finished a quite large Xcos-diagram and I have to launch calculation in
> batch mode from a GUI.
> 
> I have 2 different procedures : 
> 
> Procedure 1 : 
> 1) Use importXcosDiagram(...) to get the scs_m : import once for all my
> simulations
> 2) Use xcos_compile(scs_m) to get the %cpr : done once for all my
> simulations
> 3) Use xcos_simulate(scs_m,1) to launch the first simulation.
> 
> 
> Procedure 2 :
> 1) Use importXcosDiagram(...) to get the scs_m : import once for all my
> simulations
> 2) Do nothing
> 3) Use xcos_simulate(scs_m,4) to launch the first simulation.
> 
> All the duration are obtained with tic();...;disp(toc());
> 
> I notice that for procedure 1 and 2, the step 1 is fast (around 2-3sec)
> For procedure 1, step 2 last around 25sec when step 3 last 40sec. => for 1
> simulation : total time = 65sec
> However for procedure 2 step 3 last 50sec. => for 1 simulation : total time
> = 50sec
> 
> According to the help, the difference between my two procedures is that in
> procedure 1 I compile the diagram and then I simulate and in procedure 2 I
> compile and simulate within the same function.
> 
> => Consequently why is there a difference of 15sec between this 2 procedures
> even though they should be the same ?
> 
> =>After step 3), could I change my input variables (which are not in Xcos
> context but in Scilab workspace) and then launch a new simulation as in step
> 3 ? Will my new results be correct ?
> 
> 
> 
> 
> 
> --
> View this message in context: http://mailinglists.scilab.org/xcos-xcos-simulate-scs-m-1-or-xcos-simulate-scs-m-4-tp4031207.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