Also, I am calling the time via

Code: Select all

`t= osimState.getTime()`

Thanks

Kristen

- kristen jakubowski
**Posts:**15**Joined:**Tue Jun 19, 2012 10:40 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
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

Also, I am calling the time via

Code: Select all

`t= osimState.getTime()`

Thanks

Kristen

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.

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.

- kristen jakubowski
**Posts:**15**Joined:**Tue Jun 19, 2012 10:40 am

I am having trouble getting the Coordinate to work
I keep getting the error
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.

Code: Select all

```
Vint=Coordinate();
Vint.setMotionType(Translational);
Vint.setdefultValue(-0.009);
Vint.setRangeMin(-inf);
Vint.setRangeMax(inf);
```

Code: Select all

```
No method 'setMotionType' with matching signature found for class
'org.opensim.modeling.Coordinate'.
```