Skip to content
Numerical Method , home
Menu

Forum Numerical Method Optimization

Exception – unable to solve a sub quadratic programming problem

  1. jiri01Participant 2012-05-15 at 10:43 am

    Hi,

    I have been working on the SuanShu library for the past few weeks. Recently I found a problem in solving a non linear constrained optimization problem using SQPActiveSetSolver Algorithm. I have attached the source code here. It is a two dimensional problem with one equality constraint and two inequality constraints.

    On executing the line with initial point as (60, 1),

    Vector xmin = optim.search(new DenseVector(initialPoint), new DenseVector(new double[] {1,1}), new DenseVector(new double[] {1,1}));
    

    gives the following exception:

    java.lang.RuntimeException: unable to solve a sub quadratic programming problem: at com.numericalmethod.suanshu.optimization.constrained.sqp.activeset.SQPActiveSetSolver.search(lc:131) at ReproducingUnableToSolveError.solveConstrainedOptimization(ReproducingUnableToSolveError.java:121)

    Another observation is that, if I interchange the variables (x[0] -> x[1], x[1] -> x[0] on the constraints and objective function) and the initial point as (1, 60), then the algorithm solves the optimization problem and produces the results.

    Other technical details: Java version : 1.6.0_10-rc2-b32

    Thanks and Regards, Nilavalagan

  2. RyuParticipant 2012-05-15 at 12:44 pm

    Nilavalagan,

    Thank you very much for reporting the problem. I will look into it and get back to you soon.

    Stay tuned. Ryu

  3. RyuParticipant 2012-05-18 at 6:36 pm

    Hello Nilavalagan,

    There is a bug in this line of your code.

    Vector xmin = optim.search(new DenseVector(initialPoint), new DenseVector(new double[] {1,1}), new DenseVector(new double[] {1,1}));
    

    If you change it to:

    Vector xmin = optim.search(new DenseVector(initialPoint), new DenseVector(new double[] {-1,-1}), new DenseVector(new double[] {1,1}));
    

    Your code will work fine without switching the variables.

    The 2nd argument is ‘labmda’, the lagrange multiplier for equality constraints; the 3rd argument is ‘mu’, the lagrange multiplier for inequality constraints. All lambda’s must be negative; all mu’s must be positive.

    For more details, you may refer to

    “Andreas Antoniou, Wu-Sheng Lu, “Algorithm 15.4, SQP algorithm for nonlinear problems with equality and inequality constraints,” Practical Optimization: Algorithms and Engineering Applications.”

    Hope this helps.