Nonlinear Programming in MATLAB

MATLAB offers a convenient way to access the latest release of APMonitor. The optimization problem is sent to the APMonitor server and results are returned to MATLAB local variables and a web interface. Example applications of nonlinear models with differential and algebraic equations are available for download below.

Download APM MATLAB Libraries

The latest APM MATLAB libraries are attached below. Functionality has been tested with the latest release of MATLAB.

APM MATLAB (version 0.5.6) - Released 15 Feb 2012

The zipped archives contain a script files such as apm.m. To use the APM MATLAB functions, copy the script files into the active directory or add the path with the addpath command.

Note: Some older versions of MATLAB cannot run the apm_var.m or apm_web.m script. This script automatically launches the web-viewer for display of the solution results. If this is the case, comments in the script give instructions on a work-around. Example applications of the APM Matlab library include nonlinear programming, nonlinear control, and other applications below.


Example HS71: Nonlinear Programming with Matlab

Hock-Schittkowsky Test Suite #71


Example CSTR: Continuous Stirred Tank Reactor

The APM solution is compared to the ODE15s built-in integrator in MATLAB. Unlike ODE15s, APMonitor allows higher-index DAEs and open-equation format. APMonitor is also a simultaneous equation solver that transforms the differential equations into a Nonlinear Programming (NLP) form. This allows efficient optimization, even for large-scale models.


Example NLC: Nonlinear Control with MATLAB

In another example, the dynamic simulation and control technologies are demonstrated with a simple lag model. The model is composed of one differential equation and one algebraic equation. This model is used as a tutorial to demonstrate the control technology features.

This model demonstrates a simulated step change and two controlled step changes. Two different controlled variable error models are compared. At the end of the simulation, a browser window opens to allow the user to view the solution through the web-interface.