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

6 ビュー (過去 30 日間)
Sebastian
Sebastian 2019 年 4 月 26 日
コメント済み: Sebastian 2019 年 4 月 28 日
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

採用された回答

Rahul Kumar
Rahul Kumar 2019 年 4 月 27 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRun Multiple Simulations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by