Closed MichaelMMeskhi closed 3 years ago
You may get this error if no solution is found. Please try this code:
from gekko import GEKKO
m = GEKKO(remote=False) # create GEKKO model
x = m.Var() # define new variable, default=0
y = m.Var() # define new variable, default=0
m.Equations([3*x+2*y==1, x+2*y==0]) # equations
m.solve(disp=False) # solve
print(x.value,y.value) # print solution
If there is still a problem with the above code then please let me know what is the Operating System (OS) and other machine specifications.
I usually use remote = True
by default, and been solving the same objective but recently need local. Why would local solver not find a solution? Is this possible? I’ll test that out now.
OS: MacOS (dev source) and Windows (target)
You may get this error if no solution is found. Please try this code:
from gekko import GEKKO m = GEKKO(remote=False) # create GEKKO model x = m.Var() # define new variable, default=0 y = m.Var() # define new variable, default=0 m.Equations([3*x+2*y==1, x+2*y==0]) # equations m.solve(disp=False) # solve print(x.value,y.value) # print solution
If there is still a problem with the above code then please let me know what is the Operating System (OS) and other machine specifications.
The code works fine. The program I have is later compiled using pyinstaller
into an exec. Would that be an issue?
Here is some help with pyinstaller
and gekko
: https://stackoverflow.com/questions/66181211/compiling-gekko-with-pyinstaller You need to let pyinstaller
know about the local run directory m.path
.
Hello,
Using
m=model(remote=False)
runs the APOPT solver on my local CPU as I understand. I get an error that no path was found toresults.json
. How to fix this?