Page 1 of 1

step_interval info in PointKinematics, BodyKinematics etc

Posted: Thu Apr 27, 2017 1:40 pm
by gmast
Hi

I'm trying to figure out what the step_interval (found in Analyses - PointKinematics, BodyKinematics etc.) is in terms of time. How is it defined?
E.g. When I run a 1 sec simulation with step_interval=1 I'll get 1859 steps/samples. How is this number declared please?

Thanks

George

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Thu Apr 27, 2017 6:53 pm
by tkuchida
Here's the description for the step_interval property (in the GUI, select "XML Browser" from the "Help" menu and display the XML for the PointKinematics class, for example):

Code: Select all

<!--Specifies how often to store results during a simulation. More specifically, the interval (a positive integer) specifies how many successful integration steps should be taken before results are recorded again.-->
For example, setting step_interval to 10 will run the Analysis every tenth integration time step.

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Fri Apr 28, 2017 6:31 am
by gmast
Hi Tom

Thanks for this. Is there a way to fixate the number of steps per second of the simulation please?

E.g. 1000steps/sec for A simulation, or 2000steps/sec for B simulation

George

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Fri Apr 28, 2017 2:07 pm
by tkuchida
Is there a way to fixate the number of steps per second of the simulation please?
I'm assuming you're using the Forward Tool. If you check the "Use time steps from states file" box in the "Integrator Settings" pane, the rows in the output files will align with the "time" column in the "initial states" file. There is a description of this feature in the Confluence documentation (at the bottom of the "How to Use the Forward Dynamics Tool" page: http://simtk-confluence.stanford.edu:80 ... amics+Tool) and in the code (https://github.com/opensim-org/opensim- ... l.cpp#L179). When specifying the desired time points in the "initial states" file, don't forget to update the "nRows" line in the header.

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Mon May 01, 2017 9:56 am
by gmast
Apologies but it doesn't seem to work. There is no visible correlation between the Integrator Settings values and the nRows found in the resulting .sto files. Is there anything missing please?

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Mon May 01, 2017 10:57 am
by tkuchida
If that feature isn't doing the job, I suggest simply interpolating the results in a post-processing script.

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Tue May 02, 2017 5:02 am
by gmast
This is also an option. Thanks for pointing it out.

Re: step_interval info in PointKinematics, BodyKinematics etc

Posted: Tue May 02, 2017 3:28 pm
by tkuchida
I tested in OpenSim 3.3 using the arm26 model and didn't encounter an issue. I've attached a .zip containing the model file, the initial states file I created (the "time" column lists the time points that will appear in the output), and the Forward Tool setup file.