user3626171
user3626171

Reputation: 23

Is it possible to change the linear solver used within GEKKO?

As the title says, I'm trying to find out what linear solver is used within GEKKO, for solving problems with remote=True and remote=False. I'm also curious if it's possible to change this, as you can in Pyomo. I was unable to find any reference to this within the either the Gekko documentation (https://gekko.readthedocs.io/en/latest/) or the APMonitor documentation (https://apmonitor.com/wiki/).

Is anyone familiar with the internals of Gekko / how I could find this out?

Thank you!

Upvotes: 2

Views: 174

Answers (1)

John Hedengren
John Hedengren

Reputation: 14356

All of the solvers in Gekko are Nonlinear Programming (NLP) or Mixed Integer Nonlinear Programming (MINLP). The Nonlinear Programming solvers use linear solvers to iteratively solve the line-search problem. The public server (remote=True) uses MA57 while the version distributed locally (remote=False) uses a linear solver called MUMPS that can be distributed. However, there are no linear programming solvers to directly solve LPs. The MINLP solver can solve LP, QP, QPQC, MILP, NLP, and MINLP problems. Here is example code to specify MA57 solver in IPOPT.

from gekko import GEKKO
m = GEKKO(remote=True)
m.options.SOLVER=3
m.solver_options = ['linear_solver ma57']

From the documentation:

SOLVER selects the solver to use in an attempt to find a solution. There are free solvers: 1: APOPT, 2: BPOPT, 3: IPOPT distributed with the public version of the software. There are additional solvers that are not included with the public version and require a commercial license. IPOPT is generally the best for problems with large numbers of degrees of freedom or when starting without a good initial guess. APOPT is generally the best when warm-starting from a prior solution or when the number of degrees of freedom (Number of Variables - Number of Equations) is less than 2000. APOPT is also the only solver that handles Mixed Integer problems. Use option 0 to compare all available solvers.

Upvotes: 1

Related Questions