ArticleslgStudy

computer science

Gekko (optimization software)

Gekko (optimization software) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Gekko (optimization software) rather than just read about it. In short: The GEKKO Python package solves large-scale mixed-integer and differential algebraic equations with nonlinear programming solvers (IPOPT, APOPT, BPOPT, SNOPT, MINOS). Modes of operation include machine learning, data reconciliation, real-time optimization, dynamic simulation, and nonlinear model predictive control.

Gekko (optimization software) — main illustration
Gekko (optimization software) — illustration

Key takeaways

  • Gekko (optimization software) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Gekko (optimization software) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Gekko (optimization software) from memory before moving on to harder problems.

Reference excerpt

The GEKKO Python package solves large-scale mixed-integer and differential algebraic equations with nonlinear programming solvers (IPOPT, APOPT, BPOPT, SNOPT, MINOS). Modes of operation include machine learning, data reconciliation, real-time optimization, dynamic simulation, and nonlinear model predictive control. In addition, the package solves Linear programming (LP), Quadratic programming (QP), Quadratically constrained quadratic program (QCQP), Nonlinear programming (NLP), Mixed integer programming (MIP), and Mixed integer linear programming (MILP). GEKKO is available in Python and installed with pip from PyPI of the Python Software Foundation.

GEKKO works on all platforms and with Python 2.7 and 3+. By default, the problem is sent to a public server where the solution is computed and returned to Python. There are Windows, MacOS, Linux, and ARM (Raspberry Pi) processor options to solve without an Internet connection. GEKKO is an extension of the APMonitor Optimization Suite but has integrated the modeling and solution visualization directly within Python. A mathematical model is expressed in terms of variables and equations such as the Hock & Schittkowski Benchmark Problem #71 used to test the performance of nonlinear programming solvers. This particular optimization problem has an objective function minx∈ℝx1x4(x1+x2+x3)+x3 and subject to the inequality constraint x1x2x3x4≥25 and equality constraint x12+x22+x32+x42=40. The four variables must be between a lower bound of 1 and an upper bound of 5. The initial guess values are x1=1,x2=5,x3=5,x4=1. This optimization problem is solved with GEKKO as shown below.

Applications of GEKKO Applications include cogeneration (power and heat), drilling automation, severe slugging control, solar thermal energy production, solid oxide fuel cells, flow assurance, Enhanced oil recovery, Essential oil extraction, and Unmanned Aerial Vehicles (UAVs). There are many other references to APMonitor and GEKKO as a sample of the types of applications that can be solved. GEKKO is developed from the National Science Foundation (NSF) research grant #1547110 and is detailed in a Special Issue collection on combined scheduling and control. Other notable mentions of GEKKO are the listing in the Decision Tree for Optimization Software, added support for APOPT and BPOPT solvers, projects reports of the online Dynamic Optimization course from international participants. GEKKO is a topic in online forums where users are solving optimization and optimal control problems. GEKKO is used for advanced control in the Temperature Control Lab (TCLab) for process control education at 20 universities.

Machine learning

One application of machine learning is to perform regression from training data to build a correlation. In this example, deep learning generates a model from training data that is generated with the function 1−cos⁡(x). An artificial neural network with three layers is used for this example. The first layer is linear, the second layer has a hyperbolic tangent activation function, and the third layer is linear. The program produces parameter weights that minimize the sum of squared errors between the measured data points and the neural network predictions at those points. GEKKO uses gradient-based optimizers to determine the optimal weight values instead of standard methods such as backpropagation. The gradients are determined by automatic differentiation, similar to other popular packages. The problem is solved as a constrained optimization problem and is converged when the solver satisfies Karush–Kuhn–Tucker conditions. Using a gradient-based optimizer allows additional constraints that may be imposed with domain knowledge of the data or system.

The neural network model is tested across the range of training data as well as for extrapolation to demonstrate poor predictions outside of the training data. Predictions outside the training data set are improved with hybrid machine learning that uses fundamental principles (if available) to impose a structure that is valid over a wider range of conditions. In the example above, the hyperbolic tangent activation function (hidden layer 2) could be replaced with a sine or cosine function to improve extrapolation. The final part of the script displays the neural network model, the original function, and the sampled data points used for fitting.

Optimal control

Optimal control is the use of mathematical optimization to obtain a policy that is constrained by differential (dx1dt=u), equality (x1(0)=1), or inequality (−1≤u(t)≤1) equations and minimizes an objective/reward function (minu12∫02x12(t)dt). The basic optimal control is solved with GEKKO by integrating the objective and transcribing the differential equation into algebraic form with orthogonal collocation on finite elements.

See also APMonitor and Python.

References

External links GEKKO Overview with Machine Learning and Optimization GEKKO Documentation GEKKO Source Code GEKKO on PyPI for Python pip install GEKKO is open-source product of National Science Foundation (NSF) research grant 1547110 References to APMonitor and GEKKO in the literature 18 examples of GEKKO: machine learning, optimal control, data regression Gekko Download Statistics

Illustrations

Gekko (optimization software): Artificial Neural Network
Artificial Neural Network
Gekko (optimization software): Optimal control problem benchmark (Luus) with an integral objective, inequality, and differential constraint.
Optimal control problem benchmark (Luus) with an integral objective, inequality, and differential constraint.

Worked examples

Example 1 — a first encounter with Gekko (optimization software)

Start with the simplest possible case. Write down what Gekko (optimization software) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Gekko (optimization software) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Gekko (optimization software) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Gekko (optimization software)

In research
Gekko (optimization software) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Gekko (optimization software) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Gekko (optimization software) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Mathematical optimization software, Numerical programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Gekko (optimization software) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Gekko (optimization software)” →

How to study Gekko (optimization software) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Gekko (optimization software) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Gekko (optimization software) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Gekko (optimization software) in simple terms?

The GEKKO Python package solves large-scale mixed-integer and differential algebraic equations with nonlinear programming solvers (IPOPT, APOPT, BPOPT, SNOPT, MINOS). Modes of operation include machine learning, data reconciliation, real-time optimization, dynamic simulation, and nonlinear model pr…

Why does Gekko (optimization software) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Gekko (optimization software)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Gekko (optimization software).

Tags

  • Mathematical optimization software
  • Numerical programming languages

Keep exploring