Unilateral inverse dynamics

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Pouya Amiri
Posts: 11
Joined: Fri Apr 26, 2013 10:25 pm

Unilateral inverse dynamics

Post by Pouya Amiri » Thu Aug 22, 2013 9:44 pm

Hi all,

In our lab, we mainly focus on knee osteoarthritis. Therefore, we have been collecting data only from the affected limb. To find the moments and forces on the knee, we have been using a custom code written in matlab, which uses Newtonian's equations. The good thing is that we start from the force plate and go up until we reach knee (without any need to other segments motions). However, now I want to use our gait database in open sim, and to the degree I know open sim solves the set of equations of motion for all DOFs at the same time, therefore, it needs all the degree of freedom in the model. The problem is that also we can not suppose that both leg are symmetric and use the data for the other limb, because one limb is affected and one is not.

My question is that how can we do the inverse kinematics with a model like 2392, while only having data for one limb?

Thanks in advance.
Pouya

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Unilateral inverse dynamics

Post by jimmy d » Tue Aug 27, 2013 12:23 pm

Pouya-

If you have data for just 1 leg you can use a simple leg model to get inverse Kinematic and Inverse dynamic estimates. You can either edit the existing models to just have a single leg, or find a simple uni-lateral leg model to download from here; http://simtk-confluence.stanford.edu:80 ... tal+Models

The down side for having such a simple model is that you may have large errors in joint moments since you arent taking into account the other bodies and accelerations in the system. With future data collections, it may be of benefit to place markers on both legs, pelvis and trunk.

cheers,
-james

User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

Re: Unilateral inverse dynamics

Post by Ton van den Bogert » Tue Aug 27, 2013 1:56 pm

For inverse kinematics, it should be perfectly fine to have a model with just pelvis and one leg. The simple leg model that James suggests should be good. You would have to attach your markerset to it. Until quite recently, people did inverse kinematics only for one body segment at a time (estimating 6 DOF from 3 or more markers). A model of one limb is already much better than models of separate body segments. For some applications, it may even be better than a full body model where errors in the kinematic model of the upper body can affect the results in the legs.

It may even be possible to do inverse kinematics with a full body model and single limb marker data. Joint angles that can't be estimated from the data may just come out as zero. I have not tried this with Opensim, but I have developed other inverse kinematic solvers and that is usually how I had the model respond to incomplete data.

Inverse dynamics is not a problem either, as long as you do not try to do residual reduction. The residuals (external forces acting on the pelvis) are real and will reflect the actions of the rest of the body that was not in the model, or was in the model but with bad kinematics. Inverse dynamics has been done for decades with a recursive method (see David Winter's book, and I suspect that you already use this in your own software). This method works from the foot up and does not care about upper body or other leg. Regardless of the model used, Opensim should give the same result as the recursive method (as long as you avoid residual reduction). It is good that you already have your own custom software so you can verify this.

You will only need a full body model (with corresponding data) if you want to do certain other things with Opensim, such as induced accelerations or forward dynamic simulations.

Ton van den Bogert

User avatar
Pouya Amiri
Posts: 11
Joined: Fri Apr 26, 2013 10:25 pm

Re: Unilateral inverse dynamics

Post by Pouya Amiri » Wed Sep 04, 2013 7:46 pm

Thanks James and Ton, and sorry for my late response.

James,

Thanks for your help.
I have one question: Why do you say that using the model of one limb results in poor estimation of joint moments? As long as we have GRF, we can have an estimate of dynamics of the leg we don't have the marker data for. For example, suppose that we have marker data only for right leg. Using Newtonian's equations for the right leg and pelvis, we can calculate the force and moment in the hip joint of the left leg. Then we can move forward and use equations in the form of (M*qddot+h=B*Taw) to find the moments in the joints of the right leg (assuming the left hip joint forces are external forces). Or we can use residual forces as Ton said (Thanks Ton!). It doesn't seem to influence the moments dramatically. To check what Ton said, I used a tutorial data included in OpenSim distribution, in which we have the data for the full body. I found the moments first using both leg data and then only one leg data, and the results was the same (as Ton said).

The other thing is that I am a beginner OpenSim user. Would you please give me some information on modifying the existing models?

Ton,

Very good response. Really appreciate your complete answer. I have two questions if you don't mind.

First, how are the residuals calculated? One possible way to me is to use Newtonian's equations to find the residual forces and moments, i.e. Fexternal+Fresidual=m*a (solving the equations for the whole system). Then using (M*qddot+h=B*Taw) while considering the forces and moments at pelvis as external forces. Am I correct? I need to know the details of this. You also said, even if we don't have the kinematics of one leg, this works (not only for noisy data). How can it be? Is it possible to put this residual force and torque on other segments? Why does OpenSim apply it to the pelvis?

Second, as I said, we have a big gait database of people with knee OA (over years). My main goal is to do forward dynamics using this database. How can I used unilateral data in forward dynamic simulation?

Thanks again.

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Unilateral inverse dynamics

Post by jimmy d » Thu Sep 05, 2013 12:56 pm

Pouya,
You can get the joint moments just fine with one leg, as I said previously. The issue is that for forward dynamics you need a dynamically consistent model. The RRA in OpenSim uses adjustments in kinematics to bring the pelvic residuals to zero.

For details on i would suggest these resources;

http://simtk-confluence.stanford.edu:80 ... +RRA+Works
http://simtk-confluence.stanford.edu:80 ... mics+Works
http://simtk-confluence.stanford.edu:80 ... el+Editing

cheers,
-james

User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

Re: Unilateral inverse dynamics

Post by Ton van den Bogert » Mon Sep 16, 2013 6:59 am

Apologies for responding late.

James is correct that you can do inverse dynamics on a partial body model (as long as external forces are measured), but then you can't do forward dynamics on the same model. In fact, forward dynamics on a partial body model is always a bad idea. If all you need is inverse dynamics results, that should be no problem.

Inverse dynamic analysis is normally done one body segment at a time, starting at the foot and then working towards the pelvis. If you stop at the pelvis, you can solve for the "external" force and moment on the pelvis that is needed to satisfy the equations of motion for the pelvis. If you have only included one leg in the model, these forces and moments will be substantial and they are real. They reflect the reaction loads due to the unmodeled parts of the body. If you have included the entire body in the model, these forces and moments should be zero (if the model and data are good). In reality, they are not zero but hopefully small. This is what is normally called "residuals".

Hope this helps!

Ton van den Bogert

User avatar
Pouya Amiri
Posts: 11
Joined: Fri Apr 26, 2013 10:25 pm

Re: Unilateral inverse dynamics

Post by Pouya Amiri » Mon Sep 23, 2013 6:11 pm

Hi James and Ton again and thanks for the responses,

What I understood is that I need to be careful when I want to use unilateral data for forward dynamics; however, I do not know what I should do if I want to use unilateral data for forward dynamics. Would you be more clear about the things that I have to do with available models in opensim when using unilateral data for forward dynamics?

Thanks.

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Unilateral inverse dynamics

Post by jimmy d » Tue Sep 24, 2013 10:45 am

Pouya,
You can do a forward dynamics with one leg in OpenSim. The validity of your answers, and your ability to justify this form of analysis given the potential errors, comes down to your research question. Depending on the variables you are trying to study, the bar for justification will change.

Cheers and Gluck,
-james

User avatar
Ton van den Bogert
Posts: 166
Joined: Thu Apr 27, 2006 11:37 am

Re: Unilateral inverse dynamics

Post by Ton van den Bogert » Tue Sep 24, 2013 11:44 am

In principle, you can use unilateral data with a bilateral model if you assume that the movement of your subject was symmetrical.

Simply phase shift the data by half a gait cycle to create artificial data for the other leg. This may need to be done after the inverse kinematic analysis. Then use any of the existing Opensim methods (such as CMC) to create a forward simulation. I'm not familiar with the details of that process, but conceptually it should work.

If you assume symmetry, you can even get away with only simulating half a gait cycle, because the other half would be the same, just left and right switched and phase shifted. See, for instance, Anderson & Pandy (J Biomech 2001). But you still need a full body model.

I would recommend against using a single leg model for forward dynamic simulation of walking or running. This would require careful choice of boundary conditions to represent the rest of the body. It can work if you only need stance or swing (you can find examples in the literature), but a full gait cycle will be quite problematic because you would need to switch boundary conditions.

Ton

POST REPLY