Monte Carlo Uncertainty Analysis for SimMechanics Model
3 ビュー (過去 30 日間)
古いコメントを表示
I have a multibody SimMechanics model (4.0 1st Gen) that descibes the motion of the head/cervical spine from a blunt impact to the back. I would like to perform an uncertainty analysis by using a vector (1000+ elements) of values for some of the model parameters (e.g., head mass). The model should run with one set of input parameters, generate the output, then receive a new set of input parameters, and so on. Any suggestions would be helpful. If more info is needed please ask.
0 件のコメント
回答 (1 件)
Ryan G
2012 年 7 月 3 日
編集済み: Ryan G
2012 年 8 月 13 日
This should be relatively straightforward. I'll try to break this down in steps so you can apply this to your application.
1) Define the blocks/signals that will be varied and how. For simmechanics you may want to vary the mass of a body, you will either need a parameter in the Mass to vary or know the block name so you can vary it using set_param. Same applies for gains, constants and other simmechanics blocks.
2) Create a set of varied parameters to utilize. It would probably also be useful to store them so you can better analyze your results. you can use a command like
variationMethod = 'norm'
defaultMass = 1;
variation = 0.1;
Variations.MassBody1 = random(variationMethod,defaultMass,variation,[1,1000]);
This will create 1000 normally distributed variations from the mean, but only you will know what the method and variation should be.
3) In a for loop (preferably PARFOR) change the parameter in the block and simulate for each step. For example:
for i = 1:1000
set_param('system/Body1_name','Mass',num2str(Variations.MassBody1(i)));
simOut = sim('system');
dataMC(i) = simOut;
end
However, it would be up to you how to store the data and run the analysis and there is no definitive right way.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Model Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!