MATLAB Dynamic Optimization Toolbox
Main.MATLAB History
Show minor edits - Show changes to markup


(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/-IDTagajoyA?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Tutorial on Dynamic Simulation
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/-IDTagajoyA?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)
<iframe width="560" height="315" src="https://www.youtube.com/embed/-IDTagajoyA?rel=0" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/SVOb0yDPJjw" frameborder="0" allowfullscreen></iframe>
(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/-IDTagajoyA?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)
Example HS71: Nonlinear Programming with MATLAB

Nonlinear Programming with MATLAB

Example CSTR: Continuous Stirred Tank Reactor
CSTR: Continuous Stirred Tank Reactor
Example NLC: Nonlinear Control with MATLAB
NLC: Nonlinear Control with MATLAB
MATLAB Class for APMonitor







(:title Dynamic Optimization Toolbox in MATLAB:)
(:title MATLAB Dynamic Optimization Toolbox:)
(:title MATLAB Interface to APMonitor:)
(:title Dynamic Optimization Toolbox in MATLAB:)



Example HS71: Nonlinear Programming with Matlab
Example HS71: Nonlinear Programming with MATLAB
MATLAB Class for APMonitor













APM MATLAB Source Code Documentation
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.




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.




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








Example HS71: Nonlinear Programming with Matlab

Hock-Schittkowsky Test Suite #71
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 Python library include nonlinear programming, nonlinear control, and other applications below.
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.
Simulink Interface to APMonitor
MATLAB offers an attractive interface for sequential simulation. Amoung other activities, sequential simulation can be used for replay of historical data or studies for controller tuning. The file parsing and trending capabilities allow results to be visualized in a flexible computing environment.
Sequential simulation refers to the method of data access. Instead of a single simulation, the sequential approach takes a set of new information and re-runs the calculation. Model replay also allows application behavior to be investigated before placing it on-line. Model changes can be investigated over the same data period with this approach.


ModelReplay is a user-built MATLAB script that acts as a user interface to handle sequential runs of the command-line version of APMonitor. The latest script file is designed only for moving horizon estimation but may be extended for dynamic simulation or nonlinear control in future versions. Primary actions performed by the script file at each time step are APMonitor.exe execution, file/folder management, Database File (dbs) updates, and presentation of results.
Several built-in MATLAB functions were used to facilitate string, file and folder handling: copyfile, dlmread, importdata, num2str, rmdir, strcat, strcmp, strmatch, strrep, strtrim, textscan. Cellwrite.m is a user-built function that allows MATLAB to convert textscan output back into a text file and can be found on the MathWorks website.
Key configuration parameters to set in any user-built APMonitor interface:
- NLC.DIAGLEVEL : specifies type and number of files output by APMonitor into the local directory. Diaglevel = 0 outputs the minimum essential files while DIAGLEVEL = 5 performs the greatest number of diagnostic checks.
- NLC.COLDSTART : should be set equal to 1 when starting from a cold start and set equal to zero afterwards to 0 for a warmstart. A cold start is the first run of past measurements. A warm start assumes more than one past time-step of measurements are available.
- NLC.DBSREAD and NLC.DBSWRITE : should both be set equal to 1 to interface with DBS files.
- NLC.IMODE : sets the analysis mode.
- {MV or SV}.MEAS and {MV or SV}.NEWVAL: update the .dbs file with the current measurement.
ModelReplay may be applied in an industry setting to predict the response of an estimation or fault detection algorithm with varying unknown model parameters over a variety of past operating conditions.
File/Folder Management
Essential files such as est.t0, est.meas, est.dxdt, and .dbs files are copied into the new run directory prior to APMonitor execution. New folders are created and older folders are deleted based on setting found in ModelReplay.m.
Example NLC: Nonlinear Control with MATLAB
Example NLC: Nonlinear Control with MATLAB
Simulink Interface to APMonitor
Simulink Interface to APMonitor
The zipped archives contain a script files such as apm.m. To use the APM MATLAB library, copy the script files into the active directory.
Previous versions of the APM MATLAB 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
Some older versions of MATLAB cannot run the 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 Python library include nonlinear programming, nonlinear control, and other applications below.
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 Python library include nonlinear programming, nonlinear control, and other applications below.
Example CSTR: Continuous Stirred Tank Reactor
Nonlinear Control with MATLAB
Example NLC: Nonlinear Control with MATLAB
Nonlinear Control with MATLAB / GNU Octave
Nonlinear Control with MATLAB
Latest Version
Download APM MATLAB Libraries
The latest APM MATLAB libraries are attached below. Functionality has been tested with the latest release of MATLAB.
The zipped archives contain a script files such as apm.m. To use the APM MATLAB library, copy the script files into the active directory.
Previous versions of the APM MATLAB 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
Some older versions of MATLAB cannot run the 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 Python library include nonlinear programming, nonlinear control, and other applications below.
(:keywords nonlinear, MATLAB, GNU Octave, model, predictive control, APMonitor, differential, algebraic, modeling language:)
(:keywords nonlinear, MATLAB, GNU Octave, model, predictive control, APMonitor, differential, algebraic, modeling language, Nonlinear MPC Toolbox:)
MATLAB Interface to APMonitor
Nonlinear Programming in MATLAB



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