<s>
Advanced	O
process	O
monitor	O
(	O
APMonitor	B-Application
)	O
is	O
a	O
modeling	B-Language
language	I-Language
for	O
differential	O
algebraic	O
(	O
DAE	O
)	O
equations	O
.	O
</s>
<s>
APMonitor	B-Application
is	O
suited	O
for	O
large-scale	O
problems	O
and	O
solves	O
linear	B-Algorithm
programming	I-Algorithm
,	O
integer	B-Algorithm
programming	I-Algorithm
,	O
nonlinear	B-Algorithm
programming	I-Algorithm
,	O
nonlinear	O
mixed	O
integer	B-Algorithm
programming	I-Algorithm
,	O
dynamic	B-Application
simulation	I-Application
,	O
moving	O
horizon	O
estimation	O
,	O
and	O
nonlinear	O
model	O
predictive	O
control	O
.	O
</s>
<s>
APMonitor	B-Application
does	O
not	O
solve	O
the	O
problems	O
directly	O
,	O
but	O
calls	O
nonlinear	B-Algorithm
programming	I-Algorithm
solvers	O
such	O
as	O
APOPT	B-Application
,	O
BPOPT	O
,	O
IPOPT	B-Algorithm
,	O
MINOS	B-Application
,	O
and	O
SNOPT	B-Application
.	O
</s>
<s>
The	O
APMonitor	B-Application
API	O
provides	O
exact	O
first	O
and	O
second	O
derivatives	O
of	O
continuous	O
functions	O
to	O
the	O
solvers	O
through	O
automatic	B-Algorithm
differentiation	I-Algorithm
and	O
in	O
sparse	B-Algorithm
matrix	I-Algorithm
form	O
.	O
</s>
<s>
Julia	B-Application
,	O
MATLAB	B-Language
,	O
Python	B-Language
are	O
mathematical	O
programming	O
languages	O
that	O
have	O
APMonitor	B-Application
integration	O
through	O
web-service	O
APIs	O
.	O
</s>
<s>
The	O
GEKKO	O
Optimization	O
Suite	O
is	O
a	O
recent	O
extension	O
of	O
APMonitor	B-Application
with	O
complete	O
Python	B-Language
integration	O
.	O
</s>
<s>
APMonitor	B-Application
is	O
an	O
object-oriented	B-Language
modeling	B-Language
language	I-Language
and	O
optimization	O
suite	O
that	O
relies	O
on	O
programming	O
languages	O
to	O
load	O
,	O
run	O
,	O
and	O
retrieve	O
solutions	O
.	O
</s>
<s>
APMonitor	B-Application
models	O
and	O
data	O
are	O
compiled	O
at	O
run-time	O
and	O
translated	O
into	O
objects	O
that	O
are	O
solved	O
by	O
an	O
optimization	O
engine	O
such	O
as	O
APOPT	B-Application
or	O
IPOPT	B-Algorithm
.	O
</s>
<s>
The	O
optimization	O
engine	O
is	O
not	O
specified	O
by	O
APMonitor	B-Application
,	O
allowing	O
several	O
different	O
optimization	O
engines	O
to	O
be	O
switched	O
out	O
.	O
</s>
<s>
The	O
simulation	O
or	O
optimization	O
mode	O
is	O
also	O
configurable	O
to	O
reconfigure	O
the	O
model	O
for	O
dynamic	B-Application
simulation	I-Application
,	O
nonlinear	O
model	O
predictive	O
control	O
,	O
moving	O
horizon	O
estimation	O
or	O
general	O
problems	O
in	O
mathematical	O
optimization	O
.	O
</s>
<s>
As	O
a	O
first	O
step	O
in	O
solving	O
the	O
problem	O
,	O
a	O
mathematical	O
model	O
is	O
expressed	O
in	O
terms	O
of	O
variables	O
and	O
equations	O
such	O
as	O
the	O
Hock	O
&	O
Schittkowski	O
Benchmark	O
Problem	O
#71	O
used	O
to	O
test	O
the	O
performance	O
of	O
nonlinear	B-Algorithm
programming	I-Algorithm
solvers	O
.	O
</s>
<s>
This	O
mathematical	O
model	O
is	O
translated	O
into	O
the	O
APMonitor	B-Application
modeling	B-Language
language	I-Language
in	O
the	O
following	O
text	O
file	O
.	O
</s>
<s>
The	O
problem	O
is	O
then	O
solved	O
in	O
Python	B-Language
by	O
first	O
installing	O
the	O
APMonitor	B-Application
package	O
with	O
pip	O
install	O
APMonitor	B-Application
or	O
from	O
the	O
following	O
Python	B-Language
code	I-Language
.	O
</s>
<s>
Installing	O
a	O
Python	B-Language
is	O
only	O
required	O
once	O
for	O
any	O
module	O
.	O
</s>
<s>
Once	O
the	O
APMonitor	B-Application
package	O
is	O
installed	O
,	O
it	O
is	O
imported	O
and	O
the	O
apm_solve	O
function	O
solves	O
the	O
optimization	O
problem	O
.	O
</s>
<s>
Similar	O
interfaces	O
are	O
available	O
for	O
MATLAB	B-Language
and	O
Julia	B-Application
with	O
minor	O
differences	O
from	O
the	O
above	O
syntax	O
.	O
</s>
<s>
Extending	O
the	O
capability	O
of	O
a	O
modeling	B-Language
language	I-Language
is	O
important	O
because	O
significant	O
pre	O
-	O
or	O
post-processing	O
of	O
data	O
or	O
solutions	O
is	O
often	O
required	O
when	O
solving	O
complex	O
optimization	O
,	O
dynamic	B-Application
simulation	I-Application
,	O
estimation	O
,	O
or	O
control	O
problems	O
.	O
</s>
<s>
A	O
standard	O
way	O
for	O
dealing	O
with	O
high-index	O
DAEs	O
is	O
to	O
differentiate	O
the	O
equations	O
to	O
put	O
them	O
in	O
index-1	O
DAE	O
or	O
ODE	O
form	O
(	O
see	O
Pantelides	B-Algorithm
algorithm	I-Algorithm
)	O
.	O
</s>
<s>
While	O
the	O
syntax	O
is	O
similar	O
to	O
other	O
modeling	B-Language
languages	I-Language
such	O
as	O
gProms	O
,	O
APMonitor	B-Application
solves	O
DAEs	O
of	O
any	O
index	O
without	O
rearrangement	O
or	O
differentiation	O
.	O
</s>
