Dear AnyBody community
As part of the implementation of the Force Dependent Kinematics workflow for the knee joint using a novel dataset, I calibrated ligament properties as follows:
// Ligament calibration
AnyDesEvalStudy EvaluateLigamentLength = {
AnyKinStudy InitStudyForLigamentLengthEvaluation =
{
Replay.OPERATION_DISPLAY_PRIORITY(PriorityLow);
InitialConditions.OPERATION_DISPLAY_PRIORITY(PriorityLow);
Kinematics.OPERATION_DISPLAY_PRIORITY(PriorityLow);
AnyComponentDefinition obj = {};
Gravity = {0,0,0};/// Not relevant for AnyKinStudy
AnyFolder& BodyModel = Main.HumanModel.BodyModelWithoutMuscles ;
AnyFolder &EnvironmentModel = Main.EnvironmentModel;
AnyFolder ModelEnvironmentConnection =
{
//#include "Inputs_InitStudy.any"
AnyFolder &MarkerDrivers = Main.ModelSetup.MocapDrivers;
AnyFolder &ExtraDrivers = Main.ModelSetup.MocapExtraDrivers;
};
AnyFolder& Anthropometrics = Main.HumanModel.Anthropometrics;
#include "KinematicStudyForLigCalibration.any"
AnyFolder OutputFunctions_Length = {};
};
With KinematicStudyForLigamentCalibration:
InitialConditions =
{
SmallStepAssumptionOnOff = On;
PosAnalysisOnlyOnOff = On;
KinematicTol=1e-5;
SolverType = KinSolOverDeterminate;
PreOperation =
{
AnyOperation &SetView = Main.ModelSetup.Views.SetViewMacros.KinematicView;
};
};
Kinematics =
{
SmallStepAssumptionOnOff = On;
PosAnalysisOnlyOnOff = On;
KinematicTol=1e-5;
SolverType = KinSolOverDeterminate;
};
// Define statements allow us to overide tEnd/tStart/nStep to
// when calling AnyBody from external programs.
#ifndef N_STEP_PARAM_OPT
#ifndef N_STEP
#define N_STEP_PARAM_OPT iffun(eqfun(Main.ModelSetup.TrialSpecificData.nStep,1),1, floor(max({20, Main.ModelSetup.TrialSpecificData.nStep/6})))
#else
#define N_STEP_PARAM_OPT N_STEP
#endif
#endif
#ifndef T_END
#define T_END Main.ModelSetup.TrialSpecificData.tEnd
#endif
#ifndef T_START
#define T_START Main.ModelSetup.TrialSpecificData.tStart
#endif
tStart = T_START;
tEnd = T_END;
nStep = N_STEP_PARAM_OPT;
Ligament calibration was currently performed in an extended knee position without contact between the femoral and tibial cartilage. This resulted in an overestimation of initial ligament lengths. Consequently, the inverse dynamics analysis exhibited larger-than-expected joint mobility, which was partially mitigated by scaling all initial ligament lengths by 0.8.
To perform ligament calibration in a more realistic position, I included a separate driver for the right and left knee (defined in the “Inputs_InitStudy.any" file) to artificially create a contact between the two cartilage layers. Please find the example of the right knee below:
AnyFolder Drivers_Init =
{
AnyKinEqSimpleDriver Knee_R =
{
AnyKinLinear lin =
{
AnyRefFrame & ref0 = Main.HumanModel.BodyModel.Right.Leg.Seg.Shank.KneeJoint;
AnyRefFrame & ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint;
Ref = 0;
};
AnyKinRotational rot =
{
AnyRefFrame & ref0 = Main.HumanModel.BodyModel.Right.Leg.Seg.Shank.KneeJoint;
AnyRefFrame & ref1 = Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint;
Type = PlanarAngles;
};
DriverPos = {0, -3*10^(-3), 0, 0, 2/180*pi, 0};
DriverVel = {0, 0, 0, 0, 0, 0};
Reaction.Type = {Off, Off, Off, Off, Off, Off};
CType = {Hard,Hard,Hard,Hard,Hard,Hard};
};
};
Although the ligament calibration functions perfectly without adding these two drivers. The following error occurs two times when the drivers are added:
Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Kinematic solver fallback: Restarting solution of kinematic optimality conditions and hard constraints.Failed to solve kinematic optimality conditions and hard constraints after 10 fallback attempts.
Constraint violations for study 'Main.EvaluateLigamentLength.InitStudyForLigamentLengthEvaluation' :
Constraint #23 is above tolerance 1e-05, error = 0.008339, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #26 is above tolerance 1e-05, error = 0.108940, constr. #5 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #29 is above tolerance 1e-05, error = 0.047181, constr. #8 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #32 is above tolerance 1e-05, error = 0.067884, constr. #11 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #35 is above tolerance 1e-05, error = 0.087569, constr. #14 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #38 is above tolerance 1e-05, error = 0.107162, constr. #17 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.SpineRhythmDrv'.
Constraint #62 is above tolerance 1e-05, error = 0.000953, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C1C0Jnt.Constraints'.
Constraint #63 is above tolerance 1e-05, error = 0.003816, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C1C0Jnt.Constraints'.
Constraint #67 is above tolerance 1e-05, error = 0.038476, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.Flexion.RhythmDriver'.
Constraint #97 is above tolerance 1e-05, error = 0.033762, constr. #3 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #98 is above tolerance 1e-05, error = 0.036296, constr. #4 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #99 is above tolerance 1e-05, error = 0.014645, constr. #0 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaMovement'.
Constraint #121 is above tolerance 1e-05, error = 0.036296, constr. #3 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #122 is above tolerance 1e-05, error = 0.033762, constr. #4 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #123 is above tolerance 1e-05, error = 0.014645, constr. #0 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaMovement'.
Constraint #145 is above tolerance 1e-05, error = 0.002999, constr. #1 in 'Main.EvaluateLigamentLength.InitStudyForLigamentLengthEvaluation.ModelEnvironmentConnection.Drivers_Init.Knee_R'.
Constraint #148 is above tolerance 1e-05, error = 0.034905, constr. #4 in 'Main.EvaluateLigamentLength.InitStudyForLigamentLengthEvaluation.ModelEnvironmentConnection.Drivers_Init.Knee_R'.
Constraint #151 is above tolerance 1e-05, error = 0.003000, constr. #1 in 'Main.EvaluateLigamentLength.InitStudyForLigamentLengthEvaluation.ModelEnvironmentConnection.Drivers_Init.Knee_L'.
Constraint #154 is above tolerance 1e-05, error = 0.034905, constr. #4 in 'Main.EvaluateLigamentLength.InitStudyForLigamentLengthEvaluation.ModelEnvironmentConnection.Drivers_Init.Knee_L'.
ERROR(OBJ.MCH.KIN3) : EvaluateLigamentLength_Straight.any(4) : InitStudyForLigamentLengthEvaluation.InitialConditions : Kinematic analysis failed in time step 0 : Position analysis is not completed
0.1.0.0) Kinematic analysis...
To address the “Constraint #XXX is above tolerance” errors, I manually added additional drivers to the model. This successfully resolved those errors. However, the 'Kinematic analysis failed in time step 0' message remained unresolved.
Are there any suggestions on how to effectively incorporate cartilage contact into the ligament calibration process, or are there alternative approaches to achieve accurate ligament calibration?
Thank you in advance and best regards
Aline