Skip to content

GEKKO

BYU PRISM Lab

GEKKO is a Python modeling and optimization toolkit for differential algebraic systems, supporting process simulation, parameter estimation, mixed-integer optimization, and nonlinear predictive control.

Catalog updated ·

Overview

GEKKO provides a Python interface to the APMonitor optimization suite for equation-based and data-driven modeling. Its documented focus includes time series and differential algebraic equation systems, with applications in simulation, estimation, and process optimization. It is a modeling toolkit rather than a pretrained predictive model: users define the mathematical relationships and objectives for their own problem.

Models are assembled from constants, parameters, variables, intermediate expressions, equations, and objectives. A symbolic model represents a data point or time instance, while the selected solution mode extends it across observations or a time horizon. The APMonitor backend compiles the model, analyzes its sparse structure, and supplies derivatives to optimization solvers. For differential algebraic systems, orthogonal collocation converts the dynamic problem into algebraic equations. Solution results are written to results.csv and loaded back into GEKKO's Python variables.

Documented workflows include steady-state simulation, parameter updates, real-time optimization, moving horizon estimation, and nonlinear control. Dynamic simulation, estimation, and optimization can use simultaneous or sequential solution approaches. GEKKO also supports linear, quadratic, nonlinear, and mixed-integer programming, allowing discrete decisions and continuous dynamics within the documented problem classes.

Execution can use a remote server, which is the default, or a local CPU through the remote=False option. The README identifies bundled executables for several platforms, but these excerpts do not establish tested compatibility or comparative performance. Models may fail to converge; APMonitor provides an infeasibility report and diagnostic settings to help investigate initialization and inconsistent equations.

Key Features

  • Symbolic model construction using constants, parameters, variables, intermediate expressions, equations, and maximization or minimization objectives.
  • Support for linear, quadratic, nonlinear, and mixed-integer optimization, alongside differential algebraic equations and complementarity-constrained problems.
  • Steady-state and dynamic modes for simulation, parameter estimation, real-time optimization, and nonlinear predictive control.
  • Simultaneous and sequential approaches to dynamic simulation, estimation, and optimization.
  • Backend model compilation, sparse derivative generation through automatic differentiation, and orthogonal collocation for differential algebraic systems.
  • Remote or local execution, with results returned to Python variables and infeasibility reports available for unsuccessful solves.

Use Cases

  • Intended evaluation: formulate a process model with differential and algebraic equations, then compare simulated trajectories with representative process measurements.
  • Intended evaluation: fit uncertain process parameters or assess moving horizon estimation using a measured time series and a user-defined model.
  • Intended evaluation: prototype nonlinear predictive control with process constraints and an explicit operating objective before considering deployment.
  • Intended evaluation: represent discrete operating choices and continuous process variables in a mixed-integer optimization problem.

How to Use

  1. Start with the official documentation and modeling examples. Select a simulation, estimation, or optimization workflow that matches your intended problem.
  2. Consult the repository README for the supplied pip installation instructions and the PyPI listing for package information. Do not treat packaging classifiers as evidence of tested compatibility.
  3. Define your constants, parameters, variables, equations, and objective. For dynamic work, prepare the relevant time horizon and observations according to the documentation; distinguish measured inputs from quantities to estimate.
  4. Choose the appropriate solution mode and execution location. Remote solving is the documented default; remote=False selects local execution. Consider whether your inputs are appropriate for remote processing.
  5. Evaluate a representative example, inspect the values returned to Python, and compare them with your expected behavior. If the solve fails, examine infeasibilities.txt and consult the documented diagnostic and initialization options before expanding the model.

Related resources

BayBE

Open Source

BayBE is a Python toolbox for Bayesian experimental design that recommends parameter configurations from defined search spaces, objectives and measurements, including chemistry-aware and multi-target workflows.

Open sourcePython

Lab Automation · Process Optimization

BoFire

Open Source

BoFire is a Python framework for experimental design and Bayesian optimization, supporting mixed variables, constraints, molecular representations and iterative candidate selection.

Open sourcePython

Lab Automation · Process Optimization

Cantera Skill (K-Dense) provides instructions and a Python helper for homogeneous ignition calculations, with mechanism provenance, conservation diagnostics, and numerical refinement checks.

Open sourcePython

Computational Chemistry · Process Optimization

do-mpc

Open Source

do-mpc is a Python toolbox for nonlinear and robust model predictive control, moving horizon estimation, and simulation, with support for differential algebraic models and uncertainty.

Open sourcePython

Process Control · Digital Twins

Gryffin

Open Source

Gryffin is a Python Bayesian optimization framework for categorical and mixed experimental design spaces, with batch recommendations and physicochemical descriptor support.

Open sourcePython

Lab Automation · Process Optimization

IDAES

Open Source

IDAES is a Python process systems engineering toolkit for simulation-based design, analysis and optimization of advanced energy systems, with solver extensions and separately distributed examples.

Open sourcePython

Process Optimization · Chemical Manufacturing

Related guides

Workflows

Evaluating AI workflows for chemical engineering

Plan evaluations that separate process modelling, reaction optimisation and control. Define inputs, operating limits, time-aware validation and approval gates before considering operational use.

Skills

AI Skills for Chemistry: What They Are and How They Work

Understand chemistry AI Skills as reusable procedure modules: what SKILL.md contains, how hosts load instructions, how Skills differ from MCP and agents, and how to select, combine, and evaluate them without confusing guidance with scientific validation.

Workflows

AI for Computational Chemistry Workflows

Build evidence-aware computational chemistry workflows with AI Skills for structure preparation, phonons, gas-phase ignition, CALPHAD equilibrium, and reactive-MD analysis—while keeping real inputs, execution dependencies, and scientific validation explicit.