How can I initalize bus objects with parsim in rapid acc mode?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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 Exchange 中查找有关 Run Multiple Simulations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!