gekko
Machine learning and optimization for dynamic systems
What it is and what it does
GEKKO is an optimization and machine learning framework that translates mathematical models of dynamic systems into byte-code and solves them using large-scale solvers. It specializes in problems involving differential algebraic equations (DAEs)—systems where variables evolve over time according to differential equations and algebraic constraints. The package supports a wide range of problem formulations: from simple linear and quadratic programs to complex mixed-integer nonlinear problems, as well as control and estimation tasks like model predictive control and moving horizon estimation.
The package works by building a symbolic representation of your problem—defining variables, equations, and objectives—then compiling that representation and passing it to industrial-grade solvers (APOPT and IPOPT) with automatically computed sparse derivatives. It includes data-cleaning utilities and is designed to run on Windows, Linux, macOS, and ARM processors. GEKKO is intended for engineers and researchers solving real-world optimization and control problems, from parameter estimation and regression to real-time optimization and advanced process control.
Use it for:
- Solve differential algebraic equation systems with constraints and optimization objectives over a time horizon
- Build and tune model predictive control (MPC) systems for process automation or robotics
- Perform parameter estimation and data regression on dynamic system models
- Formulate and solve mixed-integer nonlinear programs (MINLP) for scheduling or resource allocation
- Implement moving horizon estimation (MHE) for state estimation in real-time systems
- Conduct sensitivity analysis and optimization of complex engineering systems
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GEKKO is a Python package for optimization and machine learning that specializes in solving dynamic systems described by differential algebraic equations, with support for linear, quadratic, nonlinear, and mixed-integer programming problems.
Yes. GEKKO is actively maintained, has no known vulnerabilities, installs with minimal friction (numpy only), and is licensed permissively. It fills a specialized niche in dynamic optimization and DAE solving that few Python packages address directly. Install if you need to solve differential algebraic equations, implement model predictive control, or tackle mixed-integer nonlinear optimization problems.
Install
gekko on PyPI
pip
pip install gekkouv
uv add gekkopoetry
poetry add gekkoInstalling gekko
Before you install
Low install friction; pure Python wheel with only numpy as a runtime dependency. Active maintenance with recent commits and a stable production release status.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and proprietary projects.
Quickstart
pip install gekko
import gekko
m = gekko.GEKKO()
x = m.Var()
m.Equation(x**2 == 4)
m.solve()
print(x.value)
Verify before relying
- Whether the bundled APOPT and IPOPT solvers are included in the wheel or require separate installation
- Performance characteristics and scalability limits for large-scale DAE systems
- Whether cloud/edge deployment modes require additional configuration or credentials
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 226 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 141,112/month — #11,251 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gekko-1.3.2-py3-none-any.whl
Keywords: differential, deep, learning, solver, equations, optimization, mixed-integer
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
pyomoPyomo is a Python framework for formulating and…
permissive · top 5,000 on PyPI
optlangOptlang formulates and solves linear,…
permissive · top 15,000 on PyPI
MosekMOSEK solves large-scale convex and…
unclear · top 15,000 on PyPI
casadiCasADi is a framework for algorithmic…
copyleft · top 5,000 on PyPI
daqpDAQP is a dual active-set solver for convex…
permissive · top 15,000 on PyPI
qpsolversProvides a unified Python interface to solve…
copyleft · top 5,000 on PyPI
pybammsolverspybammsolvers provides a Python interface to…
unclear · top 15,000 on PyPI
simple-equA library of ready-to-use STEM equations…
permissive · top 15,000 on PyPI
dwave-optimizationFormulates nonlinear optimization models…
permissive · top 15,000 on PyPI
controlImplements core operations for analyzing and…
permissive · top 15,000 on PyPI