Class Mapqn_nlp_solver

java.lang.Object
jline.api.mapqn.Mapqn_nlp_solver

public final class Mapqn_nlp_solver extends Object
Smooth minimisation over a polytope, by proximal projected gradient with an OSQP projection oracle.

The QRF no-blocking family (MMI, MEM and their load-dependent variants) minimises a smooth entropy-like objective over Aeq x = beq, Aub x <= bub, lb <= x <= ub, with several hundred to several thousand variables. Two earlier designs failed on it and are worth recording:

  • A derivative-free inner solver (BOBYQA) needs O(n^2) interpolation points; on the M=3, N=4 instance (228 variables) it did not return within 21 CPU-minutes. An analytic gradient is therefore REQUIRED here, not optional.
  • An augmented Lagrangian around a projected L-BFGS inner solver drove the penalty to its 1e8 ceiling with the constraint violation still oscillating around 1e-3: at that penalty the subproblem is too ill-conditioned for a limited-memory method to solve accurately, and an inaccurate subproblem solution makes the multiplier update meaningless.

The scheme below keeps every iterate ON the polytope instead of penalising departures from it. Each step solves argmin_y g'(y - x) + ||y - x||^2 / (2 t) over the SAME polytope -- a strictly convex QP, which is where OSQP is at its most reliable -- and then line-searches on the segment [x, y], which is feasible by convexity. The QP matrix P = I / t is constant, so only the linear cost changes between iterations and no refactorisation is needed.

The objective is smooth but not convex (the MMI form carries -p log p' cross terms), so this converges to a stationary point, exactly as the MATLAB twin's fmincon and the native-Python twin's scipy.optimize.minimize(method='SLSQP') do.

  • Method Details

    • solve

      public static double[] solve(Mapqn_nlp_solver.ObjectiveFn objective, Mapqn_nlp_solver.GradientFn gradient, int nVars, double[][] Aeq, double[] beq, double[][] Aub, double[] bub, double[] lb, double[] ub, double[] x0)
    • solve

      public static double[] solve(Mapqn_nlp_solver.ObjectiveFn objective, Mapqn_nlp_solver.GradientFn gradient, int nVars, double[][] Aeq, double[] beq, double[][] Aub, double[] bub, double[] lb, double[] ub, double[] x0, int maxIter)
      Minimise objective subject to Aeq x = beq, Aub x <= bub and lb <= x <= ub, by sequential quadratic programming in the null space of the equalities.
      Parameters:
      maxIter - maximum SQP steps
    • feasibleStart

      public static double[] feasibleStart(double[][] Aeq, double[] beq, double[][] Aub, double[] bub, int nVars)
      A point of the polytope Aeq x = beq, Aub x <= bub, lb <= x <= ub nearest to x0. Returns null when the polytope solve fails.