Page 1 of 1

what's the meaning of stage version

Posted: Wed Apr 20, 2016 11:49 am
by jp123909
hi all,

I got the error " State Cache entry was out of date at Stage Dynamics. This entry depends on ver
ion 1 of Stage Dynamics but was last updated at version 0."

Does anyone know what "version 1 and 0" means?

Thanks in advance
Jiang

Re: what's the meaning of stage version

Posted: Wed Apr 20, 2016 5:17 pm
by sherm
Hi, Jiang. That means that a value is being referenced in a State that has not been realized to the stage that would have computed that value. The "version" numbers are not significant except that they don't match, which means the value is invalid. Basically whenever a state variable is changed the version number is incremented so that you won't accidentally reference an out-of-date value.

If you don't know what I mean by "realized" in the above context, please read the Simbody User Guide (in the doc directory).

Regards,
Sherm

Re: what's the meaning of stage version

Posted: Wed Apr 20, 2016 8:07 pm
by jp123909
Hi sherm

actually, I already called getMultibodySystem().realize(state, SimTK::Stage::Dynamics);, but this error still happened.
Do you have any idea about the possible reasons?

thanks again,
jiang

Re: what's the meaning of stage version

Posted: Wed Apr 20, 2016 9:40 pm
by sherm
I would have to see more of your code, but most commonly, this occurs because the state that is being realized is not the one you are referencing. One confusing thing is that the integrators and time stepper keep their own state internally -- the one you pass in for initialization is copied into the integrator; after that anything you do to the original state does not affect the one being integrated.

Re: what's the meaning of stage version

Posted: Sat Apr 23, 2016 12:06 pm
by jp123909
hi sherm,

Thanks for your reply. Actually, I was creating two OpenSim analyzers, one of which measures the velocity and acceleration; and the other one measures contact force. The error disappeared if I combined them to one analyzer. I don't know the reason why this happens. Anyhow, I solved problem. If I have time, I will investigate the reason for this error.

Thank you very much for your help

Jiang