## Command Line

## Main.CommandLine History

Hide minor edits - Show changes to markup

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

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

The following example demonstrates a benchmark study from the command line interface. In this case, the solver option is the default, IPOPT. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

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

C:\apmonitor>apm.exe test -solver=ipopt

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

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

Solver : IPOPT (v3.5)

Solver : IPOPT (v3.10)

apmonitor *model_name* {*-flags*}

apm.exe *model_name* {*-flags*}

C:\apmonitor>apmonitor test

C:\apmonitor>apm.exe test

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *3* to use the IPOPT solver. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

The following example demonstrates a benchmark study from the command line interface. In this case, the solver option is the default, IPOPT. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *3* to use the IPOPT v3.5 solver. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *3* to use the IPOPT solver. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

-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

-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

-P = generate sparsity.unt (dummy file) -UNLC_COLDSTART (-COLD)= coldstart flag -SPECS = read specs from restart file -UNLC_SKIPREAD = skip DBS file read -UNLC_SKIPWRITE = skip DBS file write -UNLC_SKIPREADWRITE = skip DBS file read and write -UNLC_SSTATE (-SS) = steady state mode -UNLC_SSTATE_MPU (-SS_EST) = steady state MPU mode -UNLC_SSTATE_CTL (-SS_CTL) = steady state control mode -UNLC_ONLINE_SIM (-SIM) = on-line simulation mode -UNLC_ONLINE_EST (-EST) = on-line estimation mode -UNLC_ONLINE_CTL (-CTL) = on-line control mode

-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, IPOPT)

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *0* to use all solvers in the benchmark study. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *3* to use the IPOPT v3.5 solver. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

Steady State Optimization with NOVA

Steady State Optimization with Interior Point Solver

NOVA Solver Version 4.00 Iter = 0 Merit = 0.0000000D+00 Meas = 1.0000000D+00 Conv = 0.0000000D+00 %NRNLP-I-SUCCESS, Successful solution. --------------------------------------------------- Solver : NOVA (v4.0) Solution time : 0.34369999999999995 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** Steady State Optimization with Interior Point Solver ********************************************** estimated double precision work space requirement = 182 estimated integer work space requirement = 288 solve problem

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

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 http://projects.coin-or.org/Ipopt

Number of variables : 2 of which are fixed : 0 Number of constraints : 2 Number of lower bounds : 0 Number of upper bounds : 0 Number of nonzeros in Jacobian: 2 ITER ERR MU ||C|| ||D|| ALFA(X) #LS F Regu 0 .000D+00d .100D+00 .000D+00 .000D+00 .000D+00 0 0.00000000D+00 .000D+00 Number of iterations taken ............. 0 Final value of objective function is.... 0.0000000000000000D+00 Errors at final point (scaled) (unscaled) Final maximal constraint violation is... 0.000000D+00 0.000000D+00 Final value for dual infeasibility is... 0.000000D+00 0.000000D+00 Final value of complementarity error is. 0.000000D+00 0.000000D+00 The objective function was evaluated 1 times. The constraints were evaluated 1 times. EXIT: OPTIMAL SOLUTION FOUND CPU seconds spent in IPOPT and function evaluations = 0.0000 The solution was found after 0 Iterations. The final value of the objective function is 0. --------------------------------------------------- Solver : IPOPT (v2.3) Solution time : 0.26559999999999995 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** 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 http://projects.coin-or.org/Ipopt ******************************************************************************

Total CPU secs in IPOPT (w/o function evaluations) = 0.219 Total CPU secs in NLP function evaluations = -0.000

Total CPU secs in IPOPT (w/o function evaluations) = 0.250 Total CPU secs in NLP function evaluations = 0.000

Solution time : 0.48440000000000005 sec

Solution time : 0.5156 sec

********************************************** Steady State Optimization with SNOPT ********************************************** ============================== S N O P T 6.1-1(4) (Jun 2001) ============================== Scale option 0, Partial price 1 Nonlinear constraints 2 Linear constraints 0 Nonlinear variables 2 Linear variables 0 Jacobian variables 2 Objective variables 0 Total constraints 2 Total variables 2 Major Minors Step nCon Feasible Optimal MeritFunction nS Penalty 0 0 1 (0.0E+00)(0.0E+00) 0.0000000E+00 r EXIT -- optimal solution found Problem name myOptim No. of iterations 0 Objective value 0.0000000000E+00 No. of major iterations 0 Linear objective 0.0000000000E+00 Penalty parameter 0.000E+00 Nonlinear objective 0.0000000000E+00 No. of calls to funobj 2 No. of calls to funcon 2 No. of degenerate steps 0 Percentage 0.00 Norm of x 5.9E+00 Norm of pi 1.0E+00 Max Primal infeas 0 0.0E+00 Max Dual infeas 0 0.0E+00 Nonlinear constraint violn 0.0E+00 Time for MPS input 0.00 seconds Time for solving problem 0.00 seconds Time for solution output 0.00 seconds Time for constraint functions 0.00 seconds Time for objective function 0.00 seconds Infeasibility Num = 0 Infeasibility Sum = 0. Objective Function = 0. --------------------------------------------------- Solver : SNOPT (v6.1) Solution time : 0.14070000000000005 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** Steady State Optimization with MINOS ********************************************** Scale option 0, Partial price 1 Itn 0 -- linear constraints satisfied. minosc sets 2 out of 2 constraint gradients. minoso sets 2 out of 2 objective gradients. Major minor step objective Feasible Optimal nsb ncon penalty BSswp 1 0T 0.0E+00 0.00000E+00 0.0E+00 0.0E+00 0 3 1.0E-01 0 2 0 1.0E+00 0.00000E+00 0.0E+00 0.0E+00 0 4 1.0E-01 0 Completion Full now requested EXIT -- optimal solution found Problem name MinosOpt No. of iterations 0 Objective value 0.0000000000E+00 No. of major iterations 2 Linear objective 0.0000000000E+00 Penalty parameter 0.100000 Nonlinear objective 0.0000000000E+00 No. of calls to minoso 5 No. of calls to minosc 4 No. of superbasics 0 No. of basic nonlinears 2 No. of degenerate steps 0 Percentage 0.00 Norm of x 4.2E+00 Norm of pi 1.0E+00 Max Primal infeas 0 0.0E+00 Max Dual infeas 0 0.0E+00 Nonlinear constraint violn 0.0E+00 Solution printed on file 12 minosc called with nstate = 2 minoso called with nstate = 2 Time for MPS input 0.00 seconds Time for solving problem 0.00 seconds Time for solution output 0.00 seconds Time for constraint functions 0.00 seconds Time for objective function 0.00 seconds minoss finished. inform = 0 ninf = 0 sinf = 0. obj = 0. --------------------------------------------------- Solver : MINOS (v5.5) Solution time : 0.17189999999999994 sec Objective : 0. Successful solution --------------------------------------------------- Benchmark Summary for Problem test Solver Variables Equations Res Evals Jac Evals Iter Info Objective Solution Time Status -------------- --------- --------- --------- --------- ---- ---- ------------ ------------- --------- NOVA (v4.0) 2 2 1 1 0 0 0.00000E+00 0.344 Success IPOPT (v2.3) 2 2 1 1 0 0 0.00000E+00 0.266 Success IPOPT (v3.5) 2 2 1 2 0 0 0.00000E+00 0.484 Success SNOPT (v6.1) 2 2 3 1 0 0 0.00000E+00 0.141 Success MINOS (v5.5) 2 2 5 4 0 0 0.00000E+00 0.172 Success ----------------------------------------------------------------------------------------------------- Do not write DBS or restart files in benchmark mode STOPPING...

The following example demonstrates a benchmark study from the command line interface. In this case, the *NLC.Solver* option is set to *0* to use all solvers in the benchmark study. The model is executed with the command *apmonitor test*. No flags are required as all options are set in the DBS file.

### Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:) (:cellnr:)

(:tableend:)

C:\apmonitor>apmonitor test ---------------------------------------------------------------- APMonitor, Beta version 0.1.0 Licensed to :LicenseeVariable 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 NOVA ********************************************** NOVA Solver Version 4.00 Iter = 0 Merit = 0.0000000D+00 Meas = 1.0000000D+00 Conv = 0.0000000D+00 %NRNLP-I-SUCCESS, Successful solution. --------------------------------------------------- Solver : NOVA (v4.0) Solution time : 0.34369999999999995 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** Steady State Optimization with Interior Point Solver ********************************************** estimated double precision work space requirement = 182 estimated integer work space requirement = 288 solve problem ****************************************************************************** This program contains IPOPT, a program for large-scale nonlinear optimization. IPOPT is released as open source under the Common Public License (CPL). For more information visit www.coin-or.org/Ipopt ****************************************************************************** Number of variables : 2 of which are fixed : 0 Number of constraints : 2 Number of lower bounds : 0 Number of upper bounds : 0 Number of nonzeros in Jacobian: 2 ITER ERR MU ||C|| ||D|| ALFA(X) #LS F Regu 0 .000D+00d .100D+00 .000D+00 .000D+00 .000D+00 0 0.00000000D+00 .000D+00 Number of iterations taken ............. 0 Final value of objective function is.... 0.0000000000000000D+00 Errors at final point (scaled) (unscaled) Final maximal constraint violation is... 0.000000D+00 0.000000D+00 Final value for dual infeasibility is... 0.000000D+00 0.000000D+00 Final value of complementarity error is. 0.000000D+00 0.000000D+00 The objective function was evaluated 1 times. The constraints were evaluated 1 times. EXIT: OPTIMAL SOLUTION FOUND CPU seconds spent in IPOPT and function evaluations = 0.0000 The solution was found after 0 Iterations. The final value of the objective function is 0. --------------------------------------------------- Solver : IPOPT (v2.3) Solution time : 0.26559999999999995 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** 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 http://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.5.1, 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.219 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.5) Solution time : 0.48440000000000005 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** Steady State Optimization with SNOPT ********************************************** ============================== S N O P T 6.1-1(4) (Jun 2001) ============================== Scale option 0, Partial price 1 Nonlinear constraints 2 Linear constraints 0 Nonlinear variables 2 Linear variables 0 Jacobian variables 2 Objective variables 0 Total constraints 2 Total variables 2 Major Minors Step nCon Feasible Optimal MeritFunction nS Penalty 0 0 1 (0.0E+00)(0.0E+00) 0.0000000E+00 r EXIT -- optimal solution found Problem name myOptim No. of iterations 0 Objective value 0.0000000000E+00 No. of major iterations 0 Linear objective 0.0000000000E+00 Penalty parameter 0.000E+00 Nonlinear objective 0.0000000000E+00 No. of calls to funobj 2 No. of calls to funcon 2 No. of degenerate steps 0 Percentage 0.00 Norm of x 5.9E+00 Norm of pi 1.0E+00 Max Primal infeas 0 0.0E+00 Max Dual infeas 0 0.0E+00 Nonlinear constraint violn 0.0E+00 Time for MPS input 0.00 seconds Time for solving problem 0.00 seconds Time for solution output 0.00 seconds Time for constraint functions 0.00 seconds Time for objective function 0.00 seconds Infeasibility Num = 0 Infeasibility Sum = 0. Objective Function = 0. --------------------------------------------------- Solver : SNOPT (v6.1) Solution time : 0.14070000000000005 sec Objective : 0. Successful solution --------------------------------------------------- ********************************************** Steady State Optimization with MINOS ********************************************** Scale option 0, Partial price 1 Itn 0 -- linear constraints satisfied. minosc sets 2 out of 2 constraint gradients. minoso sets 2 out of 2 objective gradients. Major minor step objective Feasible Optimal nsb ncon penalty BSswp 1 0T 0.0E+00 0.00000E+00 0.0E+00 0.0E+00 0 3 1.0E-01 0 2 0 1.0E+00 0.00000E+00 0.0E+00 0.0E+00 0 4 1.0E-01 0 Completion Full now requested EXIT -- optimal solution found Problem name MinosOpt No. of iterations 0 Objective value 0.0000000000E+00 No. of major iterations 2 Linear objective 0.0000000000E+00 Penalty parameter 0.100000 Nonlinear objective 0.0000000000E+00 No. of calls to minoso 5 No. of calls to minosc 4 No. of superbasics 0 No. of basic nonlinears 2 No. of degenerate steps 0 Percentage 0.00 Norm of x 4.2E+00 Norm of pi 1.0E+00 Max Primal infeas 0 0.0E+00 Max Dual infeas 0 0.0E+00 Nonlinear constraint violn 0.0E+00 Solution printed on file 12 minosc called with nstate = 2 minoso called with nstate = 2 Time for MPS input 0.00 seconds Time for solving problem 0.00 seconds Time for solution output 0.00 seconds Time for constraint functions 0.00 seconds Time for objective function 0.00 seconds minoss finished. inform = 0 ninf = 0 sinf = 0. obj = 0. --------------------------------------------------- Solver : MINOS (v5.5) Solution time : 0.17189999999999994 sec Objective : 0. Successful solution --------------------------------------------------- Benchmark Summary for Problem test Solver Variables Equations Res Evals Jac Evals Iter Info Objective Solution Time Status -------------- --------- --------- --------- --------- ---- ---- ------------ ------------- --------- NOVA (v4.0) 2 2 1 1 0 0 0.00000E+00 0.344 Success IPOPT (v2.3) 2 2 1 1 0 0 0.00000E+00 0.266 Success IPOPT (v3.5) 2 2 1 2 0 0 0.00000E+00 0.484 Success SNOPT (v6.1) 2 2 3 1 0 0 0.00000E+00 0.141 Success MINOS (v5.5) 2 2 5 4 0 0 0.00000E+00 0.172 Success ----------------------------------------------------------------------------------------------------- Do not write DBS or restart files in benchmark mode STOPPING... C:\apmonitor>

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

apmonitor *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 sparsity.unt (dummy file) -UNLC_COLDSTART (-COLD)= coldstart flag -SPECS = read specs from restart file -UNLC_SKIPREAD = skip DBS file read -UNLC_SKIPWRITE = skip DBS file write -UNLC_SKIPREADWRITE = skip DBS file read and write -UNLC_SSTATE (-SS) = steady state mode -UNLC_SSTATE_MPU (-SS_EST) = steady state MPU mode -UNLC_SSTATE_CTL (-SS_CTL) = steady state control mode -UNLC_ONLINE_SIM (-SIM) = on-line simulation mode -UNLC_ONLINE_EST (-EST) = on-line estimation mode -UNLC_ONLINE_CTL (-CTL) = on-line control mode