Dear All:
What is the meaning of Model::getworkingstate() ? How to use it ?
Regards
getworkingstate() and get a state at a specific time ?
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: getworkingstate() and get a state at a specific time ?
Please see the API documentation here: https://simtk.org/api_docs/opensim/api_ ... ebb8f8f7cc. In most cases, you can probably just hold onto the State returned by initSystem():What is the meaning of Model::getworkingstate() ?
Code: Select all
//C++
State& s = myModel.initSystem();
%MATLAB
s = myModel.initSystem();
Re: getworkingstate() and get a state at a specific time ?
tkuchida wrote: ↑Sat Feb 10, 2018 1:10 pmPlease see the API documentation here: https://simtk.org/api_docs/opensim/api_ ... ebb8f8f7cc. In most cases, you can probably just hold onto the State returned by initSystem():What is the meaning of Model::getworkingstate() ?Code: Select all
//C++ State& s = myModel.initSystem(); %MATLAB s = myModel.initSystem();
Hi Dr. Uchida:
Sorry for the late reply! Hence, we can get the state at a specific time step using "initSystem" API ?
Best regards
Jack
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: getworkingstate() and get a state at a specific time ?
initSystem() constructs the underlying computational system from scratch; it's very inefficient to call initSystem() repeatedly. An appropriate strategy for reading the State at a particular instant of time depends on the application. Perhaps the easiest strategy would be to run the entire simulation first and then read in the results.we can get the state at a specific time step using "initSystem" API ?