Page 2 of 2
Re: Adding a Custom Muscle to a model
Posted: Tue Nov 11, 2014 7:55 am
by jakubk2
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
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
Re: Adding a Custom Muscle to a model
Posted: Tue Nov 11, 2014 10:55 am
by aseth
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.
Re: Adding a Custom Muscle to a model
Posted: Wed Nov 12, 2014 7:06 pm
by jakubk2
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.