[Scilab-users] Problem running xcos in batch mode from Scilab
R0M1
romain.desbats at ifsttar.fr
Tue Feb 25 17:52:39 CET 2014
Dear Users,
Trying different compilation methods for this model, I found some
discrepancies in the results that I do not explain so far.
With the same .xcos model and .csv input file as in the first post, I
compile using /xcos_simulate/ and /scicos_simulate/:
The plots shows the difference between the results from the two methods.
Any idea on what is causing this ?
Thanks a lot.
Here is the code:
clear
// parameters
data=csvRead('input.csv',';');
input_current=evstr(data(:,1));
size1=length(input_current);
C=1/12900;
R=765;
T=0.0001; // timestep
time=[0:T:(size1-1)*T]'; // in s
end_time=time($)+T; // end time in s
// loading Xcos functions
loadScicos;
loadXcosLibs();
exec(loadpallibs,-1);
// loading model: creates scs_m
importXcosDiagram('graphic_model.xcos')
// first compilation method
scs_m.props.context=strcat(["C=",string(C),"; R=",string(R),";
T=",string(T)"; end_time=",string(end_time)]);
xcos_simulate(scs_m,4) // '4' is to perform compilation
graph_voltage_1=graph_voltage.values; // output variable
// second compilation method
%scicos_context.C=C;
%scicos_context.R=R;
%scicos_context.T=T;
%scicos_context.end_time=end_time;
Info=scicos_simulate(scs_m,list(),%scicos_context,flag='nw');
graph_voltage_2=graph_voltage.values; // output variable
set("current_figure",10)
plot(time,graph_voltage_1,'-b')
plot(time,graph_voltage_2,'-r')
xtitle('graph title','time (s)','voltage (V)');
hl=legend(['xcos_simulate';'scicos_simulate'],"in_upper_right");
--
View this message in context: http://mailinglists.scilab.org/Scilab-users-Problem-running-xcos-in-batch-mode-from-Scilab-tp4028765p4028965.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
More information about the users
mailing list