## Python Optimization Package

## Main.PythonApp History

Show minor edits - Show changes to output

Changed lines 5-9 from:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. A newer Python interface is the [[Main/GekkoPythonOptimization|GEKKO Optimization Suite]] that is available with:

~~ python pip install ~~gekko

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]).

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]).

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use.

'''Recommended:''' A newer Python interface is the [[Main/GekkoPythonOptimization|GEKKO Optimization Suite]] that is available with:

python pip install gekko

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]). There is also an option to run locally in GEKKO without an [[Main/APMonitorServer|Apache server]] for Linux and Windows. Both APM Python and GEKKO solve optimization problems on public servers by default and this option is available for all platforms (Windows, Linux, MacOS, ARM processors, etc) that run Python.

'''Recommended:''' A newer Python interface is the [[Main/GekkoPythonOptimization|GEKKO Optimization Suite]] that is available with:

python pip install gekko

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]). There is also an option to run locally in GEKKO without an [[Main/APMonitorServer|Apache server]] for Linux and Windows. Both APM Python and GEKKO solve optimization problems on public servers by default and this option is available for all platforms (Windows, Linux, MacOS, ARM processors, etc) that run Python.

Changed line 5 from:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. A newer Python interface is the [[Main/~~GekkoPythonOptimizationGEKKO~~ Optimization Suite]] that is available with:

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. A newer Python interface is the [[Main/GekkoPythonOptimization|GEKKO Optimization Suite]] that is available with:

Changed lines 5-9 from:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use.

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. A newer Python interface is the [[Main/GekkoPythonOptimizationGEKKO Optimization Suite]] that is available with:

python pip install gekko

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]).

python pip install gekko

Instructions below are for working with the original APM Python package that requires an APM model and data files. The advantage of working with GEKKO is that the model equations and data are defined directly within the Python language instead of in separate files (see [[https://gekko.readthedocs.io/en/latest/|documentation]]).

Changed lines 21-29 from:

Another method to obtain APMonitor is to include the following code snippet at the beginning of a Python script. ~~If APMonitor~~ is ~~not available, it will use~~ the ~~pip module to install it~~.

~~try~~:

from ~~APMonitor.apm~~ import ~~*~~

except:

~~# Automatically install APMonitor~~

import pip

pip.main(['install','APMonitor'])

~~ from ~~APMonitor~~.apm import *~~

import pip

pip.main

to:

Another method to obtain APMonitor is to include the following code snippet at the beginning of a Python script. The installation is only required once and then the code can be commented or removed.

(:source lang=python:)

try:

from pip import main as pipmain

except:

from pip._internal import main as pipmain

pipmain(['install','APMonitor'])

# to upgrade: pipmain(['install','--upgrade','APMonitor'])

(:sourceend:)

(:source lang=python:)

try:

from pip import main as pipmain

except:

from pip._internal import main as pipmain

pipmain(['install','APMonitor'])

# to upgrade: pipmain(['install','--upgrade','APMonitor'])

(:sourceend:)

Added lines 88-89:

The [[https://apmonitor.com/do|Dynamic Optimization Course]] is graduate level course taught over 14 weeks to introduce concepts in mathematical modeling, data reconciliation, estimation, and control. There are many other applications and instructional material posted to this freely available course web-site.

Changed line 24 from:

from apm import *

to:

from APMonitor.apm import *

Changed line 29 from:

from apm import *

to:

from APMonitor.apm import *

Changed line 24 from:

from ~~APMonitor~~ import *

to:

from apm import *

Changed line 29 from:

from ~~APMonitor~~ import *

to:

from apm import *

Changed lines 5-6 from:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. Example applications of nonlinear models with differential and algebraic equations are available for download below or from the following GitHub repository.

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use.

(:html:)

<iframe width="560" height="315" src="https://www.youtube.com/embed/WF3iieZfRA0" frameborder="0" allowfullscreen></iframe>

(:htmlend:)

Example applications of nonlinear models with differential and algebraic equations are available for download below or from the following GitHub repository.

(:html:)

<iframe width="560" height="315" src="https://www.youtube.com/embed/WF3iieZfRA0" frameborder="0" allowfullscreen></iframe>

(:htmlend:)

Example applications of nonlinear models with differential and algebraic equations are available for download below or from the following GitHub repository.

Changed lines 39-45 from:

<iframe width="560" height="315" src="https://www.youtube.com/embed/t84YMw8p34w?rel=0" frameborder="0" allowfullscreen></iframe>

(:htmlend:)

* [[Main/PythonFunctions | APM Python Source Code Documentation]]

The development roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]]. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions

to:

The development roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]]. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of some of the example problems are provided below.

Changed line 31 from:

Attach:download.jpg [[Attach:apm_python_v0.7.~~5~~.zip | Download APM Python (version 0.7.~~5~~)]] - Released ~~1 Nov 2016~~

to:

Attach:download.jpg [[Attach:apm_python_v0.7.6.zip | Download APM Python (version 0.7.6)]] - Released 31 Jan 2017

Changed line 31 from:

Attach:download.jpg [[Attach:apm_python_v0.7.~~4~~.zip | Download APM Python (version 0.7.~~4~~)]] - Released ~~5 Aug~~ 2016

to:

Attach:download.jpg [[Attach:apm_python_v0.7.5.zip | Download APM Python (version 0.7.5)]] - Released 1 Nov 2016

Changed lines 15-16 from:

try:

to:

Another method to obtain APMonitor is to include the following code snippet at the beginning of a Python script. If APMonitor is not available, it will use the pip module to install it.

try:

try:

Changed line 19 from:

except:

to:

except:

Changed lines 22-26 from:

pip.main(

# Example

if __name__ == '__main__':

install('APMonitor'

to:

pip.main(['install','APMonitor'])

Deleted line 23:

Added lines 14-27:

(:source lang=python:)

try:

from APMonitor import *

except:

# Automatically install APMonitor

import pip

def install(package):

pip.main(['install', package])

# Example

if __name__ == '__main__':

install('APMonitor')

from APMonitor import *

(:sourceend:)

Changed line 37 from:

{$ ~~s.t.~~ x_1 x_2 x_3 x_4 \ge 25$}

to:

{$ \mathrm{subject\;to} \quad x_1 x_2 x_3 x_4 \ge 25$}

Changed lines 37-43 from:

{$ s.t. x_1 x_2 x_3 x_4 ~~/~~ge 25$}

{$ ~~ ~~x_~~1~~^2 + x_2~~^2 + x_3^2 +~~ x_~~4^2 = 40~~$}

{$~~ 1 \le x_1, x_2, x_3, x_4 \le 5$}~~

{$ x_0 = (1,5,5,1)$}

{$

{$

{$

to:

{$ s.t. x_1 x_2 x_3 x_4 \ge 25$}

{$\quad x_1^2 + x_2^2 + x_3^2 + x_4^2 = 40$}

{$\quad 1 \le x_1, x_2, x_3, x_4 \le 5$}

{$\quad x_0 = (1,5,5,1)$}

{$\quad x_1^2 + x_2^2 + x_3^2 + x_4^2 = 40$}

{$\quad 1 \le x_1, x_2, x_3, x_4 \le 5$}

{$\quad x_0 = (1,5,5,1)$}

Changed lines 35-41 from:

{$ \min ~~\,~~ x_1 x_4 (x_1 + x_2 + x_3) + x_3 $}

to:

{$ \min x_1 x_4 (x_1 + x_2 + x_3) + x_3 $}

{$ s.t. x_1 x_2 x_3 x_4 /ge 25$}

{$ x_1^2 + x_2^2 + x_3^2 + x_4^2 = 40$}

{$ 1 \le x_1, x_2, x_3, x_4 \le 5$}

{$ x_0 = (1,5,5,1)$}

{$ s.t. x_1 x_2 x_3 x_4 /ge 25$}

{$ x_1^2 + x_2^2 + x_3^2 + x_4^2 = 40$}

{$ 1 \le x_1, x_2, x_3, x_4 \le 5$}

{$ x_0 = (1,5,5,1)$}

Changed line 35 from:

{$ ~~/~~min ~~/~~, x_1 x_4 ~~\left~~(x_1 + x_2 + x_3~~ \right~~) + x_3 $}

to:

{$ \min \, x_1 x_4 (x_1 + x_2 + x_3) + x_3 $}

Changed lines 35-36 from:

to:

{$ /min /, x_1 x_4 \left(x_1 + x_2 + x_3 \right) + x_3 $}

Added lines 10-13:

The APMonitor package is also available through the package manager '''pip''' in Python.

python pip install APMonitor

Changed line 17 from:

Attach:download.jpg [[Attach:apm_python_v0.7.~~3~~.zip | Download APM Python (version 0.7.~~3~~)]] - Released ~~18 Jun~~ 2016

to:

Attach:download.jpg [[Attach:apm_python_v0.7.4.zip | Download APM Python (version 0.7.4)]] - Released 5 Aug 2016

Changed line 17 from:

Attach:download.jpg [[Attach:apm_python_v0.7.~~2~~.zip | Download APM Python (version 0.7.~~2~~)]] - Released ~~19 Feb~~ 2016

to:

Attach:download.jpg [[Attach:apm_python_v0.7.3.zip | Download APM Python (version 0.7.3)]] - Released 18 Jun 2016

Changed lines 15-17 from:

The latest APM Python libraries are attached below. Functionality has been tested with ~~[[https://www~~.~~python~~.~~org/getit/releases/2~~.~~7/ | Python 2.7]]. Example applications that use the apm.py library are listed further down on this ~~page.

Attach:download.jpg [[Attach:apm_python_v0.7.~~1~~.zip | Download APM Python (version 0.7.~~1~~)]] - Released ~~29 Apr 2015~~

Attach:download.jpg [[Attach:apm_python_v0.7.

to:

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and 3.5. Example applications that use the apm.py library are listed further down on this page.

Attach:download.jpg [[Attach:apm_python_v0.7.2.zip | Download APM Python (version 0.7.2)]] - Released 19 Feb 2016

Attach:download.jpg [[Attach:apm_python_v0.7.2.zip | Download APM Python (version 0.7.2)]] - Released 19 Feb 2016

Changed lines 5-8 from:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use.

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use. Example applications of nonlinear models with differential and algebraic equations are available for download below or from the following GitHub repository.

Attach:download.jpg [[https://github.com/APMonitor?tab=repositories | APM Python with Demo Applications on GitHub]]

Attach:download.jpg [[https://github.com/APMonitor?tab=repositories | APM Python with Demo Applications on GitHub]]

Added line 58:

* %list list-blogroll% [[https://github.com/jckantor/CBE40455/blob/master/notebooks/Getting%20Started%20with%20APMonitor.ipynb | APM IPython Notebook Example on GitHub]]

Changed line 1 from:

(:title ~~Nonlinear~~ Optimization ~~with Python~~:)

to:

(:title Python Optimization Package:)

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.7.~~0~~.zip | Download APM Python (version 0.7.~~0~~)]] - Released ~~30 Jan~~ 2015

to:

Attach:download.jpg [[Attach:apm_python_v0.7.1.zip | Download APM Python (version 0.7.1)]] - Released 29 Apr 2015

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.~~6~~.~~1~~.zip | Download APM Python (version 0.~~6~~.~~1~~)]] - Released ~~5 May 2014~~

to:

Attach:download.jpg [[Attach:apm_python_v0.7.0.zip | Download APM Python (version 0.7.0)]] - Released 30 Jan 2015

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.6.~~0~~.zip | Download APM Python (version 0.6.~~0~~)]] - Released ~~20 January~~ 2014

to:

Attach:download.jpg [[Attach:apm_python_v0.6.1.zip | Download APM Python (version 0.6.1)]] - Released 5 May 2014

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.~~5~~.~~8d~~.zip | Download APM Python (version 0.~~5~~.~~8d~~)]] - Released ~~25 March 2013~~

to:

Attach:download.jpg [[Attach:apm_python_v0.6.0.zip | Download APM Python (version 0.6.0)]] - Released 20 January 2014

Changed line 30 from:

[[https://apmonitor.com/online/view_pass.php?f=hs071.apm|Solve this problem~~]] problem ~~from a web-browser interface.

to:

* [[https://apmonitor.com/online/view_pass.php?f=hs071.apm|Solve this optimization problem from a web-browser interface]] or download the Python source above. The Python files are contained in folder ''example_hs71''.

Changed line 30 from:

to:

[[https://apmonitor.com/online/view_pass.php?f=hs071.apm|Solve this problem]] problem from a web-browser interface.

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.~~8~~.zip | Download APM Python (version 0.5.~~8~~)]] - Released ~~7 January~~ 2013

to:

Attach:download.jpg [[Attach:apm_python_v0.5.8d.zip | Download APM Python (version 0.5.8d)]] - Released 25 March 2013

Added lines 20-21:

* [[Main/PythonFunctions | APM Python Source Code Documentation]]

Added lines 16-19:

(:html:)

<iframe width="560" height="315" src="https://www.youtube.com/embed/t84YMw8p34w?rel=0" frameborder="0" allowfullscreen></iframe>

(:htmlend:)

Changed lines 7-8 from:

Attach:apm_python.png Python ~~offers a powerful scripting capabilities for solving nonlinear optimization problems. The optimization problem is sent to the APMonitor server and results are returned to the Python script. A web-interface to the solution helps to visualize the dynamic optimization problems. Example applications of nonlinear models with differential~~ and ~~algebraic equations are available for download below~~.

to:

Attach:apm_python.png APM Python is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multiobjective optimization can be solved. The platform can find optimal solutions, perform tradeoff analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is free for academic and commercial use.

Changed line 56 from:

----

to:

----

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.8.zip | Download APM Python (version 0.5.8)]] - Released ~~1~~ January 2013

to:

Attach:download.jpg [[Attach:apm_python_v0.5.8.zip | Download APM Python (version 0.5.8)]] - Released 7 January 2013

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.~~7~~.zip | Download APM Python (version 0.5.~~7~~)]] - Released ~~7 March 2012~~

to:

Attach:download.jpg [[Attach:apm_python_v0.5.8.zip | Download APM Python (version 0.5.8)]] - Released 1 January 2013

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.~~6~~.zip | Download APM Python (version 0.5.~~6~~)]] - Released 7 March 2012

to:

Attach:download.jpg [[Attach:apm_python_v0.5.7.zip | Download APM Python (version 0.5.7)]] - Released 7 March 2012

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.6.zip | Download APM Python (version 0.5.6)]] - Released ~~15 Feb~~ 2012

to:

Attach:download.jpg [[Attach:apm_python_v0.5.6.zip | Download APM Python (version 0.5.6)]] - Released 7 March 2012

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.~~5~~.zip | Download APM Python (version 0.5.~~5~~)]] - Released ~~5 Dec 2011~~

to:

Attach:download.jpg [[Attach:apm_python_v0.5.6.zip | Download APM Python (version 0.5.6)]] - Released 15 Feb 2012

Changed lines 3-5 from:

(:description ~~Use APMonitor with the power of Python scripting~~ language:)

!!~~Python for APMonitor~~

!!

to:

(:description APM Python: A comprehensive modeling and nonlinear optimization solution with Python scripting language:)

!! APM Python

!! APM Python

Changed line 15 from:

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | APM Python (version 0.5.5) Released 5 Dec ~~2011]]~~

to:

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | Download APM Python (version 0.5.5)]] - Released 5 Dec 2011

Changed line 13 from:

The latest APM Python libraries are attached below. Functionality has been tested with ~~Python 2~~.7 ~~and requires only the base [[https://www~~.~~python.org/getit/releases/2.~~7~~/ | Python installation~~]]. Example applications that use the apm.py library are listed further down on this page.

to:

The latest APM Python libraries are attached below. Functionality has been tested with [[https://www.python.org/getit/releases/2.7/ | Python 2.7]]. Example applications that use the apm.py library are listed further down on this page.

Changed line 17 from:

The development roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]]~~ section~~. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of the example problems are provided below.

to:

The development roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]]. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of the example problems are provided below.

Changed line 17 from:

The ~~product~~ roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of the example problems are provided below.

to:

The development roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of the example problems are provided below.

Added line 53:

* %list list-blogroll% [[Apps/DistillationColumn | Distillation Column]]

Changed lines 21-22 from:

!!! ~~Folder example~~_hs071: Nonlinear Programming with Python

to:

!!! Example_hs071: Nonlinear Programming with Python

Changed lines 28-29 from:

!!! ~~Folder example~~_nlc: Nonlinear Control with Python

to:

!!! Example_nlc: Nonlinear Control with Python

Changed line 34 from:

!!! ~~Folder example~~_tank_mhe/nlc: Nonlinear Estimation and Control with Python

to:

!!! Example_tank_mhe/nlc: Nonlinear Estimation and Control with Python

Changed line 34 from:

!!! Folder example_tank_mhe: Nonlinear Estimation and Control with Python

to:

!!! Folder example_tank_mhe/nlc: Nonlinear Estimation and Control with Python

Changed lines 11-12 from:

!!! Download APM Python ~~Libraries~~

to:

!!! Download APM Python Library and Example Problems

Changed lines 17-28 from:

The ~~zipped archives contain a single script file '''apm.py'''. To use ~~the ~~APM Python library, include the following at the top of a~~ Python ~~script:~~

'''~~from ~~apm ~~import *'''~~

Previous versions of ~~the APM Python libraries are available below in~~ the ~~prior versions section. In general, it is best to use the most current version as it supports the most advanced server features. The product roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section.~~

''Prior Versions''

* [[Attach:apm_python_v0.5.4.zip | APM Python (version 0.5.4) Released 15 Sept 2011]]

Example applications of the APM Python library include nonlinear programming, nonlinear control, and other applications below.

Previous versions

''Prior Versions''

* [[Attach:apm_python_v0.5.4.zip | APM Python (version 0.5.4) Released 15 Sept 2011]]

Example applications of the APM Python library include nonlinear programming, nonlinear control, and other applications

to:

The product roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section. The zipped archive contains the APM Python library '''apm.py''' and a number of example problems in separate folders. Descriptions of the example problems are provided below.

Changed lines 21-24 from:

!!! ~~Nonlinear Programming with~~ Python

Attach:download.jpg [[Attach:python_hs71.zip | APM Python for Nonlinear Optimization]]

Attach:download.jpg [[Attach:python_hs71.zip | APM Python for Nonlinear Optimization]]

to:

!!! Folder example_hs071: Nonlinear Programming with Python

Changed lines 28-31 from:

!!! ~~Nonlinear Control with~~ Python

Attach:download.jpg [[Attach:python_nlc.zip | APM Python Example for Nonlinear Control]]

Attach:download.jpg [[Attach:python_nlc.zip | APM Python Example for Nonlinear Control]]

to:

!!! Folder example_nlc: Nonlinear Control with Python

Changed lines 34-35 from:

!!! Nonlinear Estimation and Control with Python

to:

!!! Folder example_tank_mhe: Nonlinear Estimation and Control with Python

Changed lines 40-43 from:

The the unknown parameters ''c1'' and ''c2'' need to be determined. The parameter ''c1'' is the flow into the tank when the valve is fully open. The parameter ''c2'' is the relationship between the volume of water in the tank and the outlet flow. ~~Notice that this model is nonlinear because the outlet flow depends on the square root of the liquid ~~volume. Nonlinear estimation is a technique to determine parameters based on the measurements. The ~~following Python script~~ uses the process data and the nonlinear model to determine the optimal parameters ''c1'' and ''c2''.

Attach:download.jpg [[Attach:python_tank_mhe.zip | Nonlinear Estimation of a Gravity Drained Tank]]

Attach:download.jpg [[Attach:python_tank_mhe.zip | Nonlinear Estimation of a Gravity Drained Tank]]

to:

The the unknown parameters ''c1'' and ''c2'' need to be determined. The parameter ''c1'' is the flow into the tank when the valve is fully open. The parameter ''c2'' is the relationship between the volume of water in the tank and the outlet flow. This model is nonlinear because the outlet flow depends on the square root of the liquid volume. Nonlinear estimation is a technique to determine parameters based on the measurements. The script in '''example_tank_mhe''' uses the process data and the nonlinear model to determine the optimal parameters ''c1'' and ''c2''.

Changed lines 44-46 from:

After an accurate model of the process is obtained, the model can be used in a Nonlinear Control (NLC) application. A PID controller is compared to the NLC response in the ~~following script~~.

Attach:download.jpg [[Attach:python_tank_nlc.zip | Nonlinear Control of a Gravity Drained Tank]]

Attach:download.jpg [[Attach:python_tank_nlc.zip | Nonlinear Control of a Gravity Drained Tank]]

to:

After an accurate model of the process is obtained, the model can be used in a Nonlinear Control (NLC) application. A PID controller is compared to the NLC response in the folder '''example_tank_nlc'''.

Changed line 13 from:

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and requires only the base [[https://www.python.org/getit/releases/2.7/ | Python installation]].

to:

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and requires only the base [[https://www.python.org/getit/releases/2.7/ | Python installation]]. Example applications that use the apm.py library are listed further down on this page.

Added lines 26-27:

Example applications of the APM Python library include nonlinear programming, nonlinear control, and other applications below.

Changed lines 21-23 from:

Previous versions of the APM Python libraries are available below~~. In general, it is best to use the most current version as it supports the most advanced server features. The product roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]]~~ section.

to:

Previous versions of the APM Python libraries are available below in the prior versions section. In general, it is best to use the most current version as it supports the most advanced server features. The product roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section.

''Prior Versions''

''Prior Versions''

Changed line 19 from:

'''from apm import *~~'~~'''

to:

'''from apm import *'''

Changed lines 15-16 from:

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | APM Python ~~- v.~~0.5.5 ~~-~~ 5 Dec 2011]]

to:

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | APM Python (version 0.5.5) Released 5 Dec 2011]]

Changed line 23 from:

* [[Attach:apm_python_v0.5.4.zip | APM Python ~~- v.~~0.5.4 ~~-~~ 15 Sept 2011]]

to:

* [[Attach:apm_python_v0.5.4.zip | APM Python (version 0.5.4) Released 15 Sept 2011]]

Changed lines 29-30 from:

Attach:download.jpg [[Attach:python_hs71.zip |~~ Download~~ APM Python for Nonlinear Optimization]]

to:

Attach:download.jpg [[Attach:python_hs71.zip | APM Python for Nonlinear Optimization]]

Changed line 38 from:

Attach:download.jpg [[Attach:python_nlc.zip | ~~Download ~~APM Python ~~Package~~ for Nonlinear Control]]

to:

Attach:download.jpg [[Attach:python_nlc.zip | APM Python Example for Nonlinear Control]]

Changed lines 21-23 from:

Previous versions of the APM Python libraries are available below. In general, it is best to use the most current version as it supports the most advanced server features.

Attach:download.jpg [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

Attach:download.jpg

to:

Previous versions of the APM Python libraries are available below. In general, it is best to use the most current version as it supports the most advanced server features. The product roadmap for this and other libraries are detailed in the [[Main/ProductRoadmap | release notes]] section.

* [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

* [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

Changed lines 13-14 from:

The latest APM Python libraries are attached below.

to:

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and requires only the base [[https://www.python.org/getit/releases/2.7/ | Python installation]].

Changed lines 16-17 from:

to:

Added lines 20-23:

Previous versions of the APM Python libraries are available below. In general, it is best to use the most current version as it supports the most advanced server features.

Attach:download.jpg [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

Changed lines 11-14 from:

!!! Download APM Python Libraries ~~Versions~~

* [[Attach:apm_python_v0.5.5.zip | APM Python - v.~~0~~.~~5.5 - Released ~~5 ~~Dec 2011]]~~

* [[Attach:apm_python_v0.5.4.zip | APM Python -v.0.5.~~4~~ - ~~Released 15 Sept ~~2011]]

* [[Attach:apm_python_v0.5.5.zip | APM Python - v

* [[Attach:apm_python_v0.5.4.zip | APM Python -

to:

!!! Download APM Python Libraries

The latest APM Python libraries are attached below.

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | APM Python - v.0.5.5 - 5 Dec 2011]]

Attach:download.jpg [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

The zipped archives contain a single script file '''apm.py'''. To use the APM Python library, include the following at the top of a Python script:

'''from apm import *''''

The latest APM Python libraries are attached below.

Attach:download.jpg [[Attach:apm_python_v0.5.5.zip | APM Python - v.0.5.5 - 5 Dec 2011]]

Attach:download.jpg [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - 15 Sept 2011]]

The zipped archives contain a single script file '''apm.py'''. To use the APM Python library, include the following at the top of a Python script:

'''from apm import *''''

Added lines 11-17:

!!! Download APM Python Libraries Versions

* [[Attach:apm_python_v0.5.5.zip | APM Python - v.0.5.5 - Released 5 Dec 2011]]

* [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - Released 15 Sept 2011]]

----

* [[Attach:apm_python_v0.5.5.zip | APM Python - v.0.5.5 - Released 5 Dec 2011]]

* [[Attach:apm_python_v0.5.4.zip | APM Python - v.0.5.4 - Released 15 Sept 2011]]

----

Changed line 20 from:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python~~ Package~~ for Nonlinear Optimization]]

to:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python for Nonlinear Optimization]]

Changed line 7 from:

Python offers a powerful scripting capabilities for solving nonlinear optimization problems. The optimization problem is sent to the APMonitor server and results are returned to the Python script. A web-interface to the solution helps to visualize the dynamic optimization problems. Example applications of nonlinear models with differential and algebraic equations are available for download below.

to:

Attach:apm_python.png Python offers a powerful scripting capabilities for solving nonlinear optimization problems. The optimization problem is sent to the APMonitor server and results are returned to the Python script. A web-interface to the solution helps to visualize the dynamic optimization problems. Example applications of nonlinear models with differential and algebraic equations are available for download below.

Changed line 51 from:

to:

* %list list-blogroll% [[Apps/StirredReactor | Stirred Reactor]]

Changed lines 46-53 from:

----

to:

----

!!! Other Applications with Python

* %list list-blogroll% [[Apps/DiabeticGlucose | Diabetic Blood Glucose Control]]

----

!!! Other Applications with Python

* %list list-blogroll% [[Apps/DiabeticGlucose | Diabetic Blood Glucose Control]]

----

Changed lines 36-37 from:

Attach:download.jpg [[Attach:python_tank_mhe.zip |~~ Download APM Python Package for~~ Nonlinear Estimation of a Gravity Drained Tank]]

to:

Attach:download.jpg [[Attach:python_tank_mhe.zip | Nonlinear Estimation of a Gravity Drained Tank]]

Changed line 42 from:

Attach:download.jpg [[Attach:python_tank_nlc.zip |~~ Download APM Python Package for~~ Nonlinear Control of a Gravity Drained Tank]]

to:

Attach:download.jpg [[Attach:python_tank_nlc.zip | Nonlinear Control of a Gravity Drained Tank]]

Added lines 25-44:

----

!!! Nonlinear Estimation and Control with Python

In this case study, a gravity drained tank was operated to generate data. A dynamic model of the process was derived from a material balance. This material balance is displayed below, along with a diagram of the system.

Attach:python_tank.png

The the unknown parameters ''c1'' and ''c2'' need to be determined. The parameter ''c1'' is the flow into the tank when the valve is fully open. The parameter ''c2'' is the relationship between the volume of water in the tank and the outlet flow. Notice that this model is nonlinear because the outlet flow depends on the square root of the liquid volume. Nonlinear estimation is a technique to determine parameters based on the measurements. The following Python script uses the process data and the nonlinear model to determine the optimal parameters ''c1'' and ''c2''.

Attach:download.jpg [[Attach:python_tank_mhe.zip | Download APM Python Package for Nonlinear Estimation of a Gravity Drained Tank]]

Attach:python_tank_mhe.png

After an accurate model of the process is obtained, the model can be used in a Nonlinear Control (NLC) application. A PID controller is compared to the NLC response in the following script.

Attach:download.jpg [[Attach:python_tank_nlc.zip | Download APM Python Package for Nonlinear Control of a Gravity Drained Tank]]

Attach:python_tank_nlc.png

Changed lines 11-12 from:

!!! ~~Example #1: Hock-Schittkowsky Test Suite #71 with the IPOPT Solver~~

to:

!!! Nonlinear Programming with Python

Changed lines 16-17 from:

to:

Hock-Schittkowsky Test Suite #71

Changed line 20 from:

!!!~~ Example #2:~~ Nonlinear Control with Python

to:

!!! Nonlinear Control with Python

Changed line 1 from:

(:title ~~Python Interface to APMonitor~~:)

to:

(:title Nonlinear Optimization with Python:)

Changed lines 13-14 from:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python ~~Source~~ for Nonlinear Optimization]]

to:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python Package for Nonlinear Optimization]]

Changed lines 21-23 from:

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python ~~Source~~ for Nonlinear Control]]

to:

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python Package for Nonlinear Control]]

Attach:python_nlc.png

Attach:python_nlc.png

Changed line 19 from:

!!! Example #2: Nonlinear Control with ~~Python with the APOPT solver~~

to:

!!! Example #2: Nonlinear Control with Python

Changed lines 13-14 from:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python ~~Interface ~~Source for ~~HS71~~]]

to:

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python Source for Nonlinear Optimization]]

Changed line 21 from:

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python~~ Interface~~ Source for Nonlinear Control]]

to:

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python Source for Nonlinear Control]]

Added lines 1-23:

(:title Python Interface to APMonitor:)

(:keywords nonlinear, Python, model, predictive control, APMonitor, differential, algebraic, modeling language:)

(:description Use APMonitor with the power of Python scripting language:)

!! Python for APMonitor

Python offers a powerful scripting capabilities for solving nonlinear optimization problems. The optimization problem is sent to the APMonitor server and results are returned to the Python script. A web-interface to the solution helps to visualize the dynamic optimization problems. Example applications of nonlinear models with differential and algebraic equations are available for download below.

----

!!! Example #1: Hock-Schittkowsky Test Suite #71 with the IPOPT Solver

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python Interface Source for HS71]]

Attach:hs71.gif

----

!!! Example #2: Nonlinear Control with Python with the APOPT solver

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python Interface Source for Nonlinear Control]]

----

(:keywords nonlinear, Python, model, predictive control, APMonitor, differential, algebraic, modeling language:)

(:description Use APMonitor with the power of Python scripting language:)

!! Python for APMonitor

Python offers a powerful scripting capabilities for solving nonlinear optimization problems. The optimization problem is sent to the APMonitor server and results are returned to the Python script. A web-interface to the solution helps to visualize the dynamic optimization problems. Example applications of nonlinear models with differential and algebraic equations are available for download below.

----

!!! Example #1: Hock-Schittkowsky Test Suite #71 with the IPOPT Solver

Attach:download.jpg [[Attach:python_hs71.zip | Download APM Python Interface Source for HS71]]

Attach:hs71.gif

----

!!! Example #2: Nonlinear Control with Python with the APOPT solver

Attach:download.jpg [[Attach:python_nlc.zip | Download APM Python Interface Source for Nonlinear Control]]

----