Static Optimization error with additional actuators

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Michael Rosenberg
Posts: 6
Joined: Sat Oct 03, 2015 12:07 pm

Static Optimization error with additional actuators

Post by Michael Rosenberg » Tue May 17, 2016 1:00 pm

Hello,

I am trying to apply a <CoordinateActuator> with a large optimal force to the Crouch Severity Simulation data set available on the SimTK website. At this point, I have added one <CoordinateActuator> acting on the right and left "ankle_angle" joints (see sample code at the end of the post). Simulations with unbounded actuators seem to return reasonable results when compared to simulations without additional actuators. Using bounded [0,-Inf) actuators in Static Optimization (SO) returns the following error message at every time point:

Code: Select all

 StaticOptimization.record:  WARN- The optimizer could not find a solution at time = 1.623

The model appears too weak for static optimization.
Try increasing the strength and/or range of the following force(s):
   Active_AFO_r approaching upper bound of 0
   Active_AFO_l approaching upper bound of 0

time = 1.623 Performance =68.3113 Constraint violation = 0.00675597
SimTK Exception thrown at InteriorPointOptimizer.cpp:261:
  Optimizer failed: Ipopt: Restoration failed (status -2)
OPTIMIZATION FAILED... 
Results from some of the simulations show large spikes in muscle forces at single time points. The above error message is thrown regardless of the closeness of the Active_AFO_(r/l). In some models, I get jumps (see attached image) in the magnitude of muscle forces and reserve actuators at single time points, but not at every point in the simulation. At these "jump" points, many of the muscles see an activation level of 1 or see very large forces, but generally no muscles maintain that level of activation for more than one time point.

This all surprises me, because the models run in SO without error messages if I remove the additional actuators. Similarly, adding unbounded actuators does not cause problems. Can anybody explain to me why these bounded actuators might be causing error messages and "jumps" in my results?

Thanks,
Michael

Code: Select all

<CoordinateActuator name="Active_AFO_r">
				<!--Name of the generalized coordinate to which the actuator applies.-->
				<coordinate>ankle_angle_r</coordinate>
				<!--The maximum generalized force produced by this actuator.-->
				<min_control>-100000</min_control>
				<!--Maximum allowed value for control signal. Used primarily when solving for control values.-->
				<max_control>0</max_control>
				<optimal_force>100000</optimal_force>				
			</CoordinateActuator>
Attachments
Untitled.jpg
Solid is a force profile without additional actuators. Dashed line is the corresponding force profile (same kinematics/kinetics) with bounded actuators.
Untitled.jpg (44.41 KiB) Viewed 1471 times

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Static Optimization error with additional actuators

Post by Dimitar Stanev » Wed May 18, 2016 12:06 am

Hi,
Results from some of the simulations show large spikes in muscle forces at single time points.
The spikes are caused because at some point, the constraints are not satisfied and the reserve actuators are activated to compensate for the difference of torque in the joints.

I think the problem is with the definition of min/max/optimal constants. You can try to permit positive and negative control values and to choose smaller values.

Best

User avatar
Michael Rosenberg
Posts: 6
Joined: Sat Oct 03, 2015 12:07 pm

Re: Static Optimization error with additional actuators

Post by Michael Rosenberg » Thu May 19, 2016 1:31 pm

Thanks for the recommendation. Dropping the optimal force eliminated the error messages. I would like to better understand why the combination of an upper bound and a large optimal force caused IPOPT's restoration phase to fail. The optimal force was not an issue until I created this limit on the maximum force (e.g. max=0, min=-Inf). Since the simulations without the additional actuators returned no errors, I expected the max force limit to be a non-issue.

Based on this explanation (http://list.coin-or.org/pipermail/ipopt ... 00787.html):
Now, the question you are really asking is what that means for the problem
itself. Well, theoretically, this should not happen if the problem
statement satisfies certain conditions (see the Ipopt global convergence
paper). One of the assumptions is that the gradients of the active
constraints are linearly independent, and this is a condition that could
be violated in practice. So, it might be that Ipopt is trying to solve a
problem which does not satify a "constraint qualification" at the feasible
point it is converging to. (Note, if a constraint qualification does not
hold at the optimal solution of the problem, then the KKT conditions
cannot be satisfied at this point - since Ipopt is trying to find a point
that satisfies the KKT conditions, it must run into trouble). There might
be some workaround for such a case, and Ipopt might stop with a message
like "cannot find KKT point, constraint violation might be violated".
My best guess as to why IPOPT could not find a solution is that the cost was at a minimum and still decreasing at the imposed actuator constraint. Can you explain more coherently/accurately why the optimizer may have issues with this?

Thanks,
Michael

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Static Optimization error with additional actuators

Post by Dimitar Stanev » Thu May 19, 2016 11:55 pm

Hi,
I would like to better understand why the combination of an upper bound and a large optimal force caused IPOPT's restoration phase to fail.
I am not 100% sure about my answer, because I haven't looked into IPOPT's implementation. Although I imagine that higher order derivatives are used to evaluate the direction on the constraint manifold numerically in order to find a solution. If you apply large residual forces, which are discrete events (they are not accounted in the error or constraint function that you minimize), you may cause instabilities in the evaluation of the numerical derivatives. On the other hand, the algorithm may be robust for small values of the residual forces. In any case the residual forces should be small, otherwise you drive your model with artificial actuators, which is non-physiological and thus you must remodel your model.

Best

User avatar
Michael Rosenberg
Posts: 6
Joined: Sat Oct 03, 2015 12:07 pm

Re: Static Optimization error with additional actuators

Post by Michael Rosenberg » Fri May 20, 2016 9:58 am

Great; thank you again for the help!

POST REPLY