run gekko locally on mac.

146 views
Skip to first unread message

Lifan Guo

unread,
Oct 30, 2018, 6:13:04 AM10/30/18
to apmo...@googlegroups.com
Dear Professor,

I was trying to use Gekko do regression on my data. 
But It sometimes report error like "Results files not found. APM did not find a solution or the server is unreachable."
I understand there is a gekko.exe file which works for windows.
But I wonder if there is a way to run it locally on mac?

BTW,
my regression code is:

tm = new_index[:60]
u1 = data_si['SET41059Z'].values[:60]
u2 = data_si['SET3511SP'].values[:60]
u3 = data_si['Z4126Z01'].values[:60]
u4 = data_si['M41059Z01'].values[:60]
u = data_si[['SET41059Z','SET3511SP','Z4126Z01','M41059Z01']].values[:,:60]
y1 = data_si['S12_B0014'].values[:60]

from gekko import GEKKO
import numpy as np
import matplotlib.pyplot as plt

# GEKKO model
m=GEKKO()

# variables
u = m.CV(value=u)
u.FSTATUS=1
y = m.CV(value=y1)
y.FSTATUS=1

# parameters
tau = [m.FV(value=taui) for taui in np.ones(4)*0.2]
K = [m.FV(value=Ki) for Ki in [3.1,1.2,2.3,2.4]]
x = [m.Var(value=0) for i in range(4)] # 4 differential states

#equation
for i in range(4):
    m.Equation(tau[i]*x[i].dt()==K[i]*u[i])
    
m.Equation(y==sum([x[i] for i in range(4)]))

m.options.imode=2 # regression

# m.time = np.linspace(0,len(y1),len(y1))

m.solve(disp=False)

I wonder if there is some bug within it?

Best

--


John Hedengren

unread,
Oct 31, 2018, 7:24:36 PM10/31/18
to apmo...@googlegroups.com

Lifan,

 

The code looks okay to me. Please post your code to the discussion group if you have a particular error that you can’t resolve.

 

There is a local executable option for Linux and Windows, but not for MacOS. I’ll send something to the group if we do develop a local executable for MacOS. Until then, it is still possible to use the public servers with MacOS.

 

Best regards,

 

John Hedengren

--
--
APMonitor user's group e-mail list.
- To post a message, send email to apmo...@googlegroups.com
- To unsubscribe, send email to apmonitor+...@googlegroups.com
- Visit this group at http://groups.google.com/group/apmonitor
---
You received this message because you are subscribed to the Google Groups "apmonitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apmonitor+...@googlegroups.com.
To post to this group, send email to apmo...@googlegroups.com.
Visit this group at https://groups.google.com/group/apmonitor.
For more options, visit https://groups.google.com/d/optout.

Sarim Asif

unread,
Nov 1, 2018, 4:04:40 PM11/1/18
to apmonitor
Sorry but I was under the impression that Linux doesn't have a local executable yet as it says in the Github readme. Can you provide a link please?

Thanks,
Sarim Asif

John Hedengren

unread,
Nov 5, 2018, 7:57:40 PM11/5/18
to apmo...@googlegroups.com

Dear Sarim,

 

There is the local APMonitor server (https://github.com/APMonitor/apm_server.git) that you can install for Linux:

 

https://apmonitor.com/wiki/index.php/Main/APMonitorServerLinux

 

m = GEKKO(server=’http://127.0.0.1’)

 

However, the setup is complex.

 

We are also in the process of making a Linux executable available in GEKKO (should be out within a couple days). The standalone “apm” program will be available for your GEKKO scripts to use as:

 

m = GEKKO(remote=False)

 

This way, you won’t need to set up the server. One downside of this executable is that it doesn’t come with IPOPT. IPOPT for Linux makes the executable 50 MB with all of the libraries that are required. Instead, the local Linux executable will have APOPT and BPOPT.

 

Best regards,

John Hedengren

Logan Beal

unread,
Nov 15, 2018, 7:39:44 PM11/15/18
to apmo...@googlegroups.com
The latest GEKKO release (version 0.1b2) includes the local Linux executable without IPOPT. 

alidino...@salu.edu.pk

unread,
Feb 4, 2019, 11:06:32 AM2/4/19
to apmonitor
I can't install Gekko on my MacBook with Atom editor. 

John Hedengren

unread,
Feb 5, 2019, 6:44:11 AM2/5/19
to apmo...@googlegroups.com

Dear Alidino,


The choice of text editor shouldn't matter for this case. You don't need to install a Python package with a text editor such as Atom to be able to use it. Please follow these instructions to install GEKKO: 


See installation help:

https://gekko.readthedocs.io/en/latest/


See tutorial 1 on installation.

https://apmonitor.com/wiki/index.php/Main/GekkoPythonOptimization


In your case, you'll need to open a new Terminal window in MacOS. Here is additional help on managing Python packages: http://apmonitor.com/pdc/index.php/Main/InstallPython


Best regards,

John Hedengren



From: apmo...@googlegroups.com <apmo...@googlegroups.com> on behalf of alidino...@salu.edu.pk <alidino...@salu.edu.pk>
Sent: Monday, February 4, 2019 3:02 AM
To: apmonitor
Subject: [APM] Re: run gekko locally on mac.
 

Dr Ali Dino Jumani

unread,
Feb 6, 2019, 4:56:38 PM2/6/19
to apmo...@googlegroups.com
Thanks John, its working by configuring run options.

Warm Regards

Ali Dino Jumani
Reply all
Reply to author
Forward
0 new messages