Tunable Parameter/Gain and rapid acceleration
5 ビュー (過去 30 日間)
古いコメントを表示
I am having difficulty using Tunable parameters. Here is how it looks inside simulink mdl = 'Mymodel.mdl':
* Constant Block (value 1)---> GainA -> mpt.paramter constant block
I will be running this simulation on a single set of input dataset in a for loop, changing the gain for each itiration (with same input vector).
Sample Code:
for i=1:10000
if i==1
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl);
end
Simulink.BlockDiagram.modifyTunableParameters(rtp,'GainA',Input_Gain(i));
SimOutput = sim(mdl,'SimulationMode','rapid','RapidAcceleratorUpToDateCheck','off');
end
-----------
This code need to build new rapid target for each itiration else it runs same model again and again without changing GainA. Is there any way around?
0 件のコメント
採用された回答
Kaustubha Govind
2012 年 4 月 19 日
But you never pass the modified parameter into SIM right? Simulink.BlockDiagram.modifyTunableParameters creates a new RTP structure. It doesn't apply it to the model.
Try:
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl);
for i=1:10000
new_rtp = Simulink.BlockDiagram.modifyTunableParameters(rtp, ...
'GainA',Input_Gain(i));
SimOutput = sim(mdl,'SimulationMode','rapid', ...
'RapidAcceleratorUpToDateCheck','off', ...
'RapidAcceleratorParameterSets', new_rtp);
end
0 件のコメント
その他の回答 (1 件)
Jayesh Kavathe
2012 年 4 月 19 日
2 件のコメント
Paul
2012 年 4 月 21 日
I looked through the Simulink R2012A documentation on TMW website for the functions Simulink.BlockDiagram.modifyTunableParameters and
Simulink.BlockDiagram.buildRapidAcceleratorTarget and couldn't find them. Can someone point me to the doc page where I can learn about them?
Kaustubha Govind
2012 年 4 月 24 日
Paul: Unfortunately, it doesn't look like there is a doc page, but you can find some information using "help Simulink.BlockDiagram.modifyTunableParameters" and "help Simulink.BlockDiagram.buildRapidAcceleratorTarget". I found information about the usage from this demo: http://www.mathworks.com/products/simulink/demos.html?file=/products/demos/shipping/simulink/sldemo_parfor_paramsweep_suspn_raccel.html
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!