Monte Carlo Uncertainty Analysis for SimMechanics Model
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Ryan G
el 3 de Jul. de 2012
Editada: Ryan G
el 13 de Ag. de 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.
0 comentarios
Ver también
Categorías
Más información sobre Model Statistics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!