**Table A.1. Compiler options**

Option | Option type / Default value | Description |
---|---|---|

`automatic_tearing` | `boolean` / `true` | If enabled, then automatic tearing of equation systems is performed. |

`c_compiler` | `string` / `'gcc'` | The C compiler to use to compile generated C code. |

`check_inactive_ contitionals` | `boolean` / `false` | If enabled, check for errors in inactive conditional components when compiling. When using check mode, this is always done. |

`component_names_in_errors` | `boolean` / `false` | If enabled, the compiler will include the name of the component where the error was found, if applicable. |

`convert_free_dependent_ parameters_to_algebraics` | `boolean` / `true` | If enabled, then free dependent parameters are converted to algebraic variables. |

`divide_by_vars_in_tearing` | `boolean` / `false` | If 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_ extraction` | `boolean` / `false` | Looks 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_ evaluation` | `integer` / `5000` | Time limit (ms) when evaluating constant calls to external functions during compilation. 0 indicates no evaluation. -1 indicates no time limit. |

`generate_block_jacobian` | `boolean` / `false` | If enabled, then code for computing block Jacobians is generated. If blocks are needed to compute ODE jacobians they will be generated anyway |

`generate_dae_jacobian` | `boolean` / `false` | If enabled, then code for computing DAE Jacobians are generated. |

`generate_html_diagnostics` | `boolean` / `false` | If enabled, model diagnostics are generated in HTML format. This includes the flattened model, connection sets, alias sets and BLT form. |

`generate_mof_files` | `boolean` / `false` | If enabled, then flat model before and after transformations will be generated. |

`generate_ode_jacobian` | `boolean` / `false` | If enabled, then code for computing ODE Jacobians are generated. |

`generate_only_initial_ system` | `boolean` / `false` | If enabled, then only the initial equation system will be generated. |

`halt_on_warning` | `boolean` / `false` | If enabled, compilation warnings will cause compilation to abort. |

`index_reduction` | `boolean` / `true` | If enabled, then index reduction is performed for high-index systems. |

`nonlinear_solver` | `string` / `'kinsol'` | Decides which nonlinear equation solver to use. Alternatives are 'kinsol or `'minpack'` . |

`relational_time_events` | `boolean` / `true` | If enabled, then relational operators are allowed to generate time events. |

`state_initial_equations` | `boolean` / `false` | If enabled, the compiler ignores initial equations in the model and adds parameters for controlling intitial values of states.Default is `false` . |

`state_start_values_fixed` | `boolean` / `false` | If 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_ equations` | `boolean` / `true` | If 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. |

`cc_extra_flags` | `string` / `':O1'` | Optimization level for c-code compilation |

`cc_extra_flags_applies_to` | `string` / `'functions'` | Parts of c-code to compile with extra compiler flags specified by `ccompiler_extra_flags` |

`common_subexp_elim` | `boolean` / `true` | If enabled, the compiler performs a global analysis on the equation system and extract identical function calls into common equations. |

`diagnostics_limit` | `integer` / `500` | This 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_states` | `boolean` / `true` | If enabled, dynamic states will be calculated and generated. |

`eliminate_alias_parameters` | `boolean` / `false` | If enabled, then alias parameters are eliminated from the model. |

`eliminate_alias_variables` | `boolean` / `true` | If enabled, then alias variables are eliminated from the model. |

`enable_structural_ diagnosis` | `boolean` / `true` | If enabled, structural error diagnosis based on matching of equations to variables is used. |

`enable_variable_scaling` | `boolean` / `false` | If enabled, then the `'nominal'` attribute will be used to scale variables in the model. |

`equation_sorting` | `boolean` / `true` | If enabled, then the equation system is separated into minimal blocks that can be solved sequentially. |

`export_functions` | `boolean` / `false` | Export 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_vba` | `boolean` / `false` | Create VBA-compatible wrappers for exported functions. Requires the option `export_functions` . |

`external_constant_ evaluation_max_proc` | `integer` / `10` | The 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_ computation` | `string` / `'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_type` | `string` / `'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_within` | `boolean` / `false` | If enabled, ignore within clauses both when reading input files and when error-checking. |

`inline_functions` | `string` / `'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_tearing` | `string` / `'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_proc` | `integer` / `4` | The maximum number of processes used during c-code compilation. |

`normalize_minimum_time_ problems` | `boolean` / `true` | If 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_derivatives` | `boolean` / `true` | If 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_propagation` | `boolean` / `true` | If enabled, the compiler performs a global analysis on the equation system and reduces variables to constants and parameters where applicable. |

`write_iteration_variables_ to_file` | `boolean` / `false` | If 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_ file` | `boolean` / `false` | If 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_functions` | `boolean` / `false` | If enabled, convert algorithm sections to function calls. |

`disable_smooth_events` | `boolean` / `false` | If enabled, no events will be generated for smooth operator if order equals to zero. |

`event_indicator_scaling` | `boolean` / `false` | If enabled, event indicators will be scaled with nominal heuristics |

`generate_event_switches` | `boolean` / `true` | If enabled, event generating expressions generates switches in the c-code. Setting this option to `false` can give unexpected results. |

`cs_rel_tol` | `real` / `1.0E-6` | Tolerance for the adaptive solvers in the Co-Simulation case. |

`cs_solver` | `integer` / `0` | Specifies the internal solver used in Co-Simulation. 0 - CVode, 1 - Euler. |

`cs_step_size` | `real` / `0.001` | Step-size for the fixed-step solvers in the Co-Simulation case. |

`enforce_bounds` | `boolean` / `true` | If enabled, min / max bounds on variables are enforced in the equation blocks. |

`iteration_variable_scaling` | `integer` / `1` | Scaling 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_level` | `integer` / `3` | Log level for the runtime: 0 - none, 1 - fatal error, 2 - error, 3 - warning, 4 - info, 5 - verbose, 6 - debug. |

`nle_solver_default_tol` | `real` / `1.0E-10` | Default tolerance for the equation block solver. |

`nle_solver_max_residual_ scaling_factor` | `real` / `1.0E10` | Maximal scaling factor used by automatic and hybrid residual scaling algorithm. |

`nle_solver_min_residual_ scaling_factor` | `real` / `1.0E-10` | Minimal scaling factor used by automatic and hybrid residual scaling algorithm. |

`rescale_after_singular_jac` | `boolean` / `true` | If enabled, scaling will be updated after a singular jacobian was detected (only active if automatic scaling is used). |

`rescale_each_step` | `boolean` / `false` | If enabled, scaling will be updated at every step (only active if automatic scaling is used). |

`residual_equation_scaling` | `integer` / `1` | Equations scaling mode in equation block solvers: 0 - no scaling, 1 - automatic scaling, 2 - manual scaling, 3 - hybrid. |

`runtime_log_to_file` | `boolean` / `false` | If 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_1d` | `boolean` / `true` | If enabled, Brent search will be used to improve accuracy in solution of 1D non-linear equations. |

`events_default_tol` | `real` / `1.0E-10` | Default tolerance for the event iterations. |

`events_tol_factor` | `real` / `1.0E-4` | Tolerance safety factor for the event indicators. Used when external solver specifies relative tolerance. |

`nle_brent_ignore_error` | `boolean` / `false` | If enabled, the Brent solver will ignore convergence failures. |

`nle_solver_check_jac_cond` | `boolean` / `false` | If enabled, the equation block solver computes and log the jacobian condition number. |

`nle_solver_max_iter` | `integer` / `100` | Maximum number of iterations for the equation block solver. |

`nle_solver_min_tol` | `real` / `1.0E-12` | Minimum 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_ tolerance` | `real` / `-1.0` | Tolerance for deciding when regularization should be activated (i.e. when condition number > reg tol). |

`nle_solver_step_limit_ factor` | `real` / `10.0` | Factor limiting the step-size taken by the nonlinear solver. |

`nle_solver_tol_factor` | `real` / `1.0E-4` | Tolerance safety factor for the equation block solver. Used when external solver specifies relative tolerance. |

`nle_solver_use_last_ integrator_step` | `boolean` / `true` | If enabled, the intial guess for the iteration variables will be set to the iteration variables from the last integrator step. |

`nle_solver_use_nominals_as_ fallback` | `boolean` / `true` | If enabled, the nominal values will be used as initial guess to the solver if initialization failed. |

`use_jacobian_equilibration` | `boolean` / `false` | If enabled, jacobian equilibration will be utilized in the equation block solvers to improve linear solver accuracy. |

`use_newton_for_brent` | `boolean` / `true` | If enabled, a few Newton steps are computed to get a better initial guess for Brent. |

`block_solver_experimental_ mode` | `integer` / `0` | Activates experimental features of equation block solvers |

`cs_experimental_mode` | `integer` / `0` | Activates experimental features of CS ode solvers |