RE: [AMPL 11021] Non linear Constraint

21 views
Skip to first unread message

Robert Fourer

unread,
Nov 24, 2015, 2:20:46 PM11/24/15
to am...@googlegroups.com
Can you re-post this question so that it also shows the AMPL definitions for F, y, and Pmax? Then it will be possible to give a more specific answer.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of skyline
Sent: Monday, November 23, 2015 2:07 PM
To: AMPL Modeling Language
Subject: [AMPL 11021] Non linear Constraint

I have Non linear Constraint in my problem given by :

C4{i in N} : F[i] == Pmax / (y[i]);

L{N} Variable such as 0=<F[i]<=Pmax
F{N} variable such as 0=<y[i]
Pmax is a positive paramater

When I solve this problem with C4 constraint using : KnitroAmpl, Bonmin, IPOPT.

The solvers to avoid the problem of division by zero they fix the value of y[i] to 1.I get wrong results because in many cases y[i] sould be equal to zero

here is an example of the solution i get:

: y F :=
1 5 2
2 1 10
3 1 10
4 1 10
5 1 10
6 1 10
7 1 10
8 1 10
9 1 10
10 1 10
;

When I should get the following :

: y F :=
1 5 2
2 0 10
3 0 10
4 0 10
5 0 10
6 0 10
7 0 10
8 0 10
9 0 10
10 0 10
;

I did add a test on the value of y[i]. I changed C4 by this constraint:

C444{i in N}: F[i] = if (y[i]=0) then Pmax
else Pmax/y[i];

I get the Same results also.


skyline

unread,
Nov 25, 2015, 8:09:49 AM11/25/15
to AMPL Modeling Language, 4...@ampl.com
Hello,


I have Non linear Constraint in my problem given by :

C4{i in N} : F[i] == Pmax / (y[i]);

such as :

var y {N} >=0 ;    y is defined by :  C1 {i in N,j in J}:y[i]>= cost[i,j] * x[i,j];
var x{N,N} binary;
var F {N} >=0  <= Pmax; 
param Pmax:= 10;
param N:= 10;
param cost :    
                1   2   3   4   5   6   7   8   9  10 :=
   1   0   4   5   7   3   1   4   5   1   7
   2   4   0   3   7   8  10   5   9   5   8
   3   5   3   0   5   7   6   5   4   1   4
   4   7   7   5   0   9   6   1   6   8  10
   5   3   8   7   9   0   2   4   2  10   4
   6   1  10   6   6   2   0   1   9   7   8
   7   4   5   5   1   4   1   0   9   4   1
   8   5   9   4   6   2   9   9   0   8   1
   9   1   5   1   8  10   7   4   8   0   3
  10   7   8   4  10   4   8   1   1   3   0 ;


When I solve this problem with C4 constraint using : KnitroAmpl, Bonmin, IPOPT.

The solvers to avoid the problem of division by zero they fix the value of y[i] to 1.I get wrong results because in many cases y[i] sould be equal to zero 

here is an example of the solution i get with knitro:

:    y   F     :=
Any help please. I will be very grateful.
Reply all
Reply to author
Forward
0 new messages