Possibilities and Limitations of OpenSim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
joana baptista
Posts: 21
Joined: Fri Apr 01, 2011 4:52 am

Possibilities and Limitations of OpenSim

Post by joana baptista » Fri Sep 02, 2011 6:31 am

Hi,

Recently I implemented a 'Leg and AFO Orthosis' model with the API application, and between the leg and the orthosis I applied a contact model: the Elastic Foundation Model.

I have also acquired some motion data, normal and pathological gait cycles, to study the contact between the leg and orthosis with this contact model.

My questions are:

1) Does the OpenSim tools take the Elastic Foundation contact model into account, when I try to run InverseKinematics and InverseDynamics with my motion data? I mean, would I be abble to extract information about the contact forces?
I've tried to run InverseKinematics using experimental markers aligned with new markers that I add only in the leg body, thinking that because I had a contact model implemented, the orthosis would follow the leg, but that didn't happen.
I am probably mixing the capabilities of OpenSim, and I think I need to clarify this issues.

2) Is it possible, within the C++ code on the API, to perform a simulation with the motion data acquired, and in that way, perform a direct dynamic analysis?

Joana






User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Possibilities and Limitations of OpenSim

Post by Ayman Habib » Mon Sep 05, 2011 4:47 pm

Hi Joana,

InverseKinematics does not consider any forces on the model, just marker data and the model. It solves for coordinate values. Depending on how your model is setup the solution to IK may have the contacting surfaces interpenetrating or disjoint. There's also no continuity between frames since kinematics are usually sampled at a relatively low frequency an due to marker errors etc.

InverseDynamics takes as input a specific motion (and potentially a set of forces) and computes the mobilizer/joint forces to reproduce the motion so it can take into account the contact forces. This however is not a simulation either since there's no integration of the equations of motion going on, just solving for mobilizer forces frame by frame.

You can do forward simulation where you pass in muscle activations and let the ForwardTool integrate forward in time, taking into account the equation of motion and contact forces.

Hope this helps,
-Ayman

User avatar
joana baptista
Posts: 21
Joined: Fri Apr 01, 2011 4:52 am

Re: Possibilities and Limitations of OpenSim

Post by joana baptista » Tue Sep 06, 2011 4:16 am

Hi Ayman,

First of all, thanks for your reply. It helped to solve some doubts I had about the OpenSim tools. I cannot use them in my work, unfortunately.

So, in order to prescribe a motion to my model and run a forward dynamic simulation through the API, should I use the PrescribedMotion constraint?

Joana

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Possibilities and Limitations of OpenSim

Post by Ayman Habib » Tue Sep 06, 2011 10:51 am

Hi Joana,

If you have a trajectory that you want to prescribe and you know the values of the coordinates as function of time then you can specify these as Prescribed functions either in the model file or in code using the method

Code: Select all

Coordinate::setPrescribedFunction(const OpenSim::Function& function)
You can specify some coordinates this way and let the others be driven by Forces/Actuators as needed.

I'd suggest you try this on a simplified model first to see if it fits your needs and let us know if you have any questions.

Best regards,
-Ayman

User avatar
joana baptista
Posts: 21
Joined: Fri Apr 01, 2011 4:52 am

Re: Possibilities and Limitations of OpenSim

Post by joana baptista » Thu Sep 08, 2011 8:01 am

Dear Ayman,

Will this apply the prescribed function to all the bodies in my model, or is it possible to apply this prescribedfunction to a particular OpenSim::Body?

Joana

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Possibilities and Limitations of OpenSim

Post by Ayman Habib » Fri Sep 09, 2011 10:55 am

Hi Joana,

The Prescribed Function is assumed to be a function of time and will apply to a "coordinate" rather than a "body". If a body is attached to another using a joint that has multiple coordinates you can specify a different function for each coordinate.

Hope this helps,
-Ayman

User avatar
joana baptista
Posts: 21
Joined: Fri Apr 01, 2011 4:52 am

Re: Possibilities and Limitations of OpenSim

Post by joana baptista » Wed Oct 26, 2011 11:53 am

Hi Ayman,

I am using this function you suggested, Prescribed Function, in order to coordinate a CoordinateSet that implements a FreeJoint mobilizer, which means that I have to prescribe the six DOF, right?

My question is: the coordinate values are supposed to be in the body's local reference frame? And the rotations are supposed to be Euler angles?

Joana

POST REPLY