Adding a Custom Muscle to a model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
kristen jakubowski
Posts: 15
Joined: Tue Jun 19, 2012 10:40 am

Re: Adding a Custom Muscle to a model

Post by kristen jakubowski » Tue Nov 11, 2014 7:55 am

I know if I am running in opensim i can change the initial length and velocity in the coordinates tab, is there a way to do that in matlab??

Also, I am calling the time via

Code: Select all

t= osimState.getTime()
and i noticed that it takes unequal time steps. Is there a way to make it take equal time steps and to increase the number of time steps per second?

Thanks
Kristen

User avatar
Ajay Seth
Posts: 136
Joined: Thu Mar 15, 2007 10:39 am

Re: Adding a Custom Muscle to a model

Post by Ajay Seth » Tue Nov 11, 2014 10:55 am

You can find the methods on ModelComponents in Doxygen e.g. https://simtk.org/api_docs/opensim/api_ ... inate.html. Coordinate has methods to set the default coordinate value and its speed. These should be accessible via scripting in Matlab and you can see the methods using tab completion.

The time stepping is dependent on the integrator you use. If you use a variable step integrator, like ode23 or ode45 you are going to get variable times. You generally care about accuracy instead of step size. For performance you want the largest step size for a given accuracy. You can always crank the accuracy and perhaps Matlab integrators also allow you to set the max step size. There may also be options to regularly sample the integrator output This is more a question for Matlab than OpenSim.

User avatar
kristen jakubowski
Posts: 15
Joined: Tue Jun 19, 2012 10:40 am

Re: Adding a Custom Muscle to a model

Post by kristen jakubowski » Wed Nov 12, 2014 7:06 pm

I am having trouble getting the Coordinate to work

Code: Select all

    Vint=Coordinate();
    Vint.setMotionType(Translational);
    Vint.setdefultValue(-0.009);
    Vint.setRangeMin(-inf);
    Vint.setRangeMax(inf);
I keep getting the error

Code: Select all

No method 'setMotionType' with matching signature found for class
'org.opensim.modeling.Coordinate'.
I'm sure how to fix this, nothing appears when I try tab completion and any completion from the Coordinate class I get the same error.

POST REPLY