# Change the solvers using loop

**URL:** <https://discuss.ampl.com/t/change-the-solvers-using-loop/512>\
**Category:** Support\
**Tags:** general, solvers\
**Created:** [April 23, 2023, 6:59am UTC](https://discuss.ampl.com/t/change-the-solvers-using-loop/512 "2023-04-23T06:59:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 24, 2023, 5:02pm UTC](https://discuss.ampl.com/t/change-the-solvers-using-loop/512/2 "2023-04-24T17:02:14Z")

</div>

When your specify “option solver i;” AMPL sets option solver to the literal character string “i”. To instead set option solver to the _value_ of index i, use this command:

```auto
option solver (i);

```

The general rules for this situation are given in the subsection on [String expressions in AMPL commands](https://ampl.com/wp-content/uploads/Chapter-13-Command-Scripts-AMPL-Book.pdf#page=19) in Chapter 13 of the [AMPL book](https://ampl.com/learn/ampl-book/).

---

_[View the full topic](https://discuss.ampl.com/t/change-the-solvers-using-loop/512)._
