Using Simulink    

The Advanced Pane

The Advanced pane allows you to set various options that affect simulation performance.

Model parameter configuration

Inline parameters.   By default you can modify ("tune") many block parameters during simulation (see Tunable Parameters). Selecting this option makes all parameters nontunable by default. Making parameters nontunable allows Simulink to move blocks whose outputs depend only on block parameter values outside the simulation loop, thereby speeding up simulation of the model and execution of code generated from the model. When this option is selected, Simulink disables the parameter controls of the block dialog boxes for the blocks in your model to prevent you from accidentally modifying the block parameters.

Simulink allows you to override the Inline parameters option for parameters whose values are defined by variables in the MATLAB workspace. To specify that such a parameter remain tunable, specify the parameter as global in the Model Parameter Configuration dialog box (see Model Parameter Configuration Dialog Box). To display the dialog, select the adjacent Configure button. To tune a global parameter, change the value of the corresponding workspace variable and choose Update Diagram (Ctrl+D) from the Simulink Edit menu.

Optimizations

Block reduction.   Replaces a group of blocks with a synthesized block, thereby speeding up execution of the model.

Boolean logic signals.   Causes blocks that accept Boolean signals to require Boolean signals. If this option is off, blocks that accept inputs of type boolean also accept inputs of type double. For example, consider the following model.

This model connects signals of type double to a Logical Operator block, which accepts inputs of type boolean. If the Boolean logic signals option is on, this model generates an error when executed. If the Boolean logic signals option is off, this model runs without error.

Conditional input branch.   This optimization applies to models containing Switch and Multiport Switch blocks. When enabled, this optimization executes only the blocks required to compute the control input and the data input selected by the control input at each time step for each Switch or Multiport Switch block in the model. Similarly, code generated from the model by RTW executes only the code needed to compute the control input and the selected data input. This optimization speeds simulation and execution of code generated from the model.

At the beginning of the simulation or code generation, Simulink examines each signal path feeding a switch block data input to determine the portion of the path that can be optimized. The optimizable portion of the path is that part of the signal path that stretches from the corresponding data input back to the first block that is a nonvirtual subsystem, has continuous or discrete states, or detects zero crossings.

Simulink encloses the optimizable portion of the signal path in an invisible atomic subsystem. During simulation, if a switch data input is not selected, Simulink executes only the nonoptimizable portion of the signal path feeding the input. If the data input is selected, Simulink executes both the nonoptimizable and the optimizable portion of the input signal path.

Parameter pooling..   This option is used for code generation (see the Real-Time Workshop documentation for more information). Leave this option on if you are not doing code generation.

Signal storage reuse.   Causes Simulink to reuse memory buffers allocated to store block input and output signals. If this option is off, Simulink allocates a separate memory buffer for each block's outputs. This can substantially increase the amount of memory required to simulate large models, so you should select this option only when you need to debug a model. In particular, you should disable signal storage reuse if you need to

Simulink opens an error dialog if Signal storage reuse is enabled and you attempt to use a floating Scope or Display block to display a signal whose buffer has been reused.

Zero-crossing detection.   Enables zero-crossing detection during variable-step simulation of the model. For most models, this speeds up simulation by enabling the solver to take larger time steps. If a model has extreme dynamic changes, disabling this option can speed up the simulation but can also decrease the accuracy of simulation results. See Zero-Crossing Detection for more information.

You can override this optimization on a block-by-block basis for the following types of blocks.

Abs
Integrator
Step
Backlash
MinMax
Switch
Dead Zone
Relay
Switch Case
Enable
Relational Operator
Trigger
Hit Crossing
Saturation

If
Sign

To override zero-crossing detection for an instance of one of these blocks, open the block's parameter dialog box and uncheck the Enable zero crossing detection option. You can enable or disable zero-crossing selectively for these blocks only if zero-crossing detection is enabled globally, i.e., Zero-crossing optimization is selected on the Advanced pane of the Simulation Parameters dialog box.

Model Verification block control

This parameter allows you to enable or disable model verification blocks in the current model either globally or locally. Select one of the following options:

Model Parameter Configuration Dialog Box

The Model Parameter Configuration dialog box allows you to override the Inline parameters option (see Model parameter configuration) for selected parameters.

The dialog box has the following controls.

Source list..   Displays a list of workspace variables. The options are

Refresh list.   Updates the source list. Click this button if you have added a variable to the workspace since the last time the list was displayed.

Add to table.   Adds the variables selected in the source list to the adjacent table of tunable parameters.

New.   Defines a new parameter and adds it to the list of tunable parameters. Use this button to create tunable parameters that are not yet defined in the MATLAB workspace.

Storage Class.   Used for code generation. See the Real-Time Workshop documentation for more information.

Storage type qualifier.   Used for code generation. See the Real-Time Workshop documentation for more information.

Production Hardware Characteristics

This setting is intended for use in modeling, simulating, and generating code for digital systems. It allows you to specify the sizes of the data types supported by the system being modeled. Simulink uses this information to automate the choice of data types for signals output by some blocks, e.g., the Product and Gain blocks.

Select one of the following settings from the list:


  The Diagnostics Pane Diagnosing Simulation Errors