Class Mapqn_nlp_solver
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceObjective gradient at x, accumulated into gradOut (pre-zeroed by the caller).static interfaceObjective value at x. -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]feasibleStart(double[][] Aeq, double[] beq, double[][] Aub, double[] bub, int nVars) A point of the polytopeAeq x = beq,Aub x <= bub,lb <= x <= ubnearest tox0.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) 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) Minimiseobjectivesubject toAeq x = beq,Aub x <= bubandlb <= x <= ub, by sequential quadratic programming in the null space of the equalities.
-
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) Minimiseobjectivesubject toAeq x = beq,Aub x <= bubandlb <= 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 polytopeAeq x = beq,Aub x <= bub,lb <= x <= ubnearest tox0. Returns null when the polytope solve fails.
-