APMonitor / apm_python

APMonitor Optimization Suite in Python
http://apmonitor.com/wiki/index.php/Main/PythonApp
Other
104 stars 41 forks source link

Whether there is a way to write the constrains and object function in a matrix way #2

Open GehenHe opened 6 years ago

GehenHe commented 6 years ago

Hi,is apmonitor support optimize a matrix? For I need to optimize a matrix X , and I don't want to rewrite the constrains for each elements of X, whether there is a way to write the constrains and object function in a matrix way?

APMonitor commented 6 years ago

APMonitor does support matrix multiplication with the axb object but the parameters are constants. I'd recommend the GEKKO package (https://github.com/BYU-PRISM/GEKKO). It is available with pip install gekko. This package allows models to be built directly in Python. More information is available at http://gekko.readthedocs.io/en/latest/

APMonitor commented 6 years ago

APMonitor probably isn't the right solution if you need to solve an optimization problem with complex numbers. The MATLAB solver fmincon may be able to handle complex numbers: https://www.mathworks.com/matlabcentral/answers/265883-fmincon-optimization-for-complex-vectors There may also be clever ways to divide variables into two parts and solve a complex numbered system with real values only.

On Sun, Apr 15, 2018, 7:09 PM DengYuhao notifications@github.com wrote:

Hi,is apmonitor support complex number? I need to optimize a set of vector and obtain complex solves.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/APMonitor/apm_python/issues/2#issuecomment-381453633, or mute the thread https://github.com/notifications/unsubscribe-auth/AMkYA39ZmRK7HmnIgnfl2VLOEZ4wGU7wks5to-9JgaJpZM4S8JYP .