getworkingstate() and get a state at a specific time ?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jack Zhao
Posts: 94
Joined: Thu Jul 24, 2014 7:15 am

getworkingstate() and get a state at a specific time ?

Post by Jack Zhao » Fri Feb 09, 2018 10:43 pm

Dear All:
What is the meaning of Model::getworkingstate() ? How to use it ?

Regards

User avatar
Thomas Uchida
Posts: 1792
Joined: Wed May 16, 2012 11:40 am

Re: getworkingstate() and get a state at a specific time ?

Post by Thomas Uchida » Sat Feb 10, 2018 1:10 pm

What is the meaning of Model::getworkingstate() ?
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():

Code: Select all

//C++
State& s = myModel.initSystem();

%MATLAB
s = myModel.initSystem();

User avatar
Jack Zhao
Posts: 94
Joined: Thu Jul 24, 2014 7:15 am

Re: getworkingstate() and get a state at a specific time ?

Post by Jack Zhao » Wed Jul 11, 2018 2:52 am

tkuchida wrote:
Sat Feb 10, 2018 1:10 pm
What is the meaning of Model::getworkingstate() ?
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():

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

User avatar
Thomas Uchida
Posts: 1792
Joined: Wed May 16, 2012 11:40 am

Re: getworkingstate() and get a state at a specific time ?

Post by Thomas Uchida » Tue Jul 17, 2018 1:42 am

we can get the state at a specific time step using "initSystem" API ?
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.

POST REPLY