Page 1 of 1

RRA failed - Search direction becomes too sma

Posted: Wed Mar 23, 2011 9:27 pm
by tinyvane
I first time to see this error message, and got confused about it, I searched in the forum and got no others' experience about this. The below error is what I saw when RRA failed.

-------------------------------------------------------
This program includes software developed by the
Apache Software Foundation (http://www.apache.org/).
-------------------------------------------------------

Constructing investigation from setup file B010_SMALL_FLAT_LF_1_Setup_RRA.xml.

AbstractTool B010_SMALL_FLAT_LF_1_walk1_RRA loading model 'B010_knee_adduction_final_lock.osim'
Loaded model subject01 from file B010_knee_adduction_final_lock.osim
Adding force object set from Common_RRA_Actuators.xml
-----------------------------------------------------------------------
Loaded library
-----------------------------------------------------------------------
MODEL: subject01
forces: 23
analyses: 0
bodies: 13
joints: 12
markers: 17
-----------------------------------------------------------------------

Running tool B010_SMALL_FLAT_LF_1_walk1_RRA.


taskSet size = 23



WARN- a desired points file was not specified.



Loading desired kinematics from file B010_SMALL_FLAT_LF_1_output_ik.mot ...

Loading q's from file B010_SMALL_FLAT_LF_1_output_ik.mot.
Storage: file=B010_SMALL_FLAT_LF_1_output_ik.mot (nr=125 nc=79)
Found 125 q's with time stamps ranging
from 0 to 2.06667.


Low-pass filtering desired kinematics with a cutoff frequency of 6...

MODEL: subject01

ANALYSES (0)

BODIES (13)
body[0] = ground (mass: 0) (inertia: 0 0 0 0 0 0 0 0 0)
body[1] = pelvis (mass: 11.2812) (inertia: 0.0984719 0 0 0 0.0834329 0 0 0 0.0554623)
body[2] = femur_r (mass: 8.90979) (inertia: 0.128263 0 0 0 0.0336222 0 0 0 0.135255)
body[3] = tibia_r (mass: 3.55141) (inertia: 0.0482781 0 0 0 0.00488528 0 0 0 0.0489486)
body[4] = talus_r (mass: 0.0957898) (inertia: 0.0009579 0 0 0 0.0009579 0 0 0 0.0009579)
body[5] = calcn_r (mass: 1.19737) (inertia: 0.00134106 0 0 0 0.0037358 0 0 0 0.00392738)
body[6] = toes_r (mass: 0.207481) (inertia: 9.579e-005 0 0 0 0.00019158 0 0 0 9.579e-005)
body[7] = femur_l (mass: 8.90979) (inertia: 0.128263 0 0 0 0.0336222 0 0 0 0.135255)
body[8] = tibia_l (mass: 3.55141) (inertia: 0.0482781 0 0 0 0.00488528 0 0 0 0.0489486)
body[9] = talus_l (mass: 0.0957898) (inertia: 0.0009579 0 0 0 0.0009579 0 0 0 0.0009579)
body[10] = calcn_l (mass: 1.19737) (inertia: 0.00134106 0 0 0 0.0037358 0 0 0 0.00392738)
body[11] = toes_l (mass: 0.207481) (inertia: 9.579e-005 0 0 0 0.00019158 0 0 0 9.579e-005)
body[12] = torso (mass: 32.7952) (inertia: 1.41242 0 0 0 0.723692 0 0 0 1.37113)

ACTUATORS (23)
actuator[0] = FX
actuator[1] = FY
actuator[2] = FZ
actuator[3] = MX
actuator[4] = MY
actuator[5] = MZ
actuator[6] = hip_flexion_r
actuator[7] = hip_adduction_r
actuator[8] = hip_rotation_r
actuator[9] = knee_angle_r
actuator[10] = ankle_angle_r
actuator[11] = subtalar_angle_r
actuator[12] = mtp_angle_r
actuator[13] = hip_flexion_l
actuator[14] = hip_adduction_l
actuator[15] = hip_rotation_l
actuator[16] = knee_angle_l
actuator[17] = ankle_angle_l
actuator[18] = subtalar_angle_l
actuator[19] = mtp_angle_l
actuator[20] = lumbar_extension
actuator[21] = lumbar_bending
actuator[22] = lumbar_rotation
numStates = 46
numCoordinates = 23
numSpeeds = 23
numActuators = 23
numBodies = 13
numConstraints = 0

STATES (46)
y[0] = pelvis_tilt
y[1] = pelvis_list
y[2] = pelvis_rotation
y[3] = pelvis_tx
y[4] = pelvis_ty
y[5] = pelvis_tz
y[6] = hip_flexion_r
y[7] = hip_adduction_r
y[8] = hip_rotation_r
y[9] = knee_angle_r
y[10] = ankle_angle_r
y[11] = subtalar_angle_r
y[12] = mtp_angle_r
y[13] = hip_flexion_l
y[14] = hip_adduction_l
y[15] = hip_rotation_l
y[16] = knee_angle_l
y[17] = ankle_angle_l
y[18] = subtalar_angle_l
y[19] = mtp_angle_l
y[20] = lumbar_extension
y[21] = lumbar_bending
y[22] = lumbar_rotation
y[23] = pelvis_tilt_u
y[24] = pelvis_list_u
y[25] = pelvis_rotation_u
y[26] = pelvis_tx_u
y[27] = pelvis_ty_u
y[28] = pelvis_tz_u
y[29] = hip_flexion_r_u
y[30] = hip_adduction_r_u
y[31] = hip_rotation_r_u
y[32] = knee_angle_r_u
y[33] = ankle_angle_r_u
y[34] = subtalar_angle_r_u
y[35] = mtp_angle_r_u
y[36] = hip_flexion_l_u
y[37] = hip_adduction_l_u
y[38] = hip_rotation_l_u
y[39] = knee_angle_l_u
y[40] = ankle_angle_l_u
y[41] = subtalar_angle_l_u
y[42] = mtp_angle_l_u
y[43] = lumbar_extension_u
y[44] = lumbar_bending_u
y[45] = lumbar_rotation_u


Loading external loads kinematics from file B010_SMALL_FLAT_LF_1_output_ik.mot ...
Storage: file=B010_SMALL_FLAT_LF_1_output_ik.mot (nr=125 nc=79)
Low-pass filtering external load kinematics with a cutoff frequency of 6...
Storage: file=D:\Applications\OpenSim 2.2\examples\Yi\20110308-Alltrails with wand markers\B010_SMALL_FLAT_LF_1_kinetics.mot (nr=1241 nc=19)

Note: requested COM adjustment time range 0.53667 - 1.89334 clamped to nearest available data times 0.53272 - 1.88218

Computing average residuals between 0.53272 and 1.88218
Average residuals before adjusting torso COM:
FX=-0.206598 FY=53.8366 FZ=-11.2503
MX=9.28513 MY=-2.94917 MZ=36.7663

CMCTool.adjustCOMToReduceResiduals:
torso weight = 321.611
dx=0.1, dz=-0.0288707

dmass = -5.48981

Recommended mass adjustments:
ground: orig mass = 0, new mass = 0
pelvis: orig mass = 11.2812, new mass = 10.421
femur_r: orig mass = 8.90979, new mass = 8.23044
tibia_r: orig mass = 3.55141, new mass = 3.28062
talus_r: orig mass = 0.0957898, new mass = 0.0884861
calcn_r: orig mass = 1.19737, new mass = 1.10608
toes_r: orig mass = 0.207481, new mass = 0.191661
femur_l: orig mass = 8.90979, new mass = 8.23044
tibia_l: orig mass = 3.55141, new mass = 3.28062
talus_l: orig mass = 0.0957898, new mass = 0.0884861
calcn_l: orig mass = 1.19737, new mass = 1.10608
toes_l: orig mass = 0.207481, new mass = 0.191661
torso: orig mass = 32.7952, new mass = 30.2946

Computing average residuals between 0.53272 and 1.88218
Average residuals after adjusting torso COM:
FX=0.0720428 FY=54.4982 FZ=-10.3568
MX=19.8871 MY=-3.09726 MZ=67.7389


Constructing function set for tracking desired kinematics...

No Actuation analysis found in analysis set -- adding one
No Kinematics analysis found in analysis set -- adding one
Using the generalized coordinates specified in B010_SMALL_FLAT_LF_1_output_ik.mot to set the initial configuration.
Using IPOPT optimizer algorithm.

Setting optimizer print level to 0.
Setting optimizer convergence criterion to 1e-006.
Setting optimizer maximum iterations to 2000.

Setting cmc controller to not use verbose printing.
CMC.computeControls: t = 0.53667



================================================================
================================================================
Using CMC to track the specified kinematics
Integrating from 0.53667 to 1.89334
Start time = Wed Mar 23 22:13:55 2011
================================================================
CMC.computeControls: t = 0.53667
......................
CMC.computeControls: t = 0.97867
SimTK Exception thrown at InteriorPointOptimizer.cpp:262:
Optimizer failed: Ipopt: Search direction becomes too small (status 3)
OPTIMIZATION FAILED...


CMC.computeControls: WARN- The optimizer could not find a solution at time = 0.978670.
If using the fast target, try using the slow target.
Starting at a slightly different initial time may also help.

------------------------------------------

Some time the error is about "Maximum iterations exceeded (status -1)", what reasons could cause these two errors? Any suggestion could help.

Thanks in advance.
Yi.

RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 9:31 am
by aymanh
Hi Yi,

That's probably because there're coordinates in the model that do not contribute to the objective function so the optimizer keeps changing them with no effect and it ends up cutting the step size too small and stuck.

Best,
-Ayman

RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 9:52 am
by tinyvane
Hi Ayman,

"coordinates in the model that do not contribute to the objective function", you meant this was resulted from the wrong coordinate value in the model?

Sorry that I could not understand you throughly and how to fix this?

Thanks in advance.

Yi.

RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 10:02 am
by aymanh
Hi Yi,

I mean this's probably because there're no RRA tasks for knee_adduction (_l, _r) and potentially other coordinates that were added to the model without corresponding tasks.

Hope this helps,
-Ayman






RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 11:16 am
by tinyvane
Hi Ayman,

Thanks for your quick reply, but I think that's impossible. The reason I added the knee_adduction and knee_rotation just for the purpose of getting the moment, so during the RRA step and CMC later. There are no those two joints.

So would you mind having a looking at my files? I got 48 trails to analysis but so far, no luck with any one of them with OpenSim 2.2 and RRA. But in 1.9.1, RRA runs smoothly.

Yi.

RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 11:54 am
by aymanh
Hi Yi,

If the model didn't have these coordinates during IK then the motion resulting from IK will require no moments acting along these coordinates. In this case you'd want to run JointReaction analysis to measure the moments required to keep the knee joint intact rather than modify the model and add coordinates for the sole purpose of measuring moments.

If I missed something or misunderstood your process I'd appreciate if you'd detail your steps (what tools you used on what model and for what purpose) so that we can help you out.

Best regards,
-Ayman

RE: RRA failed - Search direction becomes too sma

Posted: Thu Mar 24, 2011 1:59 pm
by tinyvane
Hi Ayman,

Thanks for your reply. I'd like to detail everything if that doesn't bother you.

I divided my models into two directories for two purposes, one for angles and moments result, the other directory's model for the purpose of force analysis.

Now I got the result of IK and ID from the first directory, and encountered the problem with the second directory's models and setting files. That's why I posted this topic.

Correct me if I make anything wrong about your suggestion. You ask me to run JointReaction analysis for the Moments result? Even without adding the joints of knee_adduction or knee_rotation, I would also get result from every joints in the model? is that right? You mean the JointReaction would generate moment for every single joint? Such 3-axis for hip, ankle, knee?

But now the more severe problem is to get force result. Which is exactly why I created the second directory for the sole purpose of RRA and CMC. But now I stuck with RRA step, which need the input:

1. Model: I modified the model of Gait2354 and scale it and run IK then I got scaled model and kinematics.
2. GRF: I extract that from the C3D file and applied that on the left and right caln.
3. RRA setting files: I copied them from GAIT2354 directory.

So, when I run them with command line mode and in batch, none of 48 trails would end up with succeeding. I can not help with frustrating myself about this failure. So as you suggested in the previous topic, should I start from IK to check everything?

Yi.
Thanks in advance.

RE: RRA failed - Search direction becomes too sma

Posted: Fri Mar 25, 2011 2:30 pm
by aymanh
Hi Yi,

I'm not sure if you're stuck on this issue or not any more, but the basic question is what are you trying to analyze/model and is the model good enough to answer your question.

If the activity you're studying can be fairly well simulated using a 1-dof knee I'd stick with that, if you need to model varus/valgus then stick with a more general knee model throughout, you pay a price for that in complexity.

Hope this helps, and good luck.
-Ayman

RE: RRA failed - Search direction becomes too sma

Posted: Fri Mar 25, 2011 2:43 pm
by tinyvane
Hi Ayman,

Thanks for you reply. I see and I am still working on improving the GRF accuracy to make RRA work, another side, trying to decrease RRA ControlConstraints value to make them more like Gait2354.

Thanks.
Yi.