Accessing to equilibrium equations

The Question and Answer and Support Forum for the 2017 Fall Virtual Workshop.
POST REPLY
User avatar
Mohammadhossein Akhavanfar
Posts: 19
Joined: Mon Oct 16, 2017 9:11 am

Accessing to equilibrium equations

Post by Mohammadhossein Akhavanfar » Mon Oct 23, 2017 10:43 am

Hi All,

I want to develop a new frame work in MATLAB for OpenSim. I know that we can link OpenSim and Matlab (Mansouri & Reinbolt (2012), Lee & Umberger (2015)). I also know that we can get Inverse Dynamic and Kinematic data from OpenSim in each time step. However, my question specifically is that: "How do I access the equilibrium equations at each time step?"

Thank you in advance,

Mohammadhossein Akhavanfar

User avatar
Adrian Lai
Posts: 46
Joined: Tue Mar 13, 2012 11:33 am

Re: Accessing to equilibrium equations

Post by Adrian Lai » Mon Oct 23, 2017 10:53 am

Hi Mohammadhossein,

I'm not sure if this helps but if you download OpenSim's source code, you can view and replicate the equilibrium equations that OpenSim uses by accessing the muscle model of interest and then looking for the compute functions. For example, the equilibrium equations for the Millard muscle model are detailed in the supporting paper, Millard, M., T. Uchida, A. Seth, and S. L. Delp. Flexing computational muscle: modeling and simulation of musculotendon dynamics. J. Biomech. Eng. 135:1–11, 2013

To my knowledge, I don't think there's a way to access the equilibrium equations at each time step other than providing inputs and obtaining the resulting outputs for specific compute functions.

Adrian

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Accessing to equilibrium equations

Post by Christopher Dembia » Mon Oct 23, 2017 11:36 am

Adrian provided some very useful information if you're interested in the fiber equilibrium equation. Is that what you mean by "equilibrium equations"?

User avatar
Mohammadhossein Akhavanfar
Posts: 19
Joined: Mon Oct 16, 2017 9:11 am

Re: Accessing to equilibrium equations

Post by Mohammadhossein Akhavanfar » Mon Oct 23, 2017 12:34 pm

I meant dynamic equilibrium equations (i.e Newtonian equations). As you know in all biomechanical models, dynamic equilibrium should be maintained between external moments (due to inertia, gravity, and external loads) and internal moments (due to muscle forces and passive tissues forces). These equilibrium equations cannot be solved deterministically because the number of unknown muscle forces is greater than the equilibrium equations, thereby we use optimization methods to solve them. In other words, at each time step, we optimize muscle forces in the subject to satisfying equilibrium equations. I would like access to these dynamic equilibrium equations so I can manipulate them to add additional constraints.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Accessing to equilibrium equations

Post by Christopher Dembia » Mon Oct 23, 2017 3:32 pm

Thanks for explaining. For a given state (joint angles, etc.), you can ask OpenSim to calculate the generalized accelerations (using Newton's laws). However, you rarely need to directly ask OpenSim to do this for you; the tools handle this internally. Instead, you describe (and manipulate) your system by adding the appropriate components to your model.

What is the constraint that you want to model?

User avatar
Mohammadhossein Akhavanfar
Posts: 19
Joined: Mon Oct 16, 2017 9:11 am

Re: Accessing to equilibrium equations

Post by Mohammadhossein Akhavanfar » Tue Oct 24, 2017 7:29 am

Thanks Christopher for your response. We exactly need to access to the internal part that you mention. For example, I want to add some inequality constraints for summation of muscle forces or I want to define one muscle force is two times greater than the other one. For adding these constraints and more, I need to access the part that OpenSim compose equilibrium equations. I am not looking for adding and modifying components (i.e. musculature, etc.). I want to modify the estimation procedure by changing the mathematics of equations.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Accessing to equilibrium equations

Post by Christopher Dembia » Tue Oct 24, 2017 11:44 am

Here's the source code for Static Optimization, where it computes the generalized accelerations from the generalized coordinates and muscle activations: https://github.com/opensim-org/opensim- ... t.cpp#L664. Look in the functions computeAcceleration() and computeConstraintVector().

Also, look at this post: viewtopicPhpbb.php?f=1398&t=8323&p=0&start=0&view=

POST REPLY