Small Overview of Simulation Flags

This chapter contains a short overview of simulation flags as well as additional details of the numerical integration methods.

OpenModelica (C-runtime) Simulation Flags

The simulation executable takes the following flags:

-abortSlowSimulation
Aborts if the simulation chatters.
-alarm=value or -alarm value
Aborts after the given number of seconds (default=0 disables the alarm).
-clock=value or -clock value

Selects the type of clock to use. Valid options include:

  • RT (monotonic real-time clock)
  • CYC (cpu cycles measured with RDTSC)
  • CPU (process-based CPU-time)
-cpu
Dumps the cpu-time into the result-file using the variable named $cpuTime

-csvOstep=value or -csvOstep value value specifies csv-files for debuge values for optimizer step

-dasslJacobian=value or -dasslJacobian value

Selects the type of the Jacobian that is used for the dassl solver:

  • coloredNumerical (colored numerical Jacobian, the default).
  • internalNumerical (internal dassl numerical Jacobian).
  • coloredSymbolical (colored symbolical Jacobian. Only usable if the simulation is compiled with --generateSymbolicJacobian or --generateSymbolicLinearization.
  • numerical - numerical Jacobian.
  • symbolical - symbolical Jacobian. Only usable if the simulation is compiled with --generateSymbolicJacobian or --generateSymbolicLinearization.
-dasslnoRestart
Deactivates the restart of dassl after an event is performed.
-dasslnoRootFinding
Deactivates the internal root finding procedure of dassl.
-emit_protected
Emits protected variables to the result-file.
-f=value or -f value
Value specifies a new setup XML file to the generated simulation code.
-help=value or -help value
Get detailed information that specifies the command-line flag For example, -help=f prints detailed information for command-line flag f.
-ignoreHideResult
Emits also variables with HideResult=true annotation.
-iif=value or -iif value
Value specifies an external file for the initialization of the model.
-iim=value or -iim value

Value specifies the initialization method.

  • none (sets all variables to their start values and skips the initialization process)
  • symbolic (solves the initialization problem symbolically - default)
-iit=value or -iit value
Value [Real] specifies a time for the initialization of the model.
-ils=value or -ils value
Value specifies the number of steps for homotopy method (required: -iim=symbolic) or 'start value homotopy' method (required: -iim=numeric -iom=nelder_mead_ex). The value is an Integer with default value 1.
-initialStepSize=value or -initialStepSize value
Value specifies an initial stepsize for the dassl solver.
-csvInput=value or -csvInput value
Value specifies an csv-file with inputs for the simulation/optimization of the model
-exInputFile=value or -exInputFile value
Value specifies an external file with inputs for the simulation/optimization of the model.
-stateFile=value or -stateFile value
Value specifies an file with states start values for the optimization of the model.
-ipopt_hesse=value or -ipopt_hesse value
Value specifies the hessematrix for Ipopt(OMC, BFGS, const).
-ipopt_init=value or -ipopt_init value
Value specifies the initial guess for optimization (sim, const).
-ipopt_jac=value or -ipopt_jac value
Value specifies the jacobian for Ipopt(SYM, NUM, NUMDENSE).
-ipopt_max_iter=value or -ipopt_max_iter value
Value specifies the max number of iteration for ipopt.
-ipopt_warm_start=value or -ipopt_warm_start value
Value specifies lvl for a warm start in ipopt: 1,2,3,...
-l=value or -l value
Value specifies a time where the linearization of the model should be performed.
-logFormat=value or -logFormat value

Value specifies the log format of the executable:

  • text (default)
  • xml
-ls=value or -ls value

Value specifies the linear solver method

  • lapack (method using lapack LU factorization)
  • lis (method using iterativ solver Lis)
  • klu (method using klu sparse linear solver)
  • umfpack (method using umfpack sparse linear solver)
  • totalpivot (method using a total pivoting LU factorization for underdetermination systems)
  • default (default method - lapack with total pivoting as fallback)
-ls_ipopt=value or -ls_ipopt value
Value specifies the linear solver method for Ipopt, default mumps. Note: Use if you build ipopt with other linear solver like ma27
-lv=value or -lv value

Value (a comma-separated String list) specifies which logging levels to enable. Multiple options can be enabled at the same time.

  • LOG_DASSL (additional information about dassl solver)
  • LOG_DASSL_STATES (outputs the states at every dassl call)
  • LOG_DEBUG (additional debug information)
  • LOG_DSS (outputs information about dynamic state selection)
  • LOG_DSS_JAC (outputs jacobian of the dynamic state selection)
  • LOG_DT (additional information about dynamic tearing)
  • LOG_EVENTS (additional information during event iteration)
  • LOG_EVENTS_V (verbose logging of event system)
  • LOG_INIT (additional information during initialization)
  • LOG_IPOPT (information from Ipopt)
  • LOG_IPOPT_FULL (more information from Ipopt)
  • LOG_IPOPT_JAC (check jacobian matrix with Ipopt)
  • LOG_IPOPT_HESSE (check hessian matrix with Ipopt)
  • LOG_IPOPT_ERROR (print max error in the optimization)
  • LOG_JAC (outputs the jacobian matrix used by dassl)
  • LOG_LS (logging for linear systems)
  • LOG_LS_V (verbose logging of linear systems)
  • LOG_NLS (logging for nonlinear systems)
  • LOG_NLS_V (verbose logging of nonlinear systems)
  • LOG_NLS_HOMOTOPY (logging of homotopy solver for nonlinear systems)
  • LOG_NLS_JAC (outputs the jacobian of nonlinear systems)
  • LOG_NLS_JAC_TEST (tests the analytical jacobian of nonlinear systems)
  • LOG_NLS_RES (outputs every evaluation of the residual function)
  • LOG_NLS_EXTRAPOLATE (outputs debug information about extrapolate process)
  • LOG_RES_INIT (outputs residuals of the initialization)
  • LOG_SIMULATION (additional information about simulation process)
  • LOG_SOLVER (additional information about solver process)
  • LOG_SOLVER_CONTEXT (context information during the solver process)
  • LOG_SOTI (final solution of the initialization)
  • LOG_STATS (additional statistics about timer/events/solver)
  • LOG_STATS_V (additional statistics for LOG_STATS)
  • LOG_UTIL (???)
  • LOG_ZEROCROSSINGS (additional information about the zerocrossings)
-maxIntegrationOrder=value or -maxIntegrationOrder value
Value specifies maximum integration order, used by dassl solver.
-maxStepSize=value or -maxStepSize value
Value specifies maximum absolute step size, used by dassl solver.
-measureTimePlotFormat=value or -measureTimePlotFormat value

Value specifies the output format of the measure time functionality

  • svg
  • jpg
  • ps
  • gif
  • ...
-newton=value or -newton value

Value specifies the damping strategy for the newton solver.

  • damped (Newton with a damping strategy)
  • damped2 (Newton with a damping strategy 2)
  • damped_ls (Newton with a damping line search)
  • damped_bt (Newton with a damping backtracking and a minimum search via golden ratio method)
  • pure (Newton without damping strategy)
-nls=value or -nls value

Value specifies the nonlinear solver:

  • hybrid
  • kinsol
  • newton
  • mixed
  • hybrid (Modification of the Powell hybrid method from minpack - former default solver)
  • kinsol (sundials/kinsol - prototype implementation)
  • newton (Newton Raphson - prototype implementation)
  • homotopy (Damped Newton solver if failing case fixed-point and Newton homotopies are tried.)
  • mixed (Mixed strategy. First the homotopy solver is tried and then as fallback the hybrid solver.)
-nlsInfo
Outputs detailed information about solving process of non-linear systems into csv files.
-noemit
Do not emit any results to the result file.
-noEquidistantTimeGrid
Output the internal steps given by dassl instead of interpolating results into an equidistant time grid as given by stepSize or numberOfIntervals.
-noEquidistantOutputFrequency=value or -noEquidistantOutputFrequency value
Integer value n controls the output frequency in noEquidistantTimeGrid mode and outputs every n-th time step
-noEquidistantOutputTime=value or -noEquidistantOutputTime value
Real value timeValue controls the output time point in noEquidistantOutputTime mode and outputs every time>=k*timeValue, where k is an integer
-noEventEmit
Do not emit event points to the result file.
-optDebugeJac=value or -optDebugeJac value
Value specifies the number of itereations from the dynamic optimization, which will be debugged, creating .csv and .py files.
-optimizerNP=value or -optimizerNP value
Value specifies the number of points in a subinterval. Currently supports numbers 1 and 3.
-optimizerTimeGrid=value or -optimizerTimeGrid value
Value specifies external file with time points.
-output=value or -output value
Output the variables a, b and c at the end of the simulation to the standard output: time = value, a = value, b = value, c = value
-override=value or -override value
Override the variables or the simulation settings in the XML setup file For example: var1=start1,var2=start2,par3=start3,startTime=val1,stopTime=val2
-overrideFile=value or -overrideFile value
Will override the variables or the simulation settings in the XML setup file with the values from the file. Note that: -overrideFile CANNOT be used with -override. Use when variables for -override are too many. overrideFileName contains lines of the form: var1=start1
-port=value or -port value
Value specifies the port for simulation status (default disabled).
-r=value or -r value
Value specifies the name of the output result file. The default file-name is based on the model name and output format. For example: Model_res.mat.
-s=value or -s value

Value specifies the solver (integration method).

  • euler - Explicit Euler (order 1)
  • rungekutta - Runge-Kutta (fixed step, order 4)
  • dassl - BDF solver with colored numerical jacobian, with interval root finding - default
  • optimization - Special solver for dynamic optimization
  • radau5 - Radau IIA with 3 points, "Implicit Runge-Kutta", order 5 [sundial/kinsol needed]
  • radau3 - Radau IIA with 2 points, "Implicit Runge-Kutta", order 3 [sundial/kinsol needed]
  • impeuler - Implicit Euler (actually Radau IIA, order 1) [sundial/kinsol needed]
  • trapezoid - Trapezoidal rule (actually Lobatto IIA with 2 points) [sundial/kinsol needed]
  • lobatto4 - Lobatto IIA with 3 points, order 4 [sundial/kinsol needed]
  • lobatto6 - Lobatto IIA with 4 points, order 6 [sundial/kinsol needed]
  • symEuler - symbolic implicit euler, [compiler flag +symEuler needed]
  • symEulerSsc - symbolic implicit euler with step-size control, [compiler flag +symEuler needed]
  • heun - Heun's method (Runge-Kutta fixed step, order 2)
  • qss - A QSS solver [experimental]
-keepHessian=value or -keepHessian value
Value specifies the number of steps, which keep hessian matrix constant.
-w
Shows all warnings even if a related log-stream is inactive.

Integration Methods

This section contains additional information about the different integration methods in OpenModelica, selected by the method flag of the simulate command or the -s simflag.

dassl

Default integration method in OpenModelica. Adams Moulton; the default uses a colored numerical Jacobian and interval root finding. To change settings, use simulation flags such as dasslJacobian, dasslNoRootFinding, dasslNoRestart, initialStepSize, maxStepSize, maxIntegrationOrder, noEquidistantTimeGrid.

Order: 1-5
Step Size Control: true
Order Control: true
Stability Region: variable; depend from order

euler

Explicit Euler.

Order: 1
Step Size Control: false
Order Control: false
Stability Region: |(1,0) Padé | ≤ 1

rungekutta

Classical Runge-Kutta method.

Order: 4
Step Size Control: false
Order Control: false
Stability Region: |(4,0) Padé | ≤ 1

radau1

Radau IIA with one point.

Order: 1
Step Size Control: false
Order Control: false
Stability Region: |(0,1) Padé | ≤ 1

radau3

Radau IIA with two points.

Order: 3
Step Size Control: false
Order Control: false
Stability Region: |(1,2) Padé | ≤ 1

radau5

Radau IIA with three points.

Order: 5
Step Size Control: false
Order Control: false
Stability Region: |(2,3) Padé | ≤ 1

lobatto2

Lobatto IIIA with two points.

Order: 2
Step Size Control: false
Order Control: false
Stability Region: |(2,2) Padé | ≤ 1

lobatto4

Lobatto IIIA with three points.

Order: 4
Step Size Control: false
Order Control: false
Stability Region: |(3,3) Padé | ≤ 1

lobatto6

Lobatto IIIA with four points.

Order: 6
Step Size Control: false
Order Control: false
Stability Region: |(4,4) Padé | ≤ 1

Notes

Simulation flags maxStepSize and maxIntegrationOrder specifiy maximum absolute step size and maximum integration order used by the dassl solver.

General step size without control \approx \cfrac{\mbox{stopTime} - \mbox{startTime}}{\mbox{numberOfIntervals}}. Events change the step size (see Modelica spec 3.3 p. 88).

For (a,b) Padé see wikipedia.