Non Linear Constraint

33 views
Skip to first unread message

skyline

unread,
Nov 24, 2015, 10:02:50 AM11/24/15
to AMPL Modeling Language, Yakine Fadoua
Hello,

I have Non linear Constraint in my problem given by :

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

F{N} Variable  such as 0=<F[i]<=Pmax
y{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.

Any help please. I will be very grateful.

richar...@gmail.com

unread,
Nov 26, 2015, 3:23:05 PM11/26/15
to AMPL Modeling Language, yakine...@gmail.com
You should be able to solve the original form of the problem using Knitro by using the Knitro "honorbnds=1" option.  This will force the variables y[i] to remain "strictly" positive throughout the optimization, though they should get asymptotically close to 0 near the solution.  Since the y[i] will never be exactly "0" though, the constraint C4 will remain well defined.

Richard Waltz
Artelys Corp

skyline

unread,
Nov 28, 2015, 9:12:22 PM11/28/15
to AMPL Modeling Language, yakine...@gmail.com, richar...@gmail.com
Hello,
Thanks for your reply.
I did use the "honorbnds=1" option you suggested.The results are the same with knitro.

  L     y
  2      5
 10     1
 10     1
 10     1
 10     1
 10     1
 10     1
 10     1
 10     1
 10     1

Michael Saunders

unread,
Nov 28, 2015, 11:58:17 PM11/28/15
to am...@googlegroups.com, yakine...@gmail.com, richar...@gmail.com
Yakine, the natural suggestion is to replace your dangerous singularity
by constraints that should be equivalent:

C4safer{i in N} : F[i]*y[i] == Pmax;

Since Pmax is positive, y[i] cannot be zero, so each y could have a positive lower bound.
(This would also safeguard your original formulation.)

Michael


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

F.YAKINE

unread,
Dec 1, 2015, 3:34:06 PM12/1/15
to Michael Saunders, am...@googlegroups.com, richar...@gmail.com

Hi Michael , 

Thank you very much for your reply.   I will try definitely try C4safe you suggested 

 

Best regards.

 

--

F.YAKINE

Reply all
Reply to author
Forward
0 new messages