Main Content

SolverType

Select solver type for simulation

Description

The SolverType property lets you specify the solver to use for a simulation. For a discussion about solver types, see Choosing a Simulation Solver.

Changing the solver type changes the options (properties) specified in the SolverOptions property of the configset object. If you change any SolverOptions, these changes are persistent when you switch SolverType. For example, if you set the ErrorTolerance for the expltau solver and then change to impltau when you switch back to expltau, the ErrorTolerance will have the value you assigned.

Characteristics

Applies toObject: Configset
Data typeenum
Data values'ode15s', 'ode23t', 'ode45', 'sundials', 'ssa', 'expltau', 'impltau'. Default is 'ode15s'.

Note

  • If your model contains events, you cannot specify 'expltau' or 'impltau' for the SolverType property.

  • If your model contains doses, you cannot specify 'ssa', 'expltau', or 'impltau' for the SolverType property.

  • If your model contains algebraic rules, you cannot use 'ode45'.

  • SimBiology always uses the SUNDIALS solver to perform sensitivity analysis on a model, regardless of what you have selected as the SolverType in the configuration set.

AccessRead/write

Examples

  1. Retrieve the configset object from the modelObj.

    modelObj  = sbiomodel('cell');
    configsetObj = getconfigset(modelObj)
    
    
    Configuration Settings - default (active)
         SolverType:                  ode15s
         StopTime:                    10.000000
    
       SolverOptions:
         AbsoluteTolerance:           1.000000e-006
         RelativeTolerance:           1.000000e-003
         SensitivityAnalysis:         false
    
       RuntimeOptions:
         StatesToLog:                 all
    
       CompileOptions:
         UnitConversion:              false
         DimensionalAnalysis:         true
    
       SensitivityAnalysisOptions:
         Inputs:                      0
         Outputs:                     0
  2. Configure the SolverType to ode45.

    set(configsetObj, 'SolverType', 'ode45')
    configsetObj
    
       Configuration Settings - default (active)
         SolverType:                  ode45
         StopTime:                    10.000000
    
       SolverOptions:
         AbsoluteTolerance:           1.000000e-006
         RelativeTolerance:           1.000000e-003
         SensitivityAnalysis:         false
    
       RuntimeOptions:
         StatesToLog:                 all
    
       CompileOptions:
         UnitConversion:              false
         DimensionalAnalysis:         true
    
       SensitivityAnalysisOptions:
         Inputs:                      0
         Outputs:                     0

See Also

getconfigset, set