Hi James,
This sounds more tricky:-(
Basically this error means that AnyBody cannot solve the equations of motion
during the inverse dynamic analysis.
There can be several reasons for this.
The first and most obvious, it may be because the muscle configuration does
not support the given load-case. In other words, there are missing some
muscles for withstanding the loads applied.
Another reason can be numerical problems, implying that the system should
have a solution from a mathematical point of view, but the solver cannot
find it because the system of equations is badly conditioned. As you can see
from the error message AnyBody uses a Simplex style solver, which can have
numerical problems with large problems.
Anyway, normally this is not a problem, but the conditional approach is
numerically demanding, so you may have run into such a case. The reason why
it is demanding is because you introduce some large numbers with your
S=F0=1e5.
You do this in order to numerically neglect the (artificial) muscle in
question in the objective function of the muscle-recruitment problem (i.e.,
the inverse dynamics solver). However it also makes the conditioning of
system equations worse.
You can investigate this by lowering F0 to see if a lower value of makes the
system solvable.
/Michael
From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of jamesshippen
Sent: Monday, December 18, 2006 12:45 PM
To: anyscript@yahoogroups.com
Subject: [anyscript] Re: Conditional statements
Hi Michael
Many thanks for your reply. Did you mean an implementation as
follows?
//meaure position of right foot heel
AnyKinLinear RightHeelPosition={
AnyRefFrame &ref1 = Main.Model.EnvironmentModel.GlobalRef;
AnyRefFrame &ref2 =
Main.Model.HumanModel.Right.Leg.Seg.Foot.HeelContactNode;
};
//Right Heel X ordinate
AnyKinMeasureOrg RightHeelX = {
AnyKinMeasure &GRF = .RightHeelPosition;
MeasureOrganizer = {0};
};
//Right Heel Y ordinate
AnyKinMeasureOrg RightHeelY = {
AnyKinMeasure &GRF = .RightHeelPosition;
MeasureOrganizer = {1};
};
//sets the strength of the Right Heel contact muscles if above datum
AnyVar datum=0.0;
AnyVar RightHeelHeight = RightHeelPosition.Pos[1];
AnyIntVar RightHeelContact= gtfun(RightHeelHeight,datum);
//creates the Right Heel contact muscle model
AnyMuscleModelUsr1 RightHeelMus = {
F0 = 1.0e5;
S = F0 * .RightHeelContact;
};
// creates the Right Heel GRF muscles in x direction
AnyGeneralMuscle RightHeelGRFX = {
ForceDirection = 1;
AnyKinMeasure &Org =.RightHeelX;
AnyMuscleModel &GRFMus= .RightHeelMus;
};
On a related, but diffrent matter, when the InverseDynamicsAnalysis
inevitably crashed with the error message:
ERROR(OBJ1) : C:\research\Repository.6
\volley\ARep\Aalborg\FreePostureTrial\FreePostureMove.Main.any
(81) : ‘Study’ : Muscle recruitment analysis failed, simplex
solver reports that solution does not satisfy all constraints.
(even though the KinematicAnalysis was successful) where should I
start to look for the cause of the error (line 81 is the AnyBodyStudy
declaration)?
Ta and Happy Christmas!
James
— In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com,
“AnyBody Support” <support@…>
wrote:
>
> Hi James,
>
>
>
> I believe you guessed right. I am sorry that the help is not very
clear on
> this issue.
>
>
>
> During an operation, expressions are evaluated at different moments
(called
> “evaluation moment”). Expressions evaluated early (like constants
called
> ‘Const’) can of course not dependent on later moments. There is a
short
> description of this in the AnyScript Reference Manual in Section
1.6.2.
>
>
>
> In your case, you attempt to assign the nominal strength of a
muscle, F0,
> which is a constant, with an expression that depends on a varying
variable.
> In particular, your F0 expression involves RightHeelY.Pos, which is
a
> PosVar. PosVar is AnyBody’s internal name for variables being
evaluated
> during the position step of the kinematic analysis.
>
>
>
> What may do the trick for you is to use the slightly more advanced
muscle
> model called AnyMuscleModelUsr1. It has the option for user-defined
strength
> definition. This user-defined strength can depend on PosVar and
VelVar,
> i.e., positions and velocities. It may look something like this:
>
>
>
> AnyMuscleModelUsr1 Test =
>
> {
>
> F0 = “Your constant expression”;
>
> S = F0 * . “Your expression depending on positions and
velocities” .;
>
> };
>
>
>
> Once again, I am sorry for the shortcomings in the help.
>
> I can assure you that we are doing effort to make the evaluation
moments
> more clear and visible in future versions of AnyBody.
>
>
>
> Best regards,
>
>
>
> Michael
>
> _______________________________
>
> AnyBody Technology Support
> Email: support@…
> Phone: +45 9635 4286
> Free support: http://groups. <http://groups.yahoo.com/group/anyscript>
yahoo.com/group/anyscript
>
>
>
>
>
> _____
>
> From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com]
On Behalf
> Of jamesshippen
> Sent: Thursday, December 14, 2006 15:24 PM
> To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
> Subject: [anyscript] Conditional statements
>
>
>
> Hi
>
> I have been trying to create conditional strength muscle to model
> ground reaction forces as follows:
>
> //measure position of right foot heel
> AnyKinLinear RightHeelPosition={
> AnyRefFrame &ref1 = Main.Model.EnvironmentModel.GlobalRef;
> AnyRefFrame &ref2 =
> Main.Model.HumanModel.Right.Leg.Seg.Foot.HeelContactNode;
> };
>
> //Right Heel Y ordinate
> AnyKinMeasureOrg RightHeelY = {
> AnyKinMeasure &GRF = .RightHeelPosition;
> MeasureOrganizer = {1};
> };
>
> //set the strength of the Right Heel contact muscles if above datum
> AnyVar datum=0.0;
> AnyIntVar RightHeelContact= gtfun(RightHeelY.Pos,datum);
> AnyVar RightHeelStrength= iffun(RightHeelContact,0.0,1.0e5);
>
> //create the Right Heel contact muscle model
> AnyMuscleModel RightHeelMus = {F0 = .RightHeelStrength;};
>
> However this generates error:
>
> ERROR(SCR.EXP10) : C:\research\Repository.6
> \volley\ARep\Aalborg\FreePostureTrial\Environment.any
> (58) : ‘F0’ : Expression evaluation failed at moment ‘Const’ :
> C:\research\Repository.6
> \volley\ARep\Aalborg\FreePostureTrial\Environment.any
> (55) : ‘RightHeelStrength’ : argument will not be ready for
> evaluation until moment ‘PosVar’
>
> Is this because of a mutual depencancy of RightHeelY.Pos and
> RightHeelStrength? If this is the case (or otherwise), could you
> suggest a solution.
>
> As ever, many thanks
>
> James
>
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]