How can I initalize bus objects with parsim in rapid acc mode?

6 vues (au cours des 30 derniers jours)
Sebastian
Sebastian le 26 Avr 2019
Commenté : Sebastian le 28 Avr 2019
Hello,
I want to run a Simulink model with busses with parsim in rapid accelerator mode. However, I get the error message 'The rtp structure passed in did not have a parameter bus_object'. It works if I execute the simulation in rapid accelerator mode with 'sim' only but not with 'parsim'. I attached a simple example file that produces the error. I am using version 2018b. Thanks for your help!
Best,
Sebastian

Réponse acceptée

Rahul Kumar
Rahul Kumar le 27 Avr 2019
Hi Sebastian,
bus_object is not a variable used in the model and thus when the model is compiled for rapid accelerator, it does not appear as a rtp parameter which gives the error. Just remove the setVariable call for bus_object and it should work fine.
for i = 1 : length(final_value_sweep)
simin(i) = Simulink.SimulationInput(model);
simin(i) = simin(i).setModelParameter('SimulationMode', 'rapid-accelerator',...
'RapidAcceleratorUpToDateCheck', 'off');
simin(i) = simin(i).setVariable('final_value',final_value_sweep(i)); % sweep
end
Simulink.BlockDiagram.buildRapidAcceleratorTarget(model);
out = parsim(simin, 'ShowProgress', 'on');
If you need base workspace variables assigned to the workers, you can set 'TransferBaseWorkspaceVariables', 'on' with parsim.

Plus de réponses (0)

Catégories

En savoir plus sur Run Multiple Simulations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by