opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
787 stars 317 forks source link

CMC fails for "Strength of Simulation" example #2089

Closed tkuchida closed 6 years ago

tkuchida commented 6 years ago

See "Strength of Simulation" example, Part I, Section D, first unordered list. Messages window:

Updating Model file from 20303 to latest format...
Loaded model leg6dof9musc from file C:\Models\Leg6Dof9Musc\leg6dof9musc.osim
Running tool leg6dof9musc.
No external loads will be applied (external loads file not specified).

 taskSet size = 3

CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'bifemlh_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'bifemsh_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'glut_max2_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'psoas_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'rect_fem_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'vas_int_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'med_gas_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'soleus_r' has been reset to 0.02.
CMC::Warning: CMC cannot compute controls for muscles with muscle controls < 0.02.
The minimum control limit for muscle 'tib_ant_r' has been reset to 0.02.

WARN- a desired points file was not specified.

Loading desired kinematics from file C:\Models\Leg6Dof9Musc\Swing\leg69_IK_swing.mot ...
Storage: file=C:\Models\Leg6Dof9Musc\Swing\leg69_IK_swing.mot (nr=31 nc=33)

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

MODEL: leg6dof9musc

numStates = 32
numCoordinates = 7
numSpeeds = 7
numActuators = 9
numBodies = 7
numConstraints = 1
numProbes = 0

ANALYSES (total: 2)
analysis[0] = Un-named analysis.
analysis[1] = Un-named analysis.

BODIES (total: 7)
body[0] = pelvis. mass: 10.7538
              moments of inertia:  ~[0.1027,0.0870155,0.0578439]
              products of inertia: ~[0,0,0]
body[1] = femur_r. mass: 8.54927
              moments of inertia:  ~[0.169564,0.0444489,0.178809]
              products of inertia: ~[0,0,0]
body[2] = tibia_r. mass: 4.67404
              moments of inertia:  ~[0.0802351,0.00811903,0.0813495]
              products of inertia: ~[0,0,0]
body[3] = patella_r. mass: 0.0919138
              moments of inertia:  ~[0.00110296,0.00110296,0.00110296]
              products of inertia: ~[0,0,0]
body[4] = talus_r. mass: 0.126069
              moments of inertia:  ~[0.00202166,0.00202166,0.00202166]
              products of inertia: ~[0,0,0]
body[5] = calcn_r. mass: 1.07225
              moments of inertia:  ~[0.00090462,0.00361848,0.00361848]
              products of inertia: ~[0,0,0]
body[6] = toes_r. mass: 0.186142
              moments of inertia:  ~[0,0,0.00090462]
              products of inertia: ~[0,0,0]

JOINTS (total: 7)
joint[0] = ground_pelvis. parent: ground_offset, child: pelvis
joint[1] = hip_r. parent: pelvis_offset, child: femur_r
joint[2] = knee_r. parent: femur_r, child: tibia_r
joint[3] = tib_pat_r. parent: tibia_r, child: patella_r
joint[4] = ankle_r. parent: tibia_r_offset, child: talus_r
joint[5] = subtalar_r. parent: talus_r_offset, child: calcn_r
joint[6] = mtp_r. parent: calcn_r_offset, child: toes_r

ACTUATORS (total: 9)
actuator[0] = bifemlh_r
actuator[1] = bifemsh_r
actuator[2] = glut_max2_r
actuator[3] = psoas_r
actuator[4] = rect_fem_r
actuator[5] = vas_int_r
actuator[6] = med_gas_r
actuator[7] = soleus_r
actuator[8] = tib_ant_r

STATES (total: 32)
y[0] = ground_pelvis/pelvis_tilt/value
y[1] = ground_pelvis/pelvis_tilt/speed
y[2] = ground_pelvis/pelvis_tx/value
y[3] = ground_pelvis/pelvis_tx/speed
y[4] = ground_pelvis/pelvis_ty/value
y[5] = ground_pelvis/pelvis_ty/speed
y[6] = hip_r/hip_flexion_r/value
y[7] = hip_r/hip_flexion_r/speed
y[8] = knee_r/knee_angle_r/value
y[9] = knee_r/knee_angle_r/speed
y[10] = tib_pat_r/knee_angle_pat_r/value
y[11] = tib_pat_r/knee_angle_pat_r/speed
y[12] = ankle_r/ankle_angle_r/value
y[13] = ankle_r/ankle_angle_r/speed
y[14] = bifemlh_r/activation
y[15] = bifemlh_r/fiber_length
y[16] = bifemsh_r/activation
y[17] = bifemsh_r/fiber_length
y[18] = glut_max2_r/activation
y[19] = glut_max2_r/fiber_length
y[20] = psoas_r/activation
y[21] = psoas_r/fiber_length
y[22] = rect_fem_r/activation
y[23] = rect_fem_r/fiber_length
y[24] = vas_int_r/activation
y[25] = vas_int_r/fiber_length
y[26] = med_gas_r/activation
y[27] = med_gas_r/fiber_length
y[28] = soleus_r/activation
y[29] = soleus_r/fiber_length
y[30] = tib_ant_r/activation
y[31] = tib_ant_r/fiber_length
Coordinate.setValue: WARN- coordinate pelvis_tilt is locked. Unable to change its value.
Coordinate.setValue: WARN- coordinate pelvis_tx is locked. Unable to change its value.
Coordinate.setValue: WARN- coordinate pelvis_ty is locked. Unable to change its value.

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 C:\Models\Leg6Dof9Musc\Swing\leg69_IK_swing.mot to set the initial configuration.

Using IPOPT optimizer algorithm.

Setting optimizer print level to 0.
Setting optimizer convergence tolerance to 0.0001.
Setting optimizer maximum iterations to 1000.

Setting cmc controller to not use verbose printing.

================================================================
================================================================
Computing initial values for muscles states (activation, length)
Start time = Wed Feb 14 21:41:13 2018

================================================================
CMC.computeControls:  t = 0.116667
CMC.computeControls:  t = 0.116667

----------------------------------------------------------------
Finished computing initial states:
----------------------------------------------------------------
================================================================
Start time   = Wed Feb 14 21:41:13 2018
Finish time  = Wed Feb 14 21:41:41 2018
Elapsed time = 28 seconds.
================================================================

================================================================
================================================================
Using CMC to track the specified kinematics
Integrating from 0.146667 to 0.616667
Start time = Wed Feb 14 21:41:41 2018
================================================================
CMC.computeControls:  t = 0.146667
SimTK Exception thrown at InteriorPointOptimizer.cpp:264:
  Optimizer failed: Ipopt: Infeasible problem detected (status 2)
OPTIMIZATION FAILED...

CMC.computeControls: ERROR- Optimizer could not find a solution.
Unable to find a feasible solution at time = 0.146667.
Model cannot generate the forces necessary to achieve the target acceleration.
Possible issues: 1. not all model degrees-of-freedom are actuated, 
2. there are tracking tasks for locked coordinates, and/or
3. there are unnecessary control constraints on reserve/residual actuators.

(AppVeyor artifact OpenSim-dd7dc47b-2018-02-11.zip)

tkuchida commented 6 years ago

Fixed by #2114

ThorneShao commented 1 year ago

how can we solve this issue?