Python package · MIT license · local or remote solve

Build models. Find better decisions.

GEKKO turns equations, constraints, data, and time-dependent systems into optimization models you can read in Python. Start with two variables or carry the same modeling ideas into estimation, scheduling, machine learning, and predictive control.

python -m pip install gekko
A constrained optimization landscape Contour lines show an objective surface. A dashed boundary marks a constraint and a cobalt path travels from an initial point to a feasible minimum.
Optimization is a search with rules: define the objective, preserve the constraints, and let the solver move through the feasible space.
Open sourceMIT licensed
Equation basedVariables + constraints
Static + dynamicLP through DAE systems
Python nativeLocal, edge, or server

A complete model in a few lines.

This canonical constrained nonlinear problem shows the GEKKO pattern: create the model, declare bounded variables, add equations and an objective, then solve.

quickstart.py
from gekko import GEKKO

m = GEKKO(remote=False)
x = m.Array(m.Var, 4, value=1, lb=1, ub=5)

m.Equation(x[0] * x[1] * x[2] * x[3] >= 25)
m.Equation(sum(xi**2 for xi in x) == 40)
m.Minimize(x[0] * x[3] * (x[0] + x[1] + x[2]) + x[2])

m.solve(disp=False)
print([xi.value[0] for xi in x])
  1. Install.

    Use pip in a terminal or notebook environment. The package includes options for solving without an Internet connection.

  2. Describe.

    Write the variables, bounds, equations, and objective in the same Python file as the surrounding data workflow.

  3. Solve.

    Choose local or remote execution, inspect solver output, and verify the solution against the original physics and constraints.

One modeling language, several kinds of decisions.

GEKKO combines an object-oriented Python interface with automatic differentiation and large-scale solvers. The same model-building vocabulary extends from a static optimum to a controller running against a dynamic system.

Mathematical programs
Linear, quadratic, nonlinear, and mixed-integer optimization with equality and inequality constraints.
LP · QP · NLP · MILP · MIQP · MINLP
Dynamic systems
Ordinary and differential-algebraic equations transcribed with orthogonal collocation for simulation and optimization over time.
ODE · DAE · sequential · simultaneous
Data + learning
Parameter regression, system identification, splines, neural networks, and data-based models embedded inside constrained optimization.
fit · predict · constrain · optimize
Estimation + control
Data reconciliation, moving horizon estimation, real-time optimization, and linear or nonlinear model predictive control.
MHE · RTO · MPC
Solver access
Interfaces to large-scale continuous and discrete solvers, with solver extensions for additional workflows.
APOPT · IPOPT · BPOPT
Execution
Run on common Python platforms with local, edge, or server-based solution paths selected for the problem and deployment environment.
Windows · macOS · Linux · ARM

Start from the problem you have.

The best entry point depends on whether you are learning optimization, developing a research model, teaching a course, deploying a solution, or collecting reliable context for an agent.

Undergraduate learner

Begin with worked problems that make the objective, variables, and constraints visible before adding dynamic modes or specialized solver options.

Open tutorials ↗

Graduate researcher

Move into parameter estimation, optimal control, mixed-integer dynamics, and research-ready citation and reproducibility practices.

Open GEKKO docs ↗

University instructor

Build assignments around open examples, the Temperature Control Lab, and course sequences for optimization, dynamics, estimation, and control.

Open TCLab exercises ↗

Industrial practitioner

Prototype with readable equations, validate against plant or business constraints, then choose local, edge, or server execution for deployment.

Browse applications ↗

Software agent

Use the compact source map to locate authoritative syntax, modeling modes, examples, support channels, and the canonical citation.

Read llms.txt

Where GEKKO is being used.

A review of the literature citing the GEKKO paper, checked against publisher text, open code, and the curated APMonitor bibliography, shows a tool traveling well beyond its process-control origins.

Citation alone does not prove that a paper executed GEKKO. The representative studies below are selected because the article, abstract, or associated code explicitly identifies GEKKO in the computational method.

Energy systems + buildingsMicrogrids, batteries, grid dispatch, HVAC, ventilation, and thermal storage

Researchers formulate operational schedules, demand response, storage degradation, indoor-air-quality tradeoffs, and predictive building control as constrained linear or nonlinear programs.

View the microgrid study ↗
Industrial process + manufacturingProduction, drilling, separations, reactors, welding, and plant-wide control

Applications combine nonlinear models with estimation, real-time optimization, and predictive control. Published work includes an industrial tailings-reprocessing controller implemented in Python with GEKKO.

View the tailings study ↗
Robotics, aerospace + mobilityRobot paths, UAV missions, platoons, spacecraft, and trajectory optimization

Dynamic optimization expresses motion, collision avoidance, actuator bounds, timing, and endpoint conditions in one constrained model.

View the platoon study ↗
Biology, medicine + public healthTreatment scheduling, drug delivery, epidemiology, and systems biology

GEKKO has been used to solve optimal-control problems for treatment protocols and epidemic policy, and to calibrate dynamic biological models against data.

View the therapy study ↗
Materials + formulationGlass, nuclear waste, polymers, membranes, and property-constrained design

Data-based property models can sit inside constrained formulation problems, including uncertainty-aware machine-learning models for nuclear-waste glass.

View the vitrification study ↗
Water, food + resource systemsLand allocation, nutrition, water use, bioenergy, emissions, and Pareto tradeoffs

Multi-objective models use GEKKO to expose tradeoffs instead of hiding them—optimizing resource allocation while preserving environmental, dietary, and economic constraints.

View the resource-systems study ↗
Computing, networks + financeResource allocation, edge offloading, wireless systems, portfolios, and solver benchmarks

Researchers use GEKKO both as the primary optimizer and as a classical baseline when comparing emerging algorithms for discrete and dynamic decision problems.

View the portfolio study ↗
Teaching + laboratory researchOptimization courses, controls laboratories, take-home hardware, and reproducible benchmarks

GEKKO supports the full learning loop: identify a model from measurements, simulate it, estimate unknowns, design a controller, and test the result against physical hardware.

View the laboratory study ↗

Review the curated publication list ↗

Optimization improves when models travel.

Share a minimal example, explain the physical or operational constraint, and record what solved—or failed. That is how a course exercise becomes a research method and a one-off solution becomes community infrastructure.

Contribute on GitHub ↗

Ask

Search existing questions first. If the answer is missing, post a minimal, complete, verifiable example with the gekko tag.

Open Stack Overflow ↗

Build

Read the source, run the examples, report a reproducible issue, improve documentation, or propose a focused pull request.

Open repository ↗

Teach

Reuse open examples and physical labs, then publish the assignment structure and model so another instructor can adapt it.

Open course materials ↗

Publish

Cite the software paper, link the model or code when possible, and add new applications to the shared record of practice.

Copy the citation

Cite the software behind the result.

If GEKKO contributes to published work, cite the GEKKO Optimization Suite paper and describe the solver, execution mode, model equations, bounds, objective, and stopping or convergence criteria needed to reproduce the solution.

Read the GEKKO paper ↗
gekko.bib
@article{beal2018gekko,
  title   = {GEKKO Optimization Suite},
  author  = {Beal, Logan D. R. and Hill, Daniel C.
             and Martin, R. Abraham and Hedengren, John D.},
  journal = {Processes},
  volume  = {6},
  number  = {8},
  pages   = {106},
  year    = {2018},
  doi     = {10.3390/pr6080106}
}

Find a GEKKO resource