2018-06-21 11:44:23 +02:00
|
|
|
%% Open Loop simulation and save the final state
|
|
|
|
steady_time = 10;
|
|
|
|
|
|
|
|
initializeSimConf(struct('Tsim', steady_time, 'cl_time', steady_time));
|
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
set_param('sim_nano_station_ctrl',...
|
2018-06-21 11:44:23 +02:00
|
|
|
'SaveFinalState','on',...
|
|
|
|
'FinalStateName','myOperPoint',...
|
|
|
|
'SaveCompleteFinalSimState','on'...
|
|
|
|
);
|
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
sim('sim_nano_station_ctrl');
|
2018-06-21 11:44:23 +02:00
|
|
|
|
|
|
|
save('./data/myOperPoint.mat', 'myOperPoint');
|
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
set_param('sim_nano_station_ctrl',...
|
2018-06-21 11:44:23 +02:00
|
|
|
'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');
|
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
set_param('sim_nano_station_ctrl',...
|
2018-06-21 11:44:23 +02:00
|
|
|
'LoadInitialState','on',...
|
|
|
|
'InitialState','myOperPoint'...
|
|
|
|
);
|
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
sim('sim_nano_station_ctrl');
|
2018-06-21 11:44:23 +02:00
|
|
|
|
2018-10-29 12:57:13 +01:00
|
|
|
set_param('sim_nano_station_ctrl',...
|
2018-06-21 11:44:23 +02:00
|
|
|
'LoadInitialState','off' ...
|
|
|
|
);
|
|
|
|
|
|
|
|
save('./data/exp_close_loop_xyz.mat', 'Dmeas');
|