938 questions
1
vote
1
answer
113
views
Hard reset gekko model to initial state
I am working on a simulation tool for a certain heat exchange system. I first design the system using a certain routine, and then assess it's off-design performance. For the off-design performance I ...
3
votes
2
answers
144
views
How to solve power flow equations using GEKKO in Python?
I want to solve the AC power flow equations (wiki) using GEKKO in Python. This is a nonlinear system of equations describing conservation of energy on a power grid.
I'm struggling to get GEKKO to ...
3
votes
1
answer
62
views
I want to simulate linear MPC control of a FOPTD model using GEKKO
I'm simulating a first-order plus time delay (FOPTD) process and controlling it with a GEKKO MPC model using identical parameters for both the plant and model (i.e. no model mismatch). However, when a ...
2
votes
1
answer
62
views
Run ARX Simulation with initial condition with GEKKO
I want to do a temperature simulation with ARX models and found Gekko as framework for it.
I was able to run basically the example of apmonitor and give my simulation an initial condition when using ...
3
votes
0
answers
99
views
Python GEKKO MPC IPOPT / MUMPS solver older version is causing the optimization not to converge
Context:
Hello to everybody and to Prof. John Hedengren, I am using the Python Gekko library to use MPC with a heating system of a multi-zone building. The objective is to either minimize a ...
3
votes
1
answer
90
views
Can I use an objective function that uses multiple functions in binary programming in gekko?
I am trying to minimize the L2 norm of the peak flows in a drainage system. I want to use gekko since it can handle integer-binary programming.
In my program, my objective is to minimize the peak ...
3
votes
0
answers
69
views
How to use the cold-start options with GEKKO correctly?
I was testing some options with Gekko for an optimization with MINLP , but I still couldn't figure out how the option COLDSTART = 2 work. Using the variable values from a prior solution as initial ...
3
votes
1
answer
58
views
Python GEKKO - Non-zero Degrees of Freedom due to if2/if3
Currently I am building an economic model in Python GEKKO:
m = GEKKO()
m.time = np.arange(0, 200, 1)
#define the variables
consumption = m.Var()
tax = m.Var()
...
3
votes
1
answer
46
views
Is there any way to make GEKKO create a csv file that's more readable?
The results.csv file is hard to read since the variables, intermediates etc. are shown in a format like "i1000" which probably means "intermediate number 1000". Is there any way to ...
1
vote
2
answers
93
views
Is there any benefit of choosing to formulate constraints in a way or another in GEKKO?
I have an MINLP problem and let's say the continuous variable Q can only be 0 when the binary variable z is 0. Two ways to formulate this would be:
m.Equation(Q*(1-z) == 0) (1)
or
m.Equation(Q < z*...
3
votes
1
answer
55
views
Simulate ARX model with initial values
I'm trying to simulate an ARX model based on this example
import numpy as np
from gekko import GEKKO
import matplotlib.pyplot as plt
na = 2 # Number of A coefficients
nb = 1 # Number of B ...
2
votes
1
answer
50
views
Controlled variable does not follow SP in gekko
I am trying to control a level system (of two tanks) by using gekko. In the trial related in this question, just one of the level is under control. However, my CV does not seem to follow the SP.
Code ...
3
votes
1
answer
54
views
Gekko is hanging when simulating ARX model
Gekko is hanging when simulating an ARX model with different parameter dictionaries.
I tried GEKKO system identification for 2 different systems. One as described on APM's web site and another by ...
4
votes
2
answers
78
views
Optimize with pre-defined variables
I am studying how to solve one problem with pre-defined variables.
For example, variable "x" must be one of the values below.
[2, 5, 6, 13]
But, I don't know how to modify my codes.
The ...
3
votes
1
answer
87
views
GEKKO - python: if conditions
I tried using the python library of Gekko to simulate a solver. I need to use a large number of if conditions, for which I have used the if2 and if3 provided by Gekko. I understand that m.if2 or m.if3 ...