Command Line

Command Line Interface

All other APMonitor interfaces are wrappers for the command line interface. A problem is executed from the command line interface with parameters that follow the APMonitor executable name.

apm.exe model_name {-flags}

The optional flags are listed below. The command line parameters are converted to upper-case letters automatically so lower-case parameters are also acceptable. This list of flags can also be obtained by including a non-existant flag, such as -help.

  -P                 = generate dummy file sparsity.unt

  -COLD              = coldstart flag
  -WARM              = warmstart flag

  -SPECS             = read specs from restart file
  -NO_SPECS          = don't read specs from restart file

  -SKIPREAD          = skip DBS file read
  -SKIPWRITE         = skip DBS file write
  -SKIPREADWRITE     = skip DBS file read and write

  -SS                = steady state mode
  -MPU               = steady state estimation (Model Parameter Update) mode
  -RTO               = steady state control (Real-time Optimization) mode
  -SIM               = dynamic simulation mode
  -EST               = dynamic estimation (Moving Horizon Estimation) mode
  -CTL               = dynamic nonlinear control mode

  -SOLVER=name       = solver technology (-SOLVER=ALL, APOPT, BPOPT, IPOPT)

Example

The following example demonstrates a benchmark study from the command line interface. In this case, the solver option is IPOPT. The model is executed with the command apm test -solver=ipopt.

 C:\apmonitor>apm.exe test -solver=ipopt
  ----------------------------------------------------------------
  APMonitor, Beta version 0.1.0
  Licensed to    : Licensee
  Variable Limit : 150
  Beta Expiration: 91 days
  ----------------------------------------------------------------

  ************ Custom model ************
  Each node contains
    Objects      :  0
    Variables    :  4
    Intermediates:  1
    Connections  :  0
    Equations    :  12
    Residuals    :  2

  Number of state variables:  2
  Number of total equations:  2
  Degrees of freedom       :  0
  **********************************************
  Steady State Optimization with Interior Point Solver
  **********************************************

 ******************************************************************************
 This program contains Ipopt, a library for large-scale nonlinear optimization.
  Ipopt is released as open source code under the Common Public License (CPL).
          For more information visit https://projects.coin-or.org/Ipopt
 ******************************************************************************

 NOTE: You are using Ipopt by default with the MUMPS linear solver.
       Other linear solvers might be more efficient (see Ipopt documentation).


 This is Ipopt version 3.10.2, running with linear solver mumps.

 Number of nonzeros in equality constraint Jacobian...:        2
 Number of nonzeros in inequality constraint Jacobian.:        0
 Number of nonzeros in Lagrangian Hessian.............:        0

 Total number of variables............................:        2
                      variables with only lower bounds:        0
                 variables with lower and upper bounds:        0
                      variables with only upper bounds:        0
 Total number of equality constraints.................:        2
 Total number of inequality constraints...............:        0
         inequality constraints with only lower bounds:        0
    inequality constraints with lower and upper bounds:        0
         inequality constraints with only upper bounds:        0

 iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
    0 0.0000000e+000 0.00e+000 0.00e+000   0.0 0.00e+000    -  0.00e+000 0.00e+000   0

 Number of Iterations....: 0

                                    (scaled)                 (unscaled)
 Objective...............:  0.0000000000000000e+000   0.0000000000000000e+000
 Dual infeasibility......:  0.0000000000000000e+000   0.0000000000000000e+000
 Constraint violation....:  0.0000000000000000e+000   0.0000000000000000e+000
 Complementarity.........:  0.0000000000000000e+000   0.0000000000000000e+000
 Overall NLP error.......:  0.0000000000000000e+000   0.0000000000000000e+000


 Number of objective function evaluations             = 1
 Number of objective gradient evaluations             = 1
 Number of equality constraint evaluations            = 1
 Number of inequality constraint evaluations          = 0
 Number of equality constraint Jacobian evaluations   = 1
 Number of inequality constraint Jacobian evaluations = 0
 Number of Lagrangian Hessian evaluations             = 0
 Total CPU secs in IPOPT (w/o function evaluations)   =      0.250
 Total CPU secs in NLP function evaluations           =      0.000

 EXIT: Optimal Solution Found.

  The solution was found.

  The final value of the objective function is  0.

  ---------------------------------------------------
  Solver         :  IPOPT (v3.10)
  Solution time  :  0.5156 sec
  Objective      :  0.
  Successful solution
  ---------------------------------------------------

 C:\apmonitor>