Description
Tests support of nonlinear GAMS functions in other formats. Contributor: Renke Kuhlmann
Small Model of Type : GAMS
Category : GAMS Test library
Main file : convert15.gms
$title CONVERT test suite - support of nonlinear functions (CONVERT15,SEQ=844)
$onText
Tests support of nonlinear GAMS functions in other formats.
Contributor: Renke Kuhlmann
$offText
$onEcho > gamsin.gms
Variables
x, y, z, obj;
Positive Variables
xpos, ypos;
Equations
e00, e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12, e13, e14, e15,
e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31,
e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47,
e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63,
e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79,
e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93;
e00.. obj + x + x*y + x**z =e= 2;
e01.. abs(x) =g= 0;
e02.. arccos(x) =g= 0;
e03.. arcsin(x) =g= 0;
e04.. arctan(x) =g= 0;
e05.. arctan2(x+1, y+1) =g= 0;
e06.. beta(x+1, y+1) =g= 0;
e07.. betareg(x+1, y+1, z+1) =g= 0;
e08.. binomial(x+10, 10) =g= 0;
e09.. bool_and(x, y) =g= 0;
e10.. bool_eqv(x, y) =g= 0;
e11.. bool_imp(x, y) =g= 0;
e12.. bool_not(x) =g= 0;
e13.. bool_or(x, y) =g= 0;
e14.. bool_xor(x, y) =g= 0;
e15.. ceil(x) =g= 0;
e16.. centropy(x, y+1) =g= 0;
e17.. centropy(x, y+1, 1) =g= 0;
e18.. cos(x) =g= 0;
e19.. cosh(x) =g= 0;
e20.. cvpower(2, x) =g= 0;
e21.. div(x, y+1) =g= 0;
e22.. div0(x, y) =g= 0;
e23.. edist(x, y) =g= 0;
e24.. entropy(x) =g= 0;
e25.. errorf(x) =g= 0;
e26.. exp(x) =g= 0;
e27.. x + fact(4) =g= 0;
e28.. floor(x) =g= 0;
e29.. frac(x) =g= 0;
e30.. x + gamma(x+1) =g= 0;
e31.. x + gammareg(x, 1) =g= 0;
e32.. x + gday(1) =g= 0;
e33.. x + gdow(1) =g= 0;
e34.. x + ghour(1) =g= 0;
e35.. x + gleap(1) =g= 0;
e36.. x + gmillisec(1) =g= 0;
e37.. x + gminute(1) =g= 0;
e38.. x + gmonth(1) =g= 0;
e39.. x + gsecond(1) =g= 0;
e40.. x + gyear(1) =g= 0;
e41.. ifthen(x = 1, x, y) =g= 0;
e42.. x + jdate(1900, 1, 1) =g= 0;
e43.. x + jtime(0,0,0) =g= 0;
e44.. log(x+1) =g= 0;
e45.. log10(x+1) =g= 0;
e46.. log2(x+1) =g= 0;
e47.. logbeta(x+1, y+1) =g= 0;
e48.. loggamma(x+1) =g= 0;
e49.. x + mapval(1) =g= 0;
e50.. max(x, y, z) =g= 0;
e51.. min(x, y, z) =g= 0;
e52.. mod(xpos + 1, ypos + 1) =g= 0;
e53.. ncpcm(x, y, 1) =g= 0;
e54.. ncpf(x, y) =g= 0;
e55.. ncpf(x, y, 1) =g= 0;
e56.. ncpvupow(x, y) =g= 0;
e57.. ncpvupow(x, y, 1) =g= 0;
e58.. ncpvusin(x, y) =g= 0;
e59.. ncpvusin(x, y, 1) =g= 0;
e60.. x + pi =g= 0;
e61.. poly(x, 1, 2, 3, 4, 5, 6) =g= 0;
e62.. power(x, 3) =g= 0;
e63.. rel_eq(x, y) =g= 0;
e64.. rel_ge(x, y) =g= 0;
e65.. rel_gt(x, y) =g= 0;
e66.. rel_le(x, y) =g= 0;
e67.. rel_lt(x, y) =g= 0;
e68.. rel_ne(x, y) =g= 0;
e69.. round(x) =g= 0;
e70.. rpower(x, y) =g= 0;
e71.. sigmoid(x) =g= 0;
e72.. sign(x) =g= 0;
e73.. signpower(x, 3) =g= 0;
e74.. sin(x) =g= 0;
e75.. sinh(x) =g= 0;
e76.. slexp(x) =g= 0;
e77.. slexp(x, 1) =g= 0;
e78.. sllog10(x) =g= 0;
e79.. sllog10(x, 1) =g= 0;
e80.. slrec(x) =g= 0;
e81.. slrec(x, 1) =g= 0;
e82.. sqexp(x) =g= 0;
e83.. sqexp(x, 1) =g= 0;
e84.. sqlog10(x) =g= 0;
e85.. sqlog10(x, 1) =g= 0;
e86.. sqr(x) =g= 0;
e87.. sqrec(x) =g= 0;
e88.. sqrec(x, 1) =g= 0;
e89.. sqrt(x) =g= 0;
e90.. tan(x) =g= 0;
e91.. tanh(x) =g= 0;
e92.. trunc(x) =g= 0;
e93.. vcpower(x, 3.5) =g= 0;
Model m / all /;
Solve m using DNLP minimizing obj;
$offEcho
$onEcho > convert.opt
ampl
gams
jump
lingo
pyomo
headertimestamp none
$offEcho
$call.checkErrorLevel gams gamsin.gms lo=%GAMS.lo% solver=convert optfile=1
$onEcho > amplwant.mod
# DNLP written by GAMS Convert
#
# Equation counts
# Total E G L N X C B
# 93 0 93 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 5 5 0 0 0 0 0 0
# FX 0
#
# Nonzero counts
# Total const NL
# 128 14 114
#
# Reformulation has removed 1 variable and 1 equation
var x1;
var x2;
var x3;
var x4 >= 0;
var x5 >= 0;
minimize obj: -x1 * x2 - x1 - x1^x3 + 2;
subject to
e1: abs(x1) >= 0;
e2: acos(x1) >= 0;
e3: asin(x1) >= 0;
e4: atan(x1) >= 0;
e5: atan2(1 + x1, 1 + x2) >= 0;
e6: ?beta(1 + x1, 1 + x2) >= 0;
e7: ?betareg(1 + x1, 1 + x2, 1 + x3) >= 0;
e8: ?binomial(10 + x1, 10) >= 0;
e9: x1 and x2 >= 0;
e10: x1 == x2 >= 0;
e11: ?bool_imp(x1, x2) >= 0;
e12: not x1 >= 0;
e13: x1 or x2 >= 0;
e14: ?bool_xor(x1, x2) >= 0;
e15: ceil(x1) >= 0;
e16: x1 * log((x1 + 1e-20) / (1 + x2 + 1e-20)) >= 0;
e17: x1 * log((x1 + 1) / (1 + x2 + 1)) >= 0;
e18: cos(x1) >= 0;
e19: cosh(x1) >= 0;
e20: 2^x1 >= 0;
e21: x1 / (1 + x2) >= 0;
e22: ?div0(x1, x2) >= 0;
e23: sqrt(x2^2 + x1^2) >= 0;
e24: -x1 * log(x1) >= 0;
e25: ?errorf(x1) >= 0;
e26: exp(x1) >= 0;
e27: x1 >= -24;
e28: floor(x1) >= 0;
e29: x1 - trunc(x1) >= 0;
e30: ?gamma(1 + x1) + x1 >= 0;
e31: ?gammareg(x1, 1) + x1 >= 0;
e32: x1 >= -1;
e33: x1 >= -1;
e34: x1 >= 0;
e35: x1 >= 0;
e36: x1 >= 0;
e37: x1 >= 0;
e38: x1 >= -1;
e39: x1 >= 0;
e40: x1 >= -1900;
e41: ?ifthen(x1 == 1, x1, x2) >= 0;
e42: x1 >= -1;
e43: x1 >= 0;
e44: log(1 + x1) >= 0;
e45: log10(1 + x1) >= 0;
e46: log(1 + x1) / log(2) >= 0;
e47: ?logbeta(1 + x1, 1 + x2) >= 0;
e48: ?loggamma(1 + x1) >= 0;
e49: x1 >= 0;
e50: max(x1, x2, x3) >= 0;
e51: min(x1, x2, x3) >= 0;
e52: (1 + x4) mod (1 + x5) >= 0;
e53: x1 - 1 * log(1 + exp((x1 - x2) / 1)) >= 0;
e54: sqrt(x1^2 + x2^2) - x1 - x2 >= 0;
e55: sqrt(x1^2 + x2^2 + 2) - x1 - x2 >= 0;
e56: ?ncpvupow(x1, x2) >= 0;
e57: ?ncpvupow(x1, x2, 1) >= 0;
e58: ?ncpvusin(x1, x2) >= 0;
e59: ?ncpvusin(x1, x2, 1) >= 0;
e60: x1 >= -3.141592653589793;
e61: 1 + 2 * x1 + 3 * x1^2 + 4 * x1^3 + 5 * x1^4 + 6 * x1^5 >= 0;
e62: x1^3 >= 0;
e63: x1 == x2 >= 0;
e64: x1 >= x2 >= 0;
e65: x1 > x2 >= 0;
e66: x1 <= x2 >= 0;
e67: x1 < x2 >= 0;
e68: x1 != x2 >= 0;
e69: round(x1) >= 0;
e70: x1^x2 >= 0;
e71: 1 / (1 + exp(-x1)) >= 0;
e72: x1 / abs(x1) >= 0;
e73: x1 * abs(x1)^(3 - 1) >= 0;
e74: sin(x1) >= 0;
e75: sinh(x1) >= 0;
e76: ?slexp(x1) >= 0;
e77: ?slexp(x1, 1) >= 0;
e78: ?sllog10(x1) >= 0;
e79: ?sllog10(x1, 1) >= 0;
e80: ?slrec(x1) >= 0;
e81: ?slrec(x1, 1) >= 0;
e82: ?sqexp(x1) >= 0;
e83: ?sqexp(x1, 1) >= 0;
e84: ?sqlog10(x1) >= 0;
e85: ?sqlog10(x1, 1) >= 0;
e86: x1^2 >= 0;
e87: ?sqrec(x1) >= 0;
e88: ?sqrec(x1, 1) >= 0;
e89: sqrt(x1) >= 0;
e90: tan(x1) >= 0;
e91: tanh(x1) >= 0;
e92: trunc(x1) >= 0;
e93: x1^3.5 >= 0;
$offEcho
$call.checkErrorLevel =diff -b ampl.mod amplwant.mod
$onEcho > gamswant.gms
* DNLP written by GAMS Convert
*
* Equation counts
* Total E G L N X C B
* 94 1 93 0 0 0 0 0
*
* Variable counts
* x b i s1s s2s sc si
* Total cont binary integer sos1 sos2 scont sint
* 6 6 0 0 0 0 0 0
* FX 0
*
* Nonzero counts
* Total const NL
* 132 15 117
* Solve m using DNLP minimizing x4;
Variables
x1,x2,x3,x4,x5,x6;
Positive Variables
x5,x6;
Equations
e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18,e19,e20,e21,
e22,e23,e24,e25,e26,e27,e28,e29,e30,e31,e32,e33,e34,e35,e36,e37,e38,e39,e40,
e41,e42,e43,e44,e45,e46,e47,e48,e49,e50,e51,e52,e53,e54,e55,e56,e57,e58,e59,
e60,e61,e62,e63,e64,e65,e66,e67,e68,e69,e70,e71,e72,e73,e74,e75,e76,e77,e78,
e79,e80,e81,e82,e83,e84,e85,e86,e87,e88,e89,e90,e91,e92,e93,e94;
e1.. x1 * x2 + x1 + x1**x3 + x4 =E= 2;
e2.. abs(x1) =G= 0;
e3.. arccos(x1) =G= 0;
e4.. arcsin(x1) =G= 0;
e5.. arctan(x1) =G= 0;
e6.. arctan2(1 + x1, 1 + x2) =G= 0;
e7.. beta(1 + x1, 1 + x2) =G= 0;
e8.. betareg(1 + x1, 1 + x2, 1 + x3) =G= 0;
e9.. binomial(10 + x1, 10) =G= 0;
e10.. bool_and(x1, x2) =G= 0;
e11.. bool_eqv(x1, x2) =G= 0;
e12.. bool_imp(x1, x2) =G= 0;
e13.. bool_not(x1) =G= 0;
e14.. bool_or(x1, x2) =G= 0;
e15.. bool_xor(x1, x2) =G= 0;
e16.. ceil(x1) =G= 0;
e17.. centropy(x1, 1 + x2) =G= 0;
e18.. centropy(x1, 1 + x2, 1) =G= 0;
e19.. cos(x1) =G= 0;
e20.. cosh(x1) =G= 0;
e21.. 2**x1 =G= 0;
e22.. div(x1, 1 + x2) =G= 0;
e23.. div0(x1, x2) =G= 0;
e24.. edist(x1, x2) =G= 0;
e25.. entropy(x1) =G= 0;
e26.. errorf(x1) =G= 0;
e27.. exp(x1) =G= 0;
e28.. x1 =G= -24;
e29.. floor(x1) =G= 0;
e30.. frac(x1) =G= 0;
e31.. gamma(1 + x1) + x1 =G= 0;
e32.. gammareg(x1, 1) + x1 =G= 0;
e33.. x1 =G= -1;
e34.. x1 =G= -1;
e35.. x1 =G= 0;
e36.. x1 =G= 0;
e37.. x1 =G= 0;
e38.. x1 =G= 0;
e39.. x1 =G= -1;
e40.. x1 =G= 0;
e41.. x1 =G= -1900;
e42.. ifthen(rel_eq(x1, 1), x1, x2) =G= 0;
e43.. x1 =G= -1;
e44.. x1 =G= 0;
e45.. log(1 + x1) =G= 0;
e46.. log10(1 + x1) =G= 0;
e47.. log2(1 + x1) =G= 0;
e48.. logbeta(1 + x1, 1 + x2) =G= 0;
e49.. loggamma(1 + x1) =G= 0;
e50.. x1 =G= 0;
e51.. max(x1, x2, x3) =G= 0;
e52.. min(x1, x2, x3) =G= 0;
e53.. mod(1 + x5, 1 + x6) =G= 0;
e54.. ncpcm(x1, x2, 1) =G= 0;
e55.. ncpf(x1, x2) =G= 0;
e56.. ncpf(x1, x2, 1) =G= 0;
e57.. ncpvupow(x1, x2) =G= 0;
e58.. ncpvupow(x1, x2, 1) =G= 0;
e59.. ncpvusin(x1, x2) =G= 0;
e60.. ncpvusin(x1, x2, 1) =G= 0;
e61.. x1 =G= -3.141592653589793;
e62.. poly(x1, 1, 2, 3, 4, 5, 6) =G= 0;
e63.. power(x1, 3) =G= 0;
e64.. rel_eq(x1, x2) =G= 0;
e65.. rel_ge(x1, x2) =G= 0;
e66.. rel_gt(x1, x2) =G= 0;
e67.. rel_le(x1, x2) =G= 0;
e68.. rel_lt(x1, x2) =G= 0;
e69.. rel_ne(x1, x2) =G= 0;
e70.. round(x1) =G= 0;
e71.. x1**x2 =G= 0;
e72.. sigmoid(x1) =G= 0;
e73.. sign(x1) =G= 0;
e74.. signpower(x1, 3) =G= 0;
e75.. sin(x1) =G= 0;
e76.. sinh(x1) =G= 0;
e77.. slexp(x1) =G= 0;
e78.. slexp(x1, 1) =G= 0;
e79.. sllog10(x1) =G= 0;
e80.. sllog10(x1, 1) =G= 0;
e81.. slrec(x1) =G= 0;
e82.. slrec(x1, 1) =G= 0;
e83.. sqexp(x1) =G= 0;
e84.. sqexp(x1, 1) =G= 0;
e85.. sqlog10(x1) =G= 0;
e86.. sqlog10(x1, 1) =G= 0;
e87.. sqr(x1) =G= 0;
e88.. sqrec(x1) =G= 0;
e89.. sqrec(x1, 1) =G= 0;
e90.. sqrt(x1) =G= 0;
e91.. tan(x1) =G= 0;
e92.. tanh(x1) =G= 0;
e93.. trunc(x1) =G= 0;
e94.. x1**3.5 =G= 0;
Model m / all /;
m.limrow = 0;
m.limcol = 0;
Solve m using DNLP minimizing x4;
$offEcho
$call.checkErrorLevel =diff -b gams.gms gamswant.gms
$onEcho > jumpwant.jl
# DNLP written by GAMS Convert
#
# Equation counts
# Total E G L N X C B
# 93 0 93 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 5 5 0 0 0 0 0 0
# FX 0
#
# Nonzero counts
# Total const NL
# 128 14 114
#
# Reformulation has removed 1 variable and 1 equation
using JuMP
using MathOptInterface
const MOI = MathOptInterface
model = m = Model()
@variable(m, x1, start=0)
@variable(m, x2, start=0)
@variable(m, x3, start=0)
@variable(m, 0 <= x4, start=0)
@variable(m, 0 <= x5, start=0)
@objective(m, Min, -x1 * x2 - x1 - x1^x3 + 2)
@constraint(m, e1, abs(x1) >= 0)
@constraint(m, e2, acos(x1) >= 0)
@constraint(m, e3, asin(x1) >= 0)
@constraint(m, e4, atan(x1) >= 0)
@constraint(m, e5, atan((1 + x1) / (1 + x2)) >= 0)
@constraint(m, e6, SpecialFunctions.beta(1 + x1, 1 + x2) >= 0)
@constraint(m, e7, ?betareg(1 + x1, 1 + x2, 1 + x3) >= 0)
@constraint(m, e8, binomial(10 + x1, 10) >= 0)
@constraint(m, e9, x1 && x2 >= 0)
@constraint(m, e10, x1 == x2 >= 0)
@constraint(m, e11, ?bool_imp(x1, x2) >= 0)
@constraint(m, e12, ! x1 >= 0)
@constraint(m, e13, x1 || x2 >= 0)
@constraint(m, e14, xor(x1, x2) >= 0)
@constraint(m, e15, ceil(x1) >= 0)
@constraint(m, e16, x1 * log((x1 + 1e-20) / (1 + x2 + 1e-20)) >= 0)
@constraint(m, e17, x1 * log((x1 + 1) / (1 + x2 + 1)) >= 0)
@constraint(m, e18, cos(x1) >= 0)
@constraint(m, e19, cosh(x1) >= 0)
@constraint(m, e20, 2^x1 >= 0)
@constraint(m, e21, x1 / (1 + x2) >= 0)
@constraint(m, e22, ?div0(x1, x2) >= 0)
@constraint(m, e23, sqrt(x2^2 + x1^2) >= 0)
@constraint(m, e24, -x1 * log(x1) >= 0)
@constraint(m, e25, SpecialFunctions.erf(x1) >= 0)
@constraint(m, e26, exp(x1) >= 0)
@constraint(m, e27, x1 >= -24)
@constraint(m, e28, floor(x1) >= 0)
@constraint(m, e29, x1 - floor(x1) >= 0)
@constraint(m, e30, SpecialFunctions.gamma(1 + x1) + x1 >= 0)
@constraint(m, e31, ?gammareg(x1, 1) + x1 >= 0)
@constraint(m, e32, x1 >= -1)
@constraint(m, e33, x1 >= -1)
@constraint(m, e34, x1 >= 0)
@constraint(m, e35, x1 >= 0)
@constraint(m, e36, x1 >= 0)
@constraint(m, e37, x1 >= 0)
@constraint(m, e38, x1 >= -1)
@constraint(m, e39, x1 >= 0)
@constraint(m, e40, x1 >= -1900)
@constraint(m, e41, ?ifthen(x1 == 1, x1, x2) >= 0)
@constraint(m, e42, x1 >= -1)
@constraint(m, e43, x1 >= 0)
@constraint(m, e44, log(1 + x1) >= 0)
@constraint(m, e45, log10(1 + x1) >= 0)
@constraint(m, e46, log2(1 + x1) >= 0)
@constraint(m, e47, SpecialFunctions.logbeta(1 + x1, 1 + x2) >= 0)
@constraint(m, e48, SpecialFunctions.loggamma(1 + x1) >= 0)
@constraint(m, e49, x1 >= 0)
@constraint(m, e50, max(x1, x2, x3) >= 0)
@constraint(m, e51, min(x1, x2, x3) >= 0)
@constraint(m, e52, mod(1 + x4, 1 + x5) >= 0)
@constraint(m, e53, x1 - 1 * log(1 + exp((x1 - x2) / 1)) >= 0)
@constraint(m, e54, sqrt(x1^2 + x2^2) - x1 - x2 >= 0)
@constraint(m, e55, sqrt(x1^2 + x2^2 + 2) - x1 - x2 >= 0)
@constraint(m, e56, ?ncpvupow(x1, x2) >= 0)
@constraint(m, e57, ?ncpvupow(x1, x2, 1) >= 0)
@constraint(m, e58, ?ncpvusin(x1, x2) >= 0)
@constraint(m, e59, ?ncpvusin(x1, x2, 1) >= 0)
@constraint(m, e60, x1 >= -3.141592653589793)
@constraint(m, e61, 1 + 2 * x1 + 3 * x1^2 + 4 * x1^3 + 5 * x1^4 + 6 * x1^5
>= 0)
@constraint(m, e62, x1^3 >= 0)
@constraint(m, e63, x1 == x2 >= 0)
@constraint(m, e64, x1 >= x2 >= 0)
@constraint(m, e65, x1 > x2 >= 0)
@constraint(m, e66, x1 <= x2 >= 0)
@constraint(m, e67, x1 < x2 >= 0)
@constraint(m, e68, x1 != x2 >= 0)
@constraint(m, e69, round(x1) >= 0)
@constraint(m, e70, x1^x2 >= 0)
@constraint(m, e71, 1 / (1 + exp(-x1)) >= 0)
@constraint(m, e72, sign(x1) >= 0)
@constraint(m, e73, x1 * abs(x1)^(3 - 1) >= 0)
@constraint(m, e74, sin(x1) >= 0)
@constraint(m, e75, sinh(x1) >= 0)
@constraint(m, e76, ?slexp(x1) >= 0)
@constraint(m, e77, ?slexp(x1, 1) >= 0)
@constraint(m, e78, ?sllog10(x1) >= 0)
@constraint(m, e79, ?sllog10(x1, 1) >= 0)
@constraint(m, e80, ?slrec(x1) >= 0)
@constraint(m, e81, ?slrec(x1, 1) >= 0)
@constraint(m, e82, ?sqexp(x1) >= 0)
@constraint(m, e83, ?sqexp(x1, 1) >= 0)
@constraint(m, e84, ?sqlog10(x1) >= 0)
@constraint(m, e85, ?sqlog10(x1, 1) >= 0)
@constraint(m, e86, x1^2 >= 0)
@constraint(m, e87, ?sqrec(x1) >= 0)
@constraint(m, e88, ?sqrec(x1, 1) >= 0)
@constraint(m, e89, sqrt(x1) >= 0)
@constraint(m, e90, tan(x1) >= 0)
@constraint(m, e91, tanh(x1) >= 0)
@constraint(m, e92, floor(x1) >= 0)
@constraint(m, e93, x1^3.5 >= 0)
$offEcho
$call.checkErrorLevel =diff -b jump.jl jumpwant.jl
$onEcho > lingowant.lng
! DNLP written by GAMS Convert
!
! Equation counts
! Total E G L N X C B
! 93 0 93 0 0 0 0 0
!
! Variable counts
! x b i s1s s2s sc si
! Total cont binary integer sos1 sos2 scont sint
! 5 5 0 0 0 0 0 0
! FX 0
!
! Nonzero counts
! Total const NL
! 128 14 114
!
! Reformulation has removed 1 variable and 1 equation
! ;
MODEL:
[Obj] MIN = -(x1 * x2) - x1 - x1^x3 + 2;
[e1] @ABS(x1) >= 0;
[e2] @ACOS(x1) >= 0;
[e3] @ASIN(x1) >= 0;
[e4] @ATAN(x1) >= 0;
[e5] @ATAN2(1 + x1, 1 + x2) >= 0;
[e6] ?beta(1 + x1, 1 + x2) >= 0;
[e7] ?betareg(1 + x1, 1 + x2, 1 + x3) >= 0;
[e8] ?binomial(10 + x1, 10) >= 0;
[e9] x1 #AND# x2 >= 0;
[e10] x1 #EQ# x2 >= 0;
[e11] ?bool_imp(x1, x2) >= 0;
[e12] #NOT# x1 >= 0;
[e13] x1 #OR# x2 >= 0;
[e14] ?bool_xor(x1, x2) >= 0;
[e15] ?ceil(x1) >= 0;
[e16] x1 * @LOG((x1 + 1e-20) / (1 + x2 + 1e-20)) >= 0;
[e17] x1 * @LOG((x1 + 1) / (1 + x2 + 1)) >= 0;
[e18] @COS(x1) >= 0;
[e19] @COSH(x1) >= 0;
[e20] 2^x1 >= 0;
[e21] x1 / (1 + x2) >= 0;
[e22] ?div0(x1, x2) >= 0;
[e23] @SQRT(x2^2 + x1^2) >= 0;
[e24] -(x1 * @LOG(x1)) >= 0;
[e25] @PSN(x1) >= 0;
[e26] @EXP(x1) >= 0;
[e27] x1 >= -24;
[e28] @FLOOR(x1) >= 0;
[e29] x1 - @FLOOR(x1) >= 0;
[e30] ?gamma(1 + x1) + x1 >= 0;
[e31] ?gammareg(x1, 1) + x1 >= 0;
[e32] x1 >= -1;
[e33] x1 >= -1;
[e34] x1 >= 0;
[e35] x1 >= 0;
[e36] x1 >= 0;
[e37] x1 >= 0;
[e38] x1 >= -1;
[e39] x1 >= 0;
[e40] x1 >= -1900;
[e41] ?ifthen(x1 #EQ# 1, x1, x2) >= 0;
[e42] x1 >= -1;
[e43] x1 >= 0;
[e44] @LOG(1 + x1) >= 0;
[e45] @LOG10(1 + x1) >= 0;
[e46] @LOG(1 + x1) / @LOG(2) >= 0;
[e47] ?logbeta(1 + x1, 1 + x2) >= 0;
[e48] ?loggamma(1 + x1) >= 0;
[e49] x1 >= 0;
[e50] @SMAX(x1, x2, x3) >= 0;
[e51] @SMIN(x1, x2, x3) >= 0;
[e52] @MOD(1 + x4, 1 + x5) >= 0;
[e53] x1 - 1 * @LOG(1 + @EXP((x1 - x2) / 1)) >= 0;
[e54] @SQRT(@POW(x1, 2) + @POW(x2, 2)) - x1 - x2 >= 0;
[e55] @SQRT(@POW(x1, 2) + @POW(x2, 2) + 2) - x1 - x2 >= 0;
[e56] ?ncpvupow(x1, x2) >= 0;
[e57] ?ncpvupow(x1, x2, 1) >= 0;
[e58] ?ncpvusin(x1, x2) >= 0;
[e59] ?ncpvusin(x1, x2, 1) >= 0;
[e60] x1 >= -3.141592653589793;
[e61] 1 + 2 * x1 + 3 * x1^2 + 4 * x1^3 + 5 * x1^4 + 6 * x1^5 >= 0;
[e62] @POW(x1, 3) >= 0;
[e63] x1 #EQ# x2 >= 0;
[e64] x1 #GE# x2 >= 0;
[e65] x1 #GT# x2 >= 0;
[e66] x1 #LE# x2 >= 0;
[e67] x1 #LT# x2 >= 0;
[e68] x1 #NE# x2 >= 0;
[e69] @ROUND(x1) >= 0;
[e70] x1^x2 >= 0;
[e71] 1 / (1 + @EXP(-x1)) >= 0;
[e72] @SIGN(x1) >= 0;
[e73] @SIGNPOWER(x1, 3) >= 0;
[e74] @SIN(x1) >= 0;
[e75] @SINH(x1) >= 0;
[e76] ?slexp(x1) >= 0;
[e77] ?slexp(x1, 1) >= 0;
[e78] ?sllog10(x1) >= 0;
[e79] ?sllog10(x1, 1) >= 0;
[e80] ?slrec(x1) >= 0;
[e81] ?slrec(x1, 1) >= 0;
[e82] ?sqexp(x1) >= 0;
[e83] ?sqexp(x1, 1) >= 0;
[e84] ?sqlog10(x1) >= 0;
[e85] ?sqlog10(x1, 1) >= 0;
[e86] @SQR(x1) >= 0;
[e87] ?sqrec(x1) >= 0;
[e88] ?sqrec(x1, 1) >= 0;
[e89] @SQRT(x1) >= 0;
[e90] @TAN(x1) >= 0;
[e91] @TANH(x1) >= 0;
[e92] @FLOOR(x1) >= 0;
[e93] x1^3.5 >= 0;
@FREE(x1);
@FREE(x2);
@FREE(x3);
END
$offEcho
$call.checkErrorLevel =diff -b lingo.lng lingowant.lng
$onEcho > pyomowant.py
# DNLP written by GAMS Convert
#
# Equation counts
# Total E G L N X C B
# 93 0 93 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 5 5 0 0 0 0 0 0
# FX 0
#
# Nonzero counts
# Total const NL
# 128 14 114
#
# Reformulation has removed 1 variable and 1 equation
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals, bounds=(None,None), initialize=0)
m.x2 = Var(within=Reals, bounds=(None,None), initialize=0)
m.x3 = Var(within=Reals, bounds=(None,None), initialize=0)
m.x4 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x5 = Var(within=Reals, bounds=(0,None), initialize=0)
m.obj = Objective(sense=minimize, expr= -m.x1 * m.x2 - m.x1 - m.x1**m.x3 + 2)
m.e1 = Constraint(expr= abs(m.x1) >= 0)
m.e2 = Constraint(expr= acos(m.x1) >= 0)
m.e3 = Constraint(expr= asin(m.x1) >= 0)
m.e4 = Constraint(expr= atan(m.x1) >= 0)
m.e5 = Constraint(expr= atan((1 + m.x1) / (1 + m.x2)) >= 0)
m.e6 = Constraint(expr= ?beta(1 + m.x1, 1 + m.x2) >= 0)
m.e7 = Constraint(expr= ?betareg(1 + m.x1, 1 + m.x2, 1 + m.x3) >= 0)
m.e8 = Constraint(expr= ?binomial(10 + m.x1, 10) >= 0)
m.e9 = Constraint(expr= m.x1 and m.x2 >= 0)
m.e10 = Constraint(expr= m.x1 == m.x2 >= 0)
m.e11 = Constraint(expr= ?bool_imp(m.x1, m.x2) >= 0)
m.e12 = Constraint(expr= not m.x1 >= 0)
m.e13 = Constraint(expr= m.x1 or m.x2 >= 0)
m.e14 = Constraint(expr= ?bool_xor(m.x1, m.x2) >= 0)
m.e15 = Constraint(expr= ceil(m.x1) >= 0)
m.e16 = Constraint(expr= m.x1 * log((m.x1 + 1e-20) / (1 + m.x2 + 1e-20)) >= 0)
m.e17 = Constraint(expr= m.x1 * log((m.x1 + 1) / (1 + m.x2 + 1)) >= 0)
m.e18 = Constraint(expr= cos(m.x1) >= 0)
m.e19 = Constraint(expr= cosh(m.x1) >= 0)
m.e20 = Constraint(expr= 2**m.x1 >= 0)
m.e21 = Constraint(expr= m.x1 / (1 + m.x2) >= 0)
m.e22 = Constraint(expr= ?div0(m.x1, m.x2) >= 0)
m.e23 = Constraint(expr= sqrt(m.x2**2 + m.x1**2) >= 0)
m.e24 = Constraint(expr= -m.x1 * log(m.x1) >= 0)
m.e25 = Constraint(expr= ?errorf(m.x1) >= 0)
m.e26 = Constraint(expr= exp(m.x1) >= 0)
m.e27 = Constraint(expr= m.x1 >= -24)
m.e28 = Constraint(expr= floor(m.x1) >= 0)
m.e29 = Constraint(expr= m.x1 - floor(m.x1) >= 0)
m.e30 = Constraint(expr= ?gamma(1 + m.x1) + m.x1 >= 0)
m.e31 = Constraint(expr= ?gammareg(m.x1, 1) + m.x1 >= 0)
m.e32 = Constraint(expr= m.x1 >= -1)
m.e33 = Constraint(expr= m.x1 >= -1)
m.e34 = Constraint(expr= m.x1 >= 0)
m.e35 = Constraint(expr= m.x1 >= 0)
m.e36 = Constraint(expr= m.x1 >= 0)
m.e37 = Constraint(expr= m.x1 >= 0)
m.e38 = Constraint(expr= m.x1 >= -1)
m.e39 = Constraint(expr= m.x1 >= 0)
m.e40 = Constraint(expr= m.x1 >= -1900)
m.e41 = Constraint(expr= Expr_if(m.x1 == 1, m.x1, m.x2) >= 0)
m.e42 = Constraint(expr= m.x1 >= -1)
m.e43 = Constraint(expr= m.x1 >= 0)
m.e44 = Constraint(expr= log(1 + m.x1) >= 0)
m.e45 = Constraint(expr= log10(1 + m.x1) >= 0)
m.e46 = Constraint(expr= log(1 + m.x1) / log(2) >= 0)
m.e47 = Constraint(expr= ?logbeta(1 + m.x1, 1 + m.x2) >= 0)
m.e48 = Constraint(expr= ?loggamma(1 + m.x1) >= 0)
m.e49 = Constraint(expr= m.x1 >= 0)
m.e50 = Constraint(expr= ?max(m.x1, m.x2, m.x3) >= 0)
m.e51 = Constraint(expr= ?min(m.x1, m.x2, m.x3) >= 0)
m.e52 = Constraint(expr= ?mod(1 + m.x4, 1 + m.x5) >= 0)
m.e53 = Constraint(expr= m.x1 - 1 * log(1 + exp((m.x1 - m.x2) / 1)) >= 0)
m.e54 = Constraint(expr= sqrt(m.x1**2 + m.x2**2) - m.x1 - m.x2 >= 0)
m.e55 = Constraint(expr= sqrt(m.x1**2 + m.x2**2 + 2) - m.x1 - m.x2 >= 0)
m.e56 = Constraint(expr= ?ncpvupow(m.x1, m.x2) >= 0)
m.e57 = Constraint(expr= ?ncpvupow(m.x1, m.x2, 1) >= 0)
m.e58 = Constraint(expr= ?ncpvusin(m.x1, m.x2) >= 0)
m.e59 = Constraint(expr= ?ncpvusin(m.x1, m.x2, 1) >= 0)
m.e60 = Constraint(expr= m.x1 >= -3.141592653589793)
m.e61 = Constraint(expr= 1 + 2 * m.x1 + 3 * m.x1**2 + 4 * m.x1**3 + 5 * m.x1**4
+ 6 * m.x1**5 >= 0)
m.e62 = Constraint(expr= m.x1**3 >= 0)
m.e63 = Constraint(expr= m.x1 == m.x2 >= 0)
m.e64 = Constraint(expr= m.x1 >= m.x2 >= 0)
m.e65 = Constraint(expr= m.x1 > m.x2 >= 0)
m.e66 = Constraint(expr= m.x1 <= m.x2 >= 0)
m.e67 = Constraint(expr= m.x1 < m.x2 >= 0)
m.e68 = Constraint(expr= m.x1 != m.x2 >= 0)
m.e69 = Constraint(expr= ?round(m.x1) >= 0)
m.e70 = Constraint(expr= m.x1**m.x2 >= 0)
m.e71 = Constraint(expr= 1 / (1 + exp(-m.x1)) >= 0)
m.e72 = Constraint(expr= m.x1 / abs(m.x1) >= 0)
m.e73 = Constraint(expr= m.x1 * abs(m.x1)**(3 - 1) >= 0)
m.e74 = Constraint(expr= sin(m.x1) >= 0)
m.e75 = Constraint(expr= sinh(m.x1) >= 0)
m.e76 = Constraint(expr= ?slexp(m.x1) >= 0)
m.e77 = Constraint(expr= ?slexp(m.x1, 1) >= 0)
m.e78 = Constraint(expr= ?sllog10(m.x1) >= 0)
m.e79 = Constraint(expr= ?sllog10(m.x1, 1) >= 0)
m.e80 = Constraint(expr= ?slrec(m.x1) >= 0)
m.e81 = Constraint(expr= ?slrec(m.x1, 1) >= 0)
m.e82 = Constraint(expr= ?sqexp(m.x1) >= 0)
m.e83 = Constraint(expr= ?sqexp(m.x1, 1) >= 0)
m.e84 = Constraint(expr= ?sqlog10(m.x1) >= 0)
m.e85 = Constraint(expr= ?sqlog10(m.x1, 1) >= 0)
m.e86 = Constraint(expr= m.x1**2 >= 0)
m.e87 = Constraint(expr= ?sqrec(m.x1) >= 0)
m.e88 = Constraint(expr= ?sqrec(m.x1, 1) >= 0)
m.e89 = Constraint(expr= sqrt(m.x1) >= 0)
m.e90 = Constraint(expr= tan(m.x1) >= 0)
m.e91 = Constraint(expr= tanh(m.x1) >= 0)
m.e92 = Constraint(expr= floor(m.x1) >= 0)
m.e93 = Constraint(expr= m.x1**3.5 >= 0)
$offEcho
$call.checkErrorLevel =diff -b pyomo.py pyomowant.py