# Unable to set parameter for GAMS package

**URL:** https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780
**Category:** Optimization (Mathematical)
**Created:** [June 14, 2022, 9:50pm UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780 "2022-06-14T21:50:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![horvetz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/horvetz/32/31993_2.png) [@horvetz](https://discourse.julialang.org/u/horvetz)
#### Post date: [June 14, 2022, 9:50pm UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/1 "2022-06-14T21:50:18Z")

</div>

I am having a problem regarding choosing parameters for the solvers KNITRO or CONOPT through the GAMS package. Here is my model. And here are the solvers options for [KNITRO](https://www.gams.com/latest/docs/S_KNITRO.html) and [CONOPT](https://www.gams.com/latest/docs/S_CONOPT.html).

```julia
using GAMS, JuMP
model = Model(GAMS.Optimizer)
set_optimizer_attribute(model, GAMS.Solver(), "KNITRO")
set_optimizer_attribute(model,"algorithm", 0)
set_optimizer_attribute(model,"maxit", 1e4)
set_optimizer_attribute(model,"feastol", 1e-10)
set_optimizer_attribute(model,"infeastol", 1e-10)

```

or

```julia
model = Model(GAMS.Optimizer)
set_optimizer_attribute(model, GAMS.Solver(), "CONOPT")
set_optimizer_attribute(model,"Tol_Feas_Min", 1E-10)
set_optimizer_attribute(model,"Tol_Feas_Max", 1E-10)

```

Is this the correct way to set the parameters for these solvers? The solver seems not to be able to read what I add as a parameter.

---

<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: [June 14, 2022, 10:20pm UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/2 "2022-06-14T22:20:37Z")

</div>

What’s the error?

cc @renke.kuhlmann

---

<div class="post-metadata">

### Author: ![horvetz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/horvetz/32/31993_2.png) [@horvetz](https://discourse.julialang.org/u/horvetz)
#### Post date: [June 14, 2022, 10:24pm UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/3 "2022-06-14T22:24:21Z")

</div>

There is no error. The solvers just use the default parameters, not the ones that I specified. I am not sure the way I set the parameters is the correct way. I followed the documentation [here](https://juliahub.com/ui/Packages/GAMS/TiMGh/0.3.3).

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [June 15, 2022, 12:44am UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/4 "2022-06-15T00:44:31Z")

</div>

Does setting the solver name change which solver is used? That is, is it just the parameters that are not used? Is it case sensitive? One (random) idea is to give the solver name in lower case: `"knitro"`, not `"KNITRO"`.

---

<div class="post-metadata">

### Author: ![horvetz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/horvetz/32/31993_2.png) [@horvetz](https://discourse.julialang.org/u/horvetz)
#### Post date: [June 15, 2022, 3:03am UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/5 "2022-06-15T03:03:58Z")

</div>

@jd-foster Holy Moses problem solved by changing “KNITRO” to “knitro”. Thank you so much. This was frustrating.

---

<div class="post-metadata">

### Author: ![renke.kuhlmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/renke.kuhlmann/32/15384_2.png) [@renke.kuhlmann](https://discourse.julialang.org/u/renke.kuhlmann)
#### Post date: [June 15, 2022, 6:59am UTC](https://discourse.julialang.org/t/unable-to-set-parameter-for-gams-package/82780/6 "2022-06-15T06:59:02Z")

</div>

Oh gosh… Sorry for this! I’ll make sure this get’s fixed in an upcoming release.
