Solver aborted due to singular KKT matrix

Hi AnyBody,

You can see my model attached (New Model\Application\MocapExamples\Plug-in-gait_Simple\ LowerExtremity.main.any). An external band connecting two nodes passes through a segment (that adapts a marker location) in between. However, I get the “solver aborted due to singular KKT matrix” error when I run the inverse dynamics. In the InverseDynamicsStudy description, the model has the same number of d.o.f. and constraints (180).

What is the problem with this model?

Regards,

Ali

Hi Ali,

A KKT error in the inverse dynamic analysis means that there is a degree of freedom in the model which can not be balanced either by a muscle or by a reaction force.

I can be difficult sometime figure out which DOF is causing the problem please see this guide for solving such problems.

Out wiki pages has a generic guide for such problems please see

Hope it helps
Best regards
Søren

Hi Søren,

Thank you for your reply.

I am trying to model an external band that assists hip flexion and is tracked with 5 markers (1-5). Markers 1 and 5 are fixed to the origin and insertion of the band, so I define them as nodes. However, markers 2-4 are located in the middle of the band.

There are two problems:

  • Although markers 2-4 are not physically attached to the body, when I define them in Markerprotocol.any, they require a MarkerPlacement as an obligatory member of CreateMarkerDriver. So, I attached them to the closest limb. Is it possible to define a free-floating marker that is not attached to the body?

  • Consider marker 3, which is attached to the band's middle. The next problem is that to add this marker as a point in space, I add a massless dummy segment. The segment's 3 rotation d.o.fs are fixed with AnyKinEq, and its 3 location d.o.fs are addressed by adapting the marker's location (AnyKinDriverMarker). But when I run the model, the KKT error happens. Is there any problem with this setting?

Best regards,

Ali

Hi Ali,

Here are some answers,

A marker will always need to be attached to the segment of some kind either a body segment or a artificial segment.

Very likely the KKT error you see relates to the extra segment. Even though the new segment has zero mass it will need to have 6 reactions (3 x forces + 3 x moment) one way or the other.

The AnyKinDriverMarker object does not by default add reactions. So you will need to add some force reactions for the model to work. You could simply enable the reaction in the driver for that maker so a line like below added inside Main would work.

Main.ModelSetup.MocapDrivers.XXXXXX.Driver.Reaction.Type= {On,On,On};

Best regards
Søren

Hi Søren,

You helped me a great deal.

However, after I enabled Reaction.Type for AnyKinDriverMarker; the model still displays a KKT error.

Let me show you a picture, so you can see the problem clearly.
image

As you can see in this picture, a free-floating marker is placed in the middle of the band, and it should not be attached to the thigh. In my case, MarkerPlacement for this marker is Right.Leg.Seg.Thigh; therefore, the onset of Reaction.Type affects the thigh segment and results in KKT error.

Now, how can I add the middle marker to the model without attaching it to the thigh? This marker is necessary for the model as it helps estimate the band length accurately.

Regards,
Ali

Hi Ali,

As i understand the model from earlier is that you have a free floating dummy seg, which now should have 3 moment reactions using an AnyKinEq and three force reactions through the modified marker driver. This should in principle be enough for the model to avoid problems.
I think the issue is that the reaction on the marker driver I suggested applies only to the markertracking model not to the inv. dyn. model. These drivers are not part of the inverse dyn model it runs on the extracted angles. So you will need to add a linear measure from the dummy seg to the world and a reaction force to it.

Alternatively to be using the band markers directly as marker drivers you could use them to calculate the lengths of the band directly. In ModelTress you can find all the markers in the location "Main.ModelSetup.C3DFileData.Points.Markers.XXX"

Each of these markers has an interpolation function (Main.ModelSetup.C3DFileData.Points.Markers.XXX.PosInterpol) which contains their pos. So using these interpolation functions you could easily estimate the length of the band directly.
Eg.

Main ={
 Main.Studies.InverseDynamicStudy ={  
    AnyVar L1 = vnorm (Main.ModelSetup.C3DFileData.Points.Markers.XXBAND1XX.PosInterpol(t)-Main.ModelSetup.C3DFileData.Points.Markers.XXBAND2XX.PosInterpol(t));
    AnyVar L2 = vnorm (Main.ModelSetup.C3DFileData.Points.Markers.XXBAND2XX.PosInterpol(t)-Main.ModelSetup.C3DFileData.Points.Markers.XXBAND3XX.PosInterpol(t));
...
  };
};

Hope it helps

Best regards
Søren

Hi again Søren,

I did as you said and added Main.ModelSetup.MocapDrivers.XXXXXX.Driver.Reaction.Type= {On,On,On};

for the middle marker to the main folder. However, the inverse dynamics returns:

Is there any solution?

Regards,

Ali

Hi Ali,

I have looked at the model and found the issue please try something like this

   AnyKinDriverMarker Motion = 
  {
    Linear.Ref = 0;
    Reaction.Type ={On,On,On};
    AnyRefFrame &marker = .dummyseg.P1;
    AnyParamFun &Trajectory = Main.ModelSetup.C3DFileData.Points.Markers.FR2.PosInterpol;
  };



// fixing the Dummy rotation degrees of freedom
AnyKinEq FixRotation ={
  AnyKinRotational rot={
    AnyRefFrame &ref11=Main.EnvironmentModel.GlobalRef;
    AnyRefFrame &ref2 = ..dummyseg;
    Type = RotAxesAngles;
  };
  Reaction.Type ={On,On,On};
};

The reactions on the rotations was switched off this was causing the problem.

Best regards
Søren

1 Like

I appreciate your help, Søren. The model is running now.

super thanks for the feedback

1 Like

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