Azzera filtri
Azzera filtri

Monte Carlo Uncertainty Analysis for SimMechanics Model

3 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Ryan G
Ryan G il 3 Lug 2012
Modificato: Ryan G il 13 Ago 2012
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.

Categorie

Scopri di più su Model Statistics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by