Sensitivity Analysis Help

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Alison Rogozinski
Posts: 14
Joined: Tue Jun 07, 2016 7:44 am

Sensitivity Analysis Help

Post by Alison Rogozinski » Wed Aug 10, 2016 5:21 am

Hello,
I am currently working on creating a sensitivity analysis. My boss wants me to run the parameter changing code that I have created under 2 different for loops. Whenever I run it, my new osim file is not created. Does anyone know how to fix this?
Thanks.
Alison

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Sensitivity Analysis Help

Post by jimmy d » Wed Aug 10, 2016 10:40 am

Alison-

It is hard to tell why when we haven't seen your code (Matlab?). Can you please give us more details...

-James

User avatar
Alison Rogozinski
Posts: 14
Joined: Tue Jun 07, 2016 7:44 am

Re: Sensitivity Analysis Help

Post by Alison Rogozinski » Thu Aug 11, 2016 4:01 am

Yes I can!
So what the code is doing is setting up a blank matrix and then goes into three for loops. One goes from one to 100 (the number of itterations I would like), the second goes from 1 to whatever the number of muscles I have is, and the last one goes from 1 to whatever the number of parameters I have is. Inside of these for loops I would like to change the parameters based on an adjustment multiplier and then put these into the blank matrix I created before. Also I would like to create a new .osim file. I have already created the parameter changing code but when I put that code into the for loops I cant seem to get the new parameter variable or a new .osim file. I am really stuck and have no idea why it is doing this.

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Sensitivity Analysis Help

Post by jimmy d » Thu Aug 11, 2016 9:23 am

But how are you trying to print the model? If you are using the OpenSim API through Matlab scripting it should be something like this;

Code: Select all

model = Model() % empty model
model.print('new_model.osim') % print model to working directory with name 'new_model.osim'

User avatar
Alison Rogozinski
Posts: 14
Joined: Tue Jun 07, 2016 7:44 am

Re: Sensitivity Analysis Help

Post by Alison Rogozinski » Thu Aug 11, 2016 9:47 am

I am using that print model in order to create a new file, its just when it runs through the loop it doesn't change any of the parameters and it doesn't create the new file at all. I have tried running it in a function and doing it just in the for loop

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Sensitivity Analysis Help

Post by jimmy d » Thu Aug 11, 2016 9:56 am

It is almost certainly a bug in your code. You are either printing the original model, or not updating the model you want to print. You should be following a system similar to the code below (which works);

Code: Select all

import org.opensim.modeling.*
% open a model in memory
model = Model('arm26.osim')
% change the mass of a body
body = model.getBodySet().get(2)
body.setMass(20)
% Print the new model out
model.print('new_arm26.osim')

User avatar
Alison Rogozinski
Posts: 14
Joined: Tue Jun 07, 2016 7:44 am

Re: Sensitivity Analysis Help

Post by Alison Rogozinski » Thu Aug 11, 2016 10:07 am

Okay I will certainly try that! Thank you so much!

POST REPLY