1. List of options that can be set in compiler

Table A.1. Compiler options

OptionOption type / Default valueDescription
automatic_tearingboolean / trueIf enabled, then automatic tearing of equation systems is performed.
c_compilerstring / 'gcc'The C compiler to use to compile generated C code.
check_inactive_ contitionalsboolean / falseIf enabled, check for errors in inactive conditional components when compiling. When using check mode, this is always done.
component_names_in_errorsboolean / falseIf enabled, the compiler will include the name of the component where the error was found, if applicable.
convert_free_dependent_ parameters_to_algebraicsboolean / trueIf enabled, then free dependent parameters are converted to algebraic variables.
divide_by_vars_in_tearingboolean / falseIf enabled, a less restrictive strategy is used for solving equations in the tearing algorithm. Specifically, division by parameters and variables is permitted, by default no such divisions are made during tearing.
enable_block_function_ extractionboolean / falseLooks for function calls in blocks. If a function call in a block doesn't depend on the block in question, it is extracted from the block.
external_constant_ evaluationinteger / 5000Time limit (ms) when evaluating constant calls to external functions during compilation. 0 indicates no evaluation. -1 indicates no time limit.
generate_block_jacobianboolean / falseIf enabled, then code for computing block Jacobians is generated. If blocks are needed to compute ODE jacobians they will be generated anyway
generate_dae_jacobianboolean / falseIf enabled, then code for computing DAE Jacobians are generated.
generate_html_diagnosticsboolean / falseIf enabled, model diagnostics are generated in HTML format. This includes the flattened model, connection sets, alias sets and BLT form.
generate_mof_filesboolean / falseIf enabled, then flat model before and after transformations will be generated.
generate_ode_jacobianboolean / falseIf enabled, then code for computing ODE Jacobians are generated.
generate_only_initial_ systemboolean / falseIf enabled, then only the initial equation system will be generated.
halt_on_warningboolean / falseIf enabled, compilation warnings will cause compilation to abort.
index_reductionboolean / trueIf enabled, then index reduction is performed for high-index systems.
nonlinear_solverstring / 'kinsol'Decides which nonlinear equation solver to use. Alternatives are 'kinsol or 'minpack'.
relational_time_eventsboolean / trueIf enabled, then relational operators are allowed to generate time events.
state_initial_equationsboolean / falseIf enabled, the compiler ignores initial equations in the model and adds parameters for controlling intitial values of states.Default is false.
state_start_values_fixedboolean / falseIf enabled, then initial equations are generated automatically for differentiated variables even though the fixed attribute is equal to fixed. Setting this option to true is, however, often practical in optimization problems.
automatic_add_initial_ equationsboolean / trueIf enabled, then additional initial equations are added to the model based equation matching. Initial equations are added for states that are not matched to an equation.
diagnostics_limitinteger / 500This option specifies the equation system size at which the compiler will start to reduce model diagnostics. This option only affects diagnostic output that grows faster than linear with the number of equations.
dynamic_statesboolean / trueIf enabled, dynamic states will be calculated and generated.
eliminate_alias_variablesboolean / trueIf enabled, then alias variables are eliminated from the model.
enable_structural_ diagnosisboolean / trueIf enabled, structural error diagnosis based on matching of equations to variables is used.
enable_variable_scalingboolean / falseIf enabled, then the 'nominal' attribute will be used to scale variables in the model.
equation_sortingboolean / trueIf enabled, then the equation system is separated into minimal blocks that can be solved sequentially.
export_functionsboolean / falseExport used Modelica functions to generated C code in a manner that is compatible with the external C interface in the Modelica Language Specification.
export_functions_vbaboolean / falseCreate VBA-compatible wrappers for exported functions. Requires the option export_functions.
external_constant_ evaluation_max_procinteger / 10The maximum number of processes kept alive for evaluation of external functions during compilation. This speeds up evaluation of functions using external objects during compilation.If less than 1, no processes will be kept alive, i.e. this feature is turned off.
function_incidence_ computationstring / 'none'Controls how matching algorithm computes incidences for function call equations. Possible values: 'none', 'all'. With 'none' all outputs are assumed to depend on all inputs. With 'all' the compiler analyses the function to determine dependencies.
homotopy_typestring / 'actual'Decides how homotopy expressions are interpreted during compilation. Can be set to either 'simplified' or 'actual' which will compile the model using only the simplified or actual expressions of the homotopy() operator.
ignore_withinboolean / falseIf enabled, ignore within clauses both when reading input files and when error-checking.
inline_functionsstring / 'trivial'Controlles what function calls are inlined. 'none' - no function calls are inlined. 'trivial' - inline function calls that will not increase the number of variables in the system. 'all' - inline all function calls that are possible.
local_iteration_in_tearingstring / 'off'This option controls whether equations can be solved local in tearing. Possible options are: 'off', local iterations are not used (default). 'annotation', only equations that are annotated are candidates. 'all', all equations are candidates.
max_n_procinteger / 4The maximum number of processes used during c-code compilation.
normalize_minimum_time_ problemsboolean / trueIf enabled, then minimum time optimal control problems encoded in Optimica are converted to fixed interval problems by scaling of the derivative variables. Has no effect for Modelica models.
propagate_derivativesboolean / trueIf enabled, the compiler will try to replace ordinary variable references with derivative references. This is done by first finding equations on the form x = der(y). If possible, uses of x will then be replaced with der(x).
variability_propagationboolean / trueIf enabled, the compiler performs a global analysis on the equation system and reduces variables to constants and parameters where applicable.
write_iteration_variables_ to_fileboolean / falseIf enabled, two text files containing one iteration variable name per row is written to disk. The files contains the iteration variables for the DAE and the DAE initialization system respectively. The files are output to the resource directory of the FMU.
write_tearing_pairs_to_ fileboolean / falseIf enabled, two text files containing tearing pairs is written to disk. The files contains the tearing pairs for the DAE and the DAE initialization system respectively. The files are output to the working directory.
algorithms_as_functionsboolean / falseIf enabled, convert algorithm sections to function calls.
generate_event_switchesboolean / trueIf enabled, event generating expressions generates switches in the c-code. Setting this option to false can give unexpected results.
cs_rel_tolreal / 1.0E-6Tolerance for the adaptive solvers in the Co-Simulation case.
cs_solverinteger / 0Specifies the internal solver used in Co-Simulation. 0 - CVode, 1 - Euler.
cs_step_sizereal / 0.001Step-size for the fixed-step solvers in the Co-Simulation case.
enforce_boundsboolean / trueIf enabled, min / max bounds on variables are enforced in the equation blocks.
iteration_variable_scalinginteger / 1Scaling mode for the iteration variables in the equation block solvers: 0 - no scaling, 1 - scaling based on nominals, 2 - utilize heuristic to guess nominal based on min, max, start, etc.
log_levelinteger / 3Log level for the runtime: 0 - none, 1 - fatal error, 2 - error, 3 - warning, 4 - info, 5 - verbose, 6 - debug.
nle_solver_default_tolreal / 1.0E-10Default tolerance for the equation block solver.
nle_solver_max_residual_ scaling_factorreal / 1.0E10Maximal scaling factor used by automatic and hybrid residual scaling algorithm.
nle_solver_min_residual_ scaling_factorreal / 1.0E-10Minimal scaling factor used by automatic and hybrid residual scaling algorithm.
rescale_after_singular_jacboolean / trueIf enabled, scaling will be updated after a singular jacobian was detected (only active if automatic scaling is used).
rescale_each_stepboolean / falseIf enabled, scaling will be updated at every step (only active if automatic scaling is used).
residual_equation_scalinginteger / 1Equations scaling mode in equation block solvers: 0 - no scaling, 1 - automatic scaling, 2 - manual scaling, 3 - hybrid.
runtime_log_to_fileboolean / falseIf enabled, log messages from the runtime are written directly to a file, besides passing it through the FMU interface. The log file name is generated based on the FMU name.
use_Brent_in_1dboolean / trueIf enabled, Brent search will be used to improve accuracy in solution of 1D non-linear equations.
events_default_tolreal / 1.0E-10Default tolerance for the event iterations.
events_tol_factorreal / 1.0E-4Tolerance safety factor for the event indicators. Used when external solver specifies relative tolerance.
nle_brent_ignore_errorboolean / falseIf enabled, the Brent solver will ignore convergence failures.
nle_solver_check_jac_condboolean / falseIf enabled, the equation block solver computes and log the jacobian condition number.
nle_solver_max_iterinteger / 100Maximum number of iterations for the equation block solver.
nle_solver_min_tolreal / 1.0E-12Minimum tolerance for the equation block solver. Note that, e.g. default Kinsol tolerance is machine precision pwr 1/3, i.e. 1e-6.
nle_solver_regularization_ tolerancereal / -1.0Tolerance for deciding when regularization should be activated (i.e. when condition number > reg tol).
nle_solver_step_limit_ factorreal / 10.0Factor limiting the step-size taken by the nonlinear solver.
nle_solver_tol_factorreal / 1.0E-4Tolerance safety factor for the equation block solver. Used when external solver specifies relative tolerance.
use_jacobian_equilibrationboolean / falseIf enabled, jacobian equilibration will be utilized in the equation block solvers to improve linear solver accuracy.
use_newton_for_brentboolean / trueIf enabled, a few Newton steps are computed to get a better initial guess for Brent.
block_solver_experimental_ modeinteger / 0Activates experimental features of equation block solvers