필터 지우기
필터 지우기

Monte Carlo Uncertainty Analysis for SimMechanics Model

조회 수: 3 (최근 30일)
John
John 2012년 7월 3일
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.

답변 (1개)

Ryan G
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.

카테고리

Help CenterFile Exchange에서 Model Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by