BARON#
BARON is a general nonlinear optimizer capable of solving nonconvex optimization problems to global optimality. Decision variables may be continuous, integer, or a mixture of the two. BARON has been used for applications in the chemical process industries, pharmaceuticals, energy production, engineering design, and asset management.
An experimental version of the driver, BARONMP, supports the extended modeling capabilities of the MP library.
Learn More | Options | BARONMP Options | Changes | Download BARON | Start a BARON Trial Now!
How to use it#
ampl: option solver baron; # change the solver
ampl: option baron_options 'option1=value1 option2=value2'; # specify options
ampl: solve; # solve the problem
How to install using amplpy:
# Install Python API for AMPL:
$ python -m pip install amplpy --upgrade
# Install AMPL & solver modules:
$ python -m amplpy.modules install baron # install Baron
# Activate your license (e.g., free ampl.com/ce or ampl.com/courses licenses):
$ python -m amplpy.modules activate <your-license-uuid>
How to use:
from amplpy import AMPL
ampl = AMPL()
...
ampl.solve(solver="baron", baron_options="option1=value1 option2=value2")
Learn more about what we have to offer to implement and deploy Optimization in Python.
Resources#
Solver options#
Full list of solver options:
More details on solver options: Features guide.
Retrieving solutions#
The outcome of the last optimization is stored in the AMPL parameter solve_result_num
and the relative message in
solve_result
.
display solve_result_num, solve_result;
BARONMP solve result codes can be obtained by running baronmp -!
or ampl: shell "baronmp -!";
:
Solve result table for BaronMP 24.10.10
0- 99 solved: optimal for an optimization problem, feasible for a satisfaction problem
100-199 solved? solution candidate returned but error likely
150 solved? MP solution check failed (option sol:chk:fail)
200-299 infeasible
201 infeasible, IIS found
202 infeasible, IS found, possibly not irreducible
203 infeasible, IIS sought but not found
300-349 unbounded, feasible solution returned
350-399 unbounded, no feasible solution returned
400-449 limit, feasible: stopped, e.g., on iterations or Ctrl-C
400 node limit reached
401 iteration limit reached
402 CPU time limit reached
450-469 limit, problem is either infeasible or unbounded
Disable dual reductions or run IIS finder for definitive answer.
470-499 limit, no solution returned
500-999 failure, no solution returned
500 licensing error
501 numerical difficulties
502 interrupted (Control-C)
503 too little memory
504 terminated by BARON
505 BARON syntax error (should not happen)
506 operation not supported by BARON
507 Interrupted by Control-C
For general information, see MP result codes guide.
Changelog#
- BARON Changelog
- 20241227
- 20240508
- 20240130
- 20230405
- 20230321
- 20220118
- 20220105
- 20211123
- 20211109
- 20210226.1
- 20210226
- 20210111
- 20201022
- 20201005
- 20200921
- 20200905
- 20200820
- 20191216
- 20190908
- 20190713
- 20190711
- 20190322
- 20190320
- 20190116
- 20181116
- 20180928
- 20180925
- 20180823
- 20180813
- 20180508
- 20180307
- 20171013
- 20171011
- 20170812
- 20170628
- 20170511
- 20170401
- 20170321
- 20170121
- 20170116
- 20170112
- 20161207
- 20161001
- 20160927
- 20160921
- 20160920
- 20160729
- 20160531
- 20160407
- 20160316
- 20160129
- 20160122
- 20151205
- 20151125
- 20151120
- 20150929
- 20150911
- 20150826
- 20150729
- 20150630
- 20150605
- 20150529
- 20150424
- 20150416
- 20150319