Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/gekko/gekko.py", line 601, in solve
self._write_csv()
File "/usr/local/lib/python2.7/dist-packages/gekko/gk_write_files.py", line 148, in _write_csv
raise Exception('This steady-state IMODE only allows scalar values.')
Exception: This steady-state IMODE only allows scalar values.
Anna,
You need to declare parameter and variable arrays with a single value given to each such as:
#define parameter
priors_p = [m.Param(value=i) for i in priors]
cultu = np.array(references["cultu"])
ref_p = [m.Param(value=i) for i in cultu]
count_p = [m.Param(value=i) for i in counts]
cult_p = [m.Param(value=i) for i in cultures]
#initialize variables
posts_v = [m.Var(value=i) for i in priors]
Even with these changes, there is still a problem with the Equations.
You can see the model that GEKKO produces by opening the text file at print(m.path). This model is compiled into byte-code before giving it to an MINLP solver.
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.
For more options, visit https://groups.google.com/d/optout.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 81, in execfile
builtins.execfile(filename, *where)
File "/sda2/Dropbox/CE_R/CE_min_GEKKO.py", line 76, in <module>
m.solve(disp=True) # Solve
File "/usr/local/lib/python2.7/dist-packages/gekko/gekko.py", line 601, in solve
self._write_csv()
File "/usr/local/lib/python2.7/dist-packages/gekko/gk_write_files.py", line 165, in _write_csv
vp.VALUE = np.ones(length)*vp.VALUE
TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')