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

6 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Rahul Kumar
Rahul Kumar el 27 de Abr. de 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.

Más respuestas (0)

Categorías

Más información sobre Run Multiple Simulations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by