applySolverOptions

Apply the standard and user-defined solver options onto a MATLAB ode() object.

Source: src/simulator/applySolverOptions.m

Syntax

F = applySolverOptions(F, opt)
F = applySolverOptions(F, opt, defaults)

Description

applySolverOptions configures a MATLAB ode() object under construction by merging three layers of options, where later sources win:

  1. built-in standards — universal tolerances (AbsoluteTolerance = 1e-6, RelativeTolerance = 1e-3). The solver is intentionally not set here, as it is scheme-specific.
  2. scheme defaults — the per-scheme standards passed in defaults, e.g. the mss ODE scheme supplies ode45 and the mdss DAE scheme ode15i.
  3. user options — the caller’s opt.

Both a legacy odeset struct (AbsTol, RelTol, MaxStep, …) and a new ode()-style struct (AbsoluteTolerance, Solver, MaxOrder, …) are accepted; the recognised aliases are resolved to the ode() property names. Only non-empty values are applied, and unknown property names are ignored.

Defaults

The built-in standards set only the two tolerances; everything else is left to the scheme defaults or the user opt (and unset otherwise).

Option Built-in default
AbsoluteTolerance 1e-6
RelativeTolerance 1e-3
Solver (none — supplied by the scheme defaults, e.g. ode45 for mss, ode15i for mdss)
InitialStep, MaxStep, MinStep, NormControl, OutputFcn, OutputSelection, Vectorization, MaxOrder (none — applied only if given in defaults or opt)

Input arguments

Argument Description
F A MATLAB ode() object under construction.
opt User solver options, overriding the defaults. May be empty ([]), a legacy odeset struct, or a new ode()-style struct.
defaults (optional) Scheme-specific standards, e.g. struct('Solver',"ode45") for the mss ODE scheme or struct('Solver',"ode15i") for the mdss DAE scheme.

Output arguments

Output Description
F The ode() object with the resolved options applied.

See also

msim · continuousTimeMdss · discreteTimeMdss


MyToolbox Documentation | Generated automatically by CI/CD pipeline