Solution Failed

During the solving process, nonlinear programming solvers may return a failed solution status. In fact, unless the problem is a convex optimization problem, i.e.:

  • The dynamics equations and equality constraints are affine
  • The objective function and inequality constraints are convex
  • The initial and final times are fixed

It cannot be guaranteed that the solver will always succeed and converge to a global optimum. If the solution fails, try the following methods to troubleshoot and resolve the issue:

Problem Check

  • Is the problem definition correctly entered?
  • Does the problem itself have a feasible solution?
  • Are there variables with values that are too large or too small? If so, try scaling the variables. Excessively large or small variable values may cause numerical instability in nonlinear programming and linear equation solving

Solver Settings

  • Check if the discrete grid settings are reasonable. The grid should not be too large, too small, or too uneven. The required number of grid points depends on the problem's complexity, and its resolution should match the variables' rate of change. The number of interpolation points should be appropriate for the problem and not too large
  • Try changing the interpolation scheme (Radau/Lobatto)
  • Try changing the linear equation solver

Initial Values

For nonlinear programming problems, the provided initial values are crucial for successful solving. The choice of initial values should be as close as possible to the problem's solution or at least be a reasonable starting point for optimization. Remember to set initial values for the initial or final times (if they are free variables).