Simulation Manager - Error during serialization

Hey Guys,
I am using the Simulation-Manager it works pretty good.
But when it comes to saving the mldatx file I get the error "Error during serialization".
First I thought i have to much data so I reduced the simulations from 450 simulations (2hrs) to round about 121 simulations (40 min).
But I still get the error?
Thank you in advance.
Best regards.

Answers (1)

The error message "Error during serialization" generally occurs when large outputs have to be saved. To avoid it, the outputs can instead be saved after every run. You can refer to the following answer for further details:

5 Comments

Thank you. I was able to fix the Problem whilem saving the files on the Desktop.
But yes u are right. it should be saved in more then one output
Thank you
I have to revert my last answer.
I am seeing the same problem right now.
My code looks like this:
mdl = 'ModelName';
open_system(mdl);
Angle_Tilt = (-10:1:10);
Angle_Slope = (-10:1:10);
numSims_Tilt = length(Angle_Tilt);
numSims_Slope = length(Angle_Slope);
for i = 1:numSims_Slope
for j = 1:numSims_Tilt
in(i,j) = Simulink.SimulationInput(mdl);
in(i,j) = setBlockParameter(in(i), [mdl '/Phsyical_Door_Model/Door/Torque_Tilt_Slope/Angle_Slope_Steigung'], 'Value', num2str(Angle_Slope(i)));
in(i,j) = setBlockParameter(in(i), [mdl '/Phsyical_Door_Model/Door/Torque_Tilt_Slope/Angle_Tilt_Neigung'], 'Value', num2str(Angle_Tilt(j)));
end
end
out = parsim(in, 'ShowSimulationManager', 'on')
This generates 441 simulations with sever outputs I log in the simulation.
In the link u posted it says, we should save the output in several files with:
in = in.setModelParameter('LoggingToFile', 'On', 'LoggingFileName', 'out.mat')
Shall i write this line inside or outside (before) the loop?
And my question how does the pre-processing works then? because at the moment it looks like this (small example)
legend_labels = cell(numSims_Slope,numSims_Tilt);
for i = numSims_Slope:-1:1
for j = numSims_Slope:-1:1
simOut = out(i,j);
Phi_door = simOut.logsout.get('Theta_Door_Sensor_deg').Values;
Tilt_Angle = simOut.logsout.get('Tilt_Angle').Values;
Slope_Angle = simOut.logsout.get('Slope_Angle').Values;
T_m = simOut.logsout.get('T_m_Mot_HOLD').Values;
plot(Phi_door.Data, T_m.Data);
grid on
legend_labels{i,j} = ['Tilt Angle = ' num2str(Tilt_Angle.Data),'°', ', Slope Angle = ' num2str(Slope_Angle.Data), '°'];
hold all
end
end
title('tt')
xlabel('xx');
ylabel('yy');
And my next question is...
How is the Simulationmanager able to handle all these files? It its then not possible to use the gui of the simulation manager any more?
Thank you in advance.
I changed my code to this:
mdl = 'ModelName';
open_system(mdl);
Angle_Tilt = (-10:1:10);
Angle_Slope = (-10:1:10);
numSims_Tilt = length(Angle_Tilt);
numSims_Slope = length(Angle_Slope);
numSim_OverAll = numSims_Slope*numSims_Tilt;
%in(numSims_Slope,numSims_Tilt) = Simulink.SimulationInput(mdl);
in = Simulink.SimulationInput(mdl);
in.setModelParameter('LoggingToFile', 'On', 'LoggingFileName', 'FILE_OUT.mat');
for i = 1:numSims_Slope
for j = 1:numSims_Tilt
in(i,j) = Simulink.SimulationInput(mdl);
in(i,j) = setBlockParameter(in(i), [mdl '/Phsyical_Door_Model/Door/Torque_Tilt_Slope/Angle_Slope_Steigung'], 'Value', num2str(Angle_Slope(i)));
in(i,j) = setBlockParameter(in(i), [mdl '/Phsyical_Door_Model/Door/Torque_Tilt_Slope/Angle_Tilt_Neigung'], 'Value', num2str(Angle_Tilt(j)));
end
end
%Run multiple simulations and open the Simulation Manager.
out = parsim(in, 'ShowSimulationManager', 'on')
But nothing is happing. I don´t see the FILE_OUT.mat anywhere
I turned it on manually in the model... .
Now it is generating for each simulation a FILE_OUT_IDX.mat.
So does that mean if I have 441 simulations it generates 441 Files?
I made a new run it took round about 10hrs but it is still not able to save the simulation manager file.
And the problem is the I can save the workspace, but when i want to save it says something like "save it in version 7.3" or similiar. And when I need to reload it its says to big... the data is round about 30Gb.
How can I fix this two problems?
Thanks in advance.

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 10 Apr 2021

Commented:

on 22 May 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!