Integrate an amputation into a MoCap Model with MechObjectExclude

#1

Hello,
I am working on a MoCap Model for the lower extremity and try to integrate a unilateral transfemoral amputation into it. The idea is to do it with the object “MechObjectExclude” in the LegExchange.any file. So if the amputation is activated in the LabSpecificData.any file and the inverse dynamic study is started, on the left side a lot of muscles should be excluded together with the segments “Shank” and “Thigh” and also the Joint “Knee”. In the LegExchange.any file, after the exclude methods, are also new muscles, segments and joints defined which represent the amputated case.
The problem now is, that if I am loading the model, I get the warning that the Leg Calibration Studies contain too few kinematic constraints. So if I am running the InverseDynamics it starts but of course fails because the model is kinematically indeterminate. But I mentioned in the model view, that the segments, joints and muscles that should be excluded when the inverse dynamic study is started are still present and not excluded. So know I am not sure, whether there is a mistake in the LegExchange.any file I created with the exclusion of these objects and if this could get fixed anyhow or if it generally does not work that way I am trying to integrate an amputation to the model.
Many thanks in advance,
John

#2

Hi John,

I have looked at bit at your files and i think i have found the reason for the problem.

You exclude segments, joint and muscles from the inverse dynamic study, so only this study is affected by this.

Then you open up the folder " Main.HumanModel.BodyModel.Left.Leg" and start adding muscles, segs etc.

So the added items are going into the normal body model and all studies using this body model will have these new items which has been defined.

This leeds to problems in the calibration study.

The solution depends on what you want to do:

1: if you would like to run the calibration on a non-amputee model then, you have to add the these new body parts to a folder which is not part of the human model and thus included by all other studies.

2: If you like to run all studies on an amputee model you need to do the exclusion in all studies. Instead of doing this for each study one by one you can use the object AnyMechObjectExcluder for this it .

Hope it helps.

Best regards
Søren

but you insert the new body parts into t

#3

Hey Søren,

thank you for your ideas!
I tried to do it with the second way and put the exclusion in all studies. I don’t know if i really got it right with what you mean, that I don’t have to do it for each study one by one. The only way I managed to do it, is by doing it with the MechObjectExclude object for each LegCalibrationStudy. You can see it in the modified LabSpecificData.any file I attach to this post.
But when I load the model now, it still gives me the same warnings, that the LegCalibrationStudies contain too few kinematic constraints. Despite the warnings, I started the InverseDynamics within the folder “RunAnalysis” and this runs further now than before, but also fails. The error now is: “Unknown error: No Class Information”.

My whole model is too large to attach it to my post, but I made a Dropbox-folder and with the following link you have access to it, if you maybe would like to run the model by yourself.
https://www.dropbox.com/sh/n51vjcytii9266l/AADpGAQwTw6cI7qxqTXioe-Na?dl=0

Thanks again and best regards
John

#4

Hi John,

I will try to explain in some more detail.

Concerning the calibration there are two ways as i listed.

1: you do the calibration as if it was the non-amputee model
2: you do the calibration on the amputee model

This is not a modeling question but more fundamental, i think that option 1 is more correct since this will calibrate the model as it was intact. Option 2 will adapt muscle to the changes done by the amputation… Which situation is correct i am not sure it depends on the surgical procedure.

To check which object you have in the studies you can in the ModelTree click on the study in question e.g. the calibration study then you can in the object description get a complete list of segments, joint and drivers… please review this list carefully to see if you have excluded things correctly and if you have added things correctly.

I looked again on the legExchange.any file it seems you are removing both thigh and shank but not the foot and talus? this i did not understand.

Best regards
Søren

#5

Hi Søren,

after your last response I managed to do some changes to my model and now everything should be excluded and added correctly.
I do not remove the foot and talus because it was not necessary to make changes to them as it was necessary with the shank and thigh. So I could keep foot and talus an did not need to add new ones.
Right now the calibration study and also the kinematics are running, which is good progress.
But a new error appears when starting the inverse dynamics. The error says, that the muscle recruitment solver is aborted due to a singular KKT-matrix and I really cannot figure out where exactly the problem is and how I could fix this.
As last time I would also put my current model in the dropbox folder you can access through this link:
https://www.dropbox.com/sh/n51vjcytii9266l/AADpGAQwTw6cI7qxqTXioe-Na?dl=0
Maybe you again have an idea what could lead to this error.

Many thanks and best regards
John

#6

Hi John,

I came across this post, what is the status has it been resolved?
If not i will take a look at the files

Best regards
Søren

#7

Hey Søren,

thank you for responding to this older post.
The problem is not resolved by now, so it would be great if you could take a look at the model.

Best regards
John

#8

Hi John,

I have taken a look at your model, and i am bit confused sorry.

I was unsure which model to run ? i tried the lowerextremity model but it did not run inverse analysis due to a kin error not with a kkt like you write.
The LowerThigh segment looks strange at load time it is about 90 deg sideways.

I also tried the fullbody model and i also did not kinematically.

So i am in doubt if i have the same model as you?

In general i can say that the KKT error means that the solver did not find a way to activate the muscle that can create equilibrium.
One reason could the wrong calibration of muscles, please try to use simple muscles and see if the error change.

Secondly you could try to make a model with a simpler loading scenario than the gait model, but using the same legexchange model. This would allow you to better understand which DOF in the model is not possible to balance.

Hope it helps,

Best regards
Søren

#9

Hi Søren,

the LowerExtremity model is the correct one. I can tell you how I managed to make the kinematics work and then got the KKT error with the inverse dynamic analysis.
First I run the InitialConditions in Operations - Studies - InverseDynamicStudy. After that the LowerThigh is not 90 deg sideways anymore as it is at load time.
After that I run the MuscleCalibration in Operations - RunAnalysis - InverseDynamics.
When this is finished I can start the Kinematics in Operations - Studies - InverseDynamicStudy. There will be a lot of warnings but the kinematics will run till the end without an error.
If I then start the InverseDynamics in Operations - Studies- InverseDynamicStudy the error with the singular KKT matrix appears.

Right now, I am not working on this model myself anymore, because it was part of an internship I did. But I will pass on your ideas to the advisor of my internship, I guess that this could be helpful for him to finally make the model work.
Thanks a lot for your helpful hints and if you may have any other ideas, what could lead to the error, do let me know.

Best regards
John

#10

Hi John,

I have taken another look at the model and realized that the problem is that the muscle on the left leg are still attached to the original bones, not the new bones you have created.

So when the model is running the muscles are are “left behind” together with the old leg, this is why the model can not be be balanced and the returns a KKT error.

There can be tow ways to fix.

  1. Attach the muscles to the new bones
  2. Restructure the model so that you modify the original bones and avoided introducing the new bones, like you did.

Best regards
Søren

#11

Hi Søren,

I thought that these muscles and old segments would not be involved anymore when starting the analysis because of the integrated exclusion in the inverse dynamic study.
If I now attach all muscles to the new bones, so that it looks like there is no amputation, will the muscles and objects that are part of the list with the objects that should be excluded still not get involved in the inverse dynamic analysis?

Best regards
John

#12

Hi John,

Sorry if i have misinterpreted the model, what i see is essentially all the muscles being excluded and left behind, except only a few muscle around the hip which has remained. So i concluded this was a mistake.

I do not see any muscle spanning the knee and ankle joint so unless you have torque generators in these joint it will fail to balance the model. I have looked to see if i could find these but i have not found them.

Best regards
Søren

#13

Hi Søren,

that is right, these few muscles around the hip that remain on the new leg represent the transfemoral amputation. That is also why there are no muscles spanning the knee and ankle joint anymore and all the other muscles and segments of the left side are excluded.
What you are noticing with the torque generators could maybe be really the problem, because I cannot remember that I generated something like this. So this will be a thing that needs to be checked.
Thank you very much for your new remarks!

Best regards
John

closed #14

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.