Initialization Script

An initialization script provides a means for you to define OML variables and functions for a simulation.

On top of the main diagram context, the software applies an initialization script, which is yet another OML script that is executed at the beginning of the simulation process. The main purpose of this script is to define the variables or functions that are required throughout the model during a simulation.

Define Initialization Variables and Functions

Create a script with the OML variables and functions, such as the simulation final time, that you want to be available for a simulation .

  1. From the ribbon, select the the Model Initialization and Properties tool:


    The Model dialog opens.
  2. Select the Initialization tab.
  3. In the OML editor, enter the initialization information for your model. You can include any valid OML command such as a variable definition or function definition/execution.


    Alternatively, if you want to load an existing initialization file, select and navigate to the .oml script you want to load.