optimal solution is found while the constraint is not satisfied

26 views
Skip to first unread message

mahraz amini

unread,
Apr 11, 2018, 3:42:39 PM4/11/18
to AMPL Modeling Language
Hi all

I am trying to solve this simple optimization question including gel functions

function gsl_cdf_ugaussian_Qinv;

var x1 >= 0 ;

minimize obj: (x1^2)-8*x1;

subject to const1: x1-4 <= gsl_cdf_ugaussian_Qinv(1- 0.05);


Then I tried to solve this in AMPL


ampl: model test.mod;

ampl: load amplgsl.dll;

ampl: option solver ipopt;

ampl: solve;


EXIT: Optimal Solution Found.

 

Ipopt 3.12.4: Optimal Solution Found


ampl: display x1;

x1 = 3.99996


subject to const1:

-gsl_cdf_ugaussian_Qinv(0.95) + x1 <= 4;


ampl: display -gsl_cdf_ugaussian_Qinv(0.95) + x1;

-gsl_cdf_ugaussian_Qinv(0.95) + x1 = 5.64481


As it is obvious, the constraint is not satisfied! I wonder why and how I can fix this.


Thanks,


Mahraz

AMPL Google Group

unread,
Apr 11, 2018, 8:11:39 PM4/11/18
to Zeyad Kassem' Via Ampl Modeling Language
Load the extended function library before reading the model that uses the gaussian function:

ampl: load amplgsl.dll;
ampl: model test.mod;

Arguably the other order should also work, or else should cause an error message to appear; this issue has been reported.

--
Robert Fourer
am...@googlegroups.com
{#HS:559356179-4986#}
--
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 https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



AMPL Google Group

unread,
Apr 23, 2018, 5:22:33 PM4/23/18
to Ampl Modeling Language
This issue has been addressed in a new update to the AMPL program. Now the model can be read before amplgsl.dll is loaded, and the results will still be correct.

--
Robert Fourer
am...@googlegroups.com
{#HS:559356179-4986#}
On Thu, Apr 12, 2018 at 12:11 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Load the extended function library before reading the model that uses the gaussian function:

ampl: load amplgsl.dll;
ampl: model test.mod;

Arguably the other order should also work, or else should cause an error message to appear; this issue has been reported.

--
Robert Fourer
am...@googlegroups.com


--
Reply all
Reply to author
Forward
0 new messages