# Xpress global solver

**URL:** <https://discuss.ampl.com/t/xpress-global-solver/2001>\
**Category:** Support\
**Created:** [December 9, 2024, 6:06pm UTC](https://discuss.ampl.com/t/xpress-global-solver/2001 "2024-12-09T18:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julkin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/julkin/32/195_2.png) [@Julkin](https://discuss.ampl.com/u/Julkin)\
**Post date:** [December 9, 2024, 6:06pm UTC](https://discuss.ampl.com/t/xpress-global-solver/2001/1 "2024-12-09T18:06:35Z")

</div>

Hello,

I am having problems to use Xpress global solver on MINLP problems. For some reason, when called from AMPL, the nonlinearities of the problem are approximated with piece-wise linear functions before being solved and, thus, I do not obtain the same high quality solutions that I can obtain with other global solvers. Is there any way to force XPRESS to use the global solver without having AMPL reformulating the problem first as a MILP? I have seen in past posts that you were working on this issue, so I wonder whether there is already some way to get it done.

For instance, if I run:

```auto
var x>=0;
minimize objfun: exp(x)+100*cos(x);
option solver xpress;
solve;

```

I get

```auto
XPRESS 9.4.2 (43.01.03): 
------------ WARNINGS ------------
WARNING. 2 case(s) of "PLApprox". One of them:
  An expression of type 'Exp' has been
piecewise-linearly approximated. Set cvt:plapprox:reltol
to control precision (currently 0.010000).

WARNING: "PLApproxDomain"
  Argument domain of a 'Exp'
has been reduced to [0.000000, 13.815511] for numerical reasons
(partially controlled by cvt:plapprox:domain.)

XPRESS 9.4.2 (43.01.03): optimal solution; objective -78.93351152
12 simplex iterations
1 branching nodes
absmipgap=7.89335e-05, relmipgap=1e-06

```

And the obtained solution is 2.97505 with objective value -79.0258, where as the optimal solution is 2.94946 with objective value -79.0643.

Any suggestion or workaround would be much appreciated.

Thanks in advance.  
Best regards,  
Julio.

---

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [December 12, 2024, 10:22pm UTC](https://discuss.ampl.com/t/xpress-global-solver/2001/2 "2024-12-12T22:22:05Z")

</div>

Currently, adding `acc:_all=2` to the` xpress_options` string triggers global optimization and gets a much more accurate result (x = 2.95302, objfun = -79.0635).

We’re still working on a fix that can replace this workaround.

---

<div class="post-metadata">

**Author:** ![Julkin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/julkin/32/195_2.png) [@Julkin](https://discuss.ampl.com/u/Julkin)\
**Post date:** [December 15, 2024, 5:52pm UTC](https://discuss.ampl.com/t/xpress-global-solver/2001/3 "2024-12-15T17:52:55Z")

</div>

Thanks a lot Bob for the answer.  
Best,  
Julio.
