# How to use non-linear solvers with JuMP using AmplNLWriter

**URL:** <https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, optimization\
**Created:** [February 7, 2024, 11:07pm UTC](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900 "2024-02-07T23:07:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemma](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Post date:** [February 7, 2024, 11:07pm UTC](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900/1 "2024-02-07T23:07:40Z")

</div>

When I try to solve any models using AmplNLWriter to call the non-linear solvers, and then call `optimize!` solve the problem nothing seems to happen. I use the following code:  
`model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))`  
When I call `optimize!`it returns  
“Bonmin 1.8.8 using Cbc 2.10.5 and Ipopt 3.14.4  
bonmin:”

Am I missing anything?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [February 7, 2024, 11:13pm UTC](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900/2 "2024-02-07T23:13:00Z")

</div>

Do you have a reproducible example of the problem?

```Julia
julia> using JuMP, AmplNLWriter, Bonmin_jll

julia> model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: AmplNLWriter

julia> @variable(model, x >= 0)
x

julia> @objective(model, Min, (x - 1)^2)
x² - 2 x + 1

julia> optimize!(model)
Bonmin 1.8.8 using Cbc 2.10.5 and Ipopt 3.14.4
bonmin: 
Cbc3007W No integer variables - nothing to do

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit https://github.com/coin-or/Ipopt
******************************************************************************

NLP0012I 
              Num Status Obj It time Location
NLP0014I 1 OPT 0 4 0.002398
Cbc3007W No integer variables - nothing to do

 	"Finished"

julia> value(x)
1.0000000000008957

```

---

<div class="post-metadata">

**Author:** ![Lemma](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lemma](https://discourse.julialang.org/u/Lemma)\
**Post date:** [February 8, 2024, 10:09am UTC](https://discourse.julialang.org/t/how-to-use-non-linear-solvers-with-jump-using-amplnlwriter/109900/3 "2024-02-08T10:09:04Z")

</div>

After updating the packages, it is working now.
