nass-simscape/run_simulations.m

42 lines
967 B
Mathematica
Raw Normal View History

%% Open Loop simulation and save the final state
steady_time = 10;
initializeSimConf(struct('Tsim', steady_time, 'cl_time', steady_time));
set_param('Assemblage',...
'SaveFinalState','on',...
'FinalStateName','myOperPoint',...
'SaveCompleteFinalSimState','on'...
);
2018-10-02 21:33:56 +02:00
sim('Assemblage');
save('./data/myOperPoint.mat', 'myOperPoint');
set_param('Assemblage',...
'SaveFinalState','off',...
'SaveCompleteFinalSimState','off'...
);
save('./data/exp_open_loop.mat', 'Dmeas');
%% Close the Loop and start from steady state
sim_time = 10;
initializeSimConf(struct('Tsim', steady_time+sim_time, 'cl_time', steady_time));
load('./data/myOperPoint.mat', 'myOperPoint');
set_param('Assemblage',...
'LoadInitialState','on',...
'InitialState','myOperPoint'...
);
2018-10-02 21:33:56 +02:00
sim('Assemblage');
set_param('Assemblage',...
'LoadInitialState','off' ...
);
save('./data/exp_close_loop_xyz.mat', 'Dmeas');