Simulation settings

Select Simulation | Simulation Settings, click the Simulation Settings tool bar button or press F6 to open this window.

The simulation settings window contains four pages:

General

Here you specify the start and the end times for the simulation and output options.

Simulation time

  • Start Time - This setting specifies the start time of the simulationMost often this value will be left at zero (default value), but there might be cases where another value is required. Default value = 0

  • End Time - This setting specifies the stop time of the simulation. Default value = 100

  • Time unit - Select the time unit for the simulation.

Simulation outputs

  • Output option – By default, the time vector returned from a simulation contains the exact time steps the ODE-solver has chosen. For difficult numerical solutions the number of time points may be very many. Also, it might be of interest to the user to get values for specific time points. The three output options are:

    • Produce no additional output - The time vector will only contain the time steps chosen by the ODE solver. This is the default setting.
    • Produce additional output - The time vector will contain both the time steps chosen by the ODE solver and the time points given in Time Series. Use this setting when your Model contains discrete events to force the ODE solver to include those time points.
    • Produce specified output only - The time vector will contain only the time points given Time Series. This setting will greatly decrease memory consumtion and will improve simulation speed.
Note For probabilistic, sensitivity analysis and simulation table simulations the output option should be Produce specified output only, otherwise only the start and end time is included in the result. A warning message will be presented in the Errors window. This is to limit the amount of data produced and to guarantee that the same time vector is returned from all simulations.
  • Time series – This field is only available when the output option is set to either ‘Produce additional output’ or ‘Produce specified output’. To create a time series click the Add button. From the window that appears select the type of time series you want to create using the drop-down list. You can add as many time series as you want. However, the possibility to add more than one time series is typically only used when you wish to combine a linear/geometric time series with some custom time points. To remove a time series just click the time series to be deleted and click the Remove button.

    • If you select ‘Custom’, enter the time points in the Time point field separated with commas or blank space.
    • If you select ‘Linear’ or ‘Geometric’ time series enter the first and the last time in the Min and Max box respectively. Enter the number of times points in the N box. For example: Start = 5, End = 10, N = 6, Type = Linear will give a time series with the values 5,6,7,8,9 and 10.

In the case of the Linear time series the default value for the Min time is set to the Start Time and for the Max time is set to the End Time. In the case of the ‘Geometric’ time series the default values for the Min and the Max times is set to auto. * If you select ‘Linear Increment’ time series, enter the first and the last time in the Min and Max box respectively. Enter the increment in the increment box. The default value for the Min time is set to the Start Time and for the Max time is set to the End Time. For example: Start = 5, End = 10, Increment = 2.5 will return a time series with the values 5, 7.5 and 10.

  • Discrete points - If there are time points that you wish to force the solver to include you can add these here. For instance, if you have conditions at specific time points it might be a good idea to include these time points here so that the solver does not “step over” an important phase of the simulation.

  • Add table points - When selected, all time points from lookup tables are added as discrete time points.

Outputs

SimulationOutputs2.png

Note By default, values for all enabled blocks and parameters for all enabled materials will be returned from the simulation. To exclude materials from the simulation you must enable/disable them in the materials window.

The output page lets you choose simulation endpoints. All blocks of the project are displayed and are organized by sub-system. By selecting/unselecting either endpoints or whole sub-system nodes, you determine which simulation outputs will be available after the simulation is finished.

By removing simulation outputs the simulation time and memory consumption decreases. Also, the list of results will be shorter which makes it easier when creating charts and tables.

As soon as a new block is added to the model, it is also added to the list of outputs.

Solver

(ODE toolbox) The solver page lets you select numerical solver and edit it’s settings.

For more information on solver settings see Solver settings.

Batches

(ODE toolbox) This page lets you set up simulation batches which can improve the simulation time drastically.

  • Batch mode - Select to run simulation batches

  • Independent batches - Only allow independent batches.

  • Join compartments - Create one batch for each compartment (if possible). All materials of each compartment will be run together.

  • Join materials - Create one batch for each material (if possible). All compartments will be run together for each material.

  • Preview - Shows the batches created following the settings provided above.

Advanced

  • Use cache - When set, the results of calculations for the current time point is stored. This will cause a small overhead, and might require more memory, but will in general provide faster simulation speeds.

  • Use internal cache - When set, variables that used several times in the same expression will be cached locally prior to the calculation of the expression. Using an internal cache causes slighlty larger models but can give faster simulation speeds.

  • Debug mode - When a simulation is run in debug mode, extra checks are added for NaN and infinite values. When the calculations for one object returns NaN or Infinity, the simulation is aborted and an error message is displayed. Also, statistics of the solver performance is displayed after a simulation completes. The debug option can also be set in the simulation preferences window and is global (not project specific).

See also