Is it possible to run a complied simulink model with "rtwbuild" in parallel?

2 ビュー (過去 30 日間)
Rajmohan
Rajmohan 2020 年 1 月 14 日
回答済み: Bhargavi Maganuru 2020 年 4 月 1 日
I have a complex simulink model that is complied with rtwbuild to reduce run time. I need to run optimizations and parameter sweeps. Is it possible to do so in parallel?
% RTW Build
rtwbuild(mdlName)
% Get RTP Structure for Parameter Alteration
rtpstruct = rsimgetrtp(mdlName,'AddTunableParamInfo','on');
% Save Tunable Parameter Structure
save('Rsim_Params','rtpstruct')
% Execution Command
runname = ['.',filesep,mdlName,...
' -p Rsim_Params.mat -i Rsim_Input.mat -tf ',...
num2str(Tend),' -v '];
% System Command - Run Model
[~,~] = system(runname);

回答 (2 件)

Jonathan Agg
Jonathan Agg 2020 年 2 月 28 日
If you have Parallel Computing Toolbox, the function parsim lets you run simulations in parallel, including in rapid accelerator mode: https://uk.mathworks.com/help/simulink/slref/parallel-simulations-using-parsim-parameter-sweep-in-rapid-accelerator-mode.html.
If you want to stay with MATLAB and Simulink, you can call system multiple times in the background by adding "&" at the end of your command. You'll want to make sure you write to different output files!
"To execute the operating system command in the background, include the trailing character, &, in the command argument."

Bhargavi Maganuru
Bhargavi Maganuru 2020 年 4 月 1 日

カテゴリ

Help Center および File ExchangeParameter Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by