## Main.PythonApp History

Hide minor edits - Show changes to markup

Solve this problem problem from a web-browser interface.

- Solve this optimization problem from a web-browser interface or download the Python source above. The Python files are contained in folder
*example_hs71*.

Hock-Schittkowsky Test Suite #71

Solve this problem problem from a web-browser interface.

(:html:) <iframe width="560" height="315" src="http://www.youtube.com/embed/t84YMw8p34w?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)

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

## Python for APMonitor

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

## APM Python

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

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

The development roadmap for this and other libraries are detailed in the 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.

The development roadmap for this and other libraries are detailed in the 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.

The product roadmap for this and other libraries are detailed in the 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.

The development roadmap for this and other libraries are detailed in the 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.

### Folder example_hs071: Nonlinear Programming with Python

### Example_hs071: Nonlinear Programming with Python

### Folder example_nlc: Nonlinear Control with Python

### Example_nlc: Nonlinear Control with Python

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

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

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

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

### Download APM Python Libraries

### Download APM Python Library and Example Problems

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 release notes section.

*Prior Versions*

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

The product roadmap for this and other libraries are detailed in the 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.

### Nonlinear Programming with Python

### Folder example_hs071: Nonlinear Programming with Python

### Nonlinear Control with Python

### Folder example_nlc: Nonlinear Control with Python

### Nonlinear Estimation and Control with Python

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

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*.

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*.

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.

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**.

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and requires only the base Python installation.

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

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

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 release notes section.

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 release notes section.

*Prior Versions*

**from apm import ***'

**from apm import ***

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.

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 release notes section.

The latest APM Python libraries are attached below.

The latest APM Python libraries are attached below. Functionality has been tested with Python 2.7 and requires only the base Python installation.

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.

### Download APM Python Libraries Versions

### Download APM Python Libraries

The latest APM Python libraries are attached below.

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 ***'

### Download APM Python Libraries Versions

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.

### 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.

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*.

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.

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

### Nonlinear Programming with Python

Hock-Schittkowsky Test Suite #71

### Example #2: Nonlinear Control with Python

### Nonlinear Control with Python

(:title Python Interface to APMonitor:)

(:title Nonlinear Optimization with Python:)

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

### Example #2: Nonlinear Control with Python

(: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.