Quadratic constrained convex problem Topic is solved

Problems with modeling
zapostrava
User
User
Posts: 2
Joined: 6 days ago

Quadratic constrained convex problem

Postby zapostrava » 6 days ago

Hello,
please, can you help me with my (probably very simple) problem? I wanted to solve a convex (quadratic) toy problem using the QCP solver. But, I realized that it doesn't work properly. In particular, it simply ignores the quadratic terms in the constraint (e.g. if I set the coefficient for x1 in the constraint to zero, there is no feasible solution).

Thank you very much for any help.

Frantisek

Code: Select all

FREE VARIABLES
             OF        objective function's value;

VARIABLE
             x1 variable 1
             x2 variable 2 ;

EQUATION

    obj          objective function
    con          constraint
    bound_x1     non-negativity constraint for x1
    bound_x2     non-negativity constraint for x2;

    obj..         OF=e=1*x2+.01*power(x1,2);
    con..         0.01*x1+5*power(x2,2)=g=100;
    bound_x1..    x1=g=0;
    bound_x2..    x2=g=0;

MODEL nonlinear_problem /all/;

SOLVE nonlinear_problem USING QCP minimizing OF;

User avatar
bussieck
Moderator
Moderator
Posts: 48
Joined: 11 months ago

Re: Quadratic constrained convex problem  Topic is solved

Postby bussieck » 6 days ago

Not sure what you mean. If I solve this with a global solver like Antigone, Baron, Couenne, LindoGlobal, or SCIP (since this is a non-convex QCP) I get a good solution:

Code: Select all

                       LOWER     LEVEL     UPPER    MARGINAL

---- VAR OF             -INF      4.472     +INF       .         
---- VAR x1             -INF      0.011     +INF       .         
---- VAR x2             -INF      4.472     +INF       .         


Not sure what solver you used, but if it is a local solver make sure to set good starting values. See https://www.gams.com/latest/docs/S_CONOPT.html#CONOPT_INITIAL_VALUES for a discussion on starting values.

-Michael

zapostrava
User
User
Posts: 2
Joined: 6 days ago

Re: Quadratic constrained convex problem

Postby zapostrava » 6 days ago

Thank you for your answer Michael. Ok, so that is my stupid mistake - I did not know that I have to set the NLP solver manually. Now, it works.

Thanks a lot again,
Frantisek


Return to “Modeling”

Who is online

Users browsing this forum: No registered users and 1 guest