Using Simulink    

Subsystems

Simulink allows you to model a complex system as a set of interconnected subsystems each of which is represented by a block diagram.You create a subsystem using the Subsystem block and the Simulink model editor. You can embed subsystems within subsystems to any depth to create hierarchical models. You can create conditionally executed subsystems that are executed only when a transition occurs on a triggering or enabling input (see Creating Conditionally Executed Subsystems).

Custom Blocks

Simulink allows you to create libraries of custom blocks that you can then use in your models. You can create a custom block either graphically or programmatically. To create a custom block graphically, you draw a block diagram representing the block's behavior, wrap this diagram in an instance of the Simulink Subsystem block, and provide the block with a parameter dialog, using the Simulink block mask facility. To create a block programmatically, you create an M-file or a MEX-file that contains the block's system functions (see Writing S-Functions). The resulting file is called an S-function. You then associate the S-function with instances of the Simulink S-Function block in your model. You can add a parameter dialog to your S-Function block by wrapping it in a Subsystem block and adding the parameter dialog to the Subsystem block.

Signals

Simulink uses the term signal to refer to the output values of blocks. Simulink allows you to specify a wide range of signal attributes, including signal name, data type (e.g., 8-bit, 16-bit, or 32-bit integer), numeric type (real or complex), and dimensionality (one-dimensional or two-dimensional array). Many blocks can accept or output signals of any data or numeric type and dimensionality. Others impose restrictions on the attributes of the signals they can handle.

Data Types

The term data type refers to the internal representation of data on a computer system. Simulink can handle parameters and signals of any built-in data type supported by MATLAB, such as int8, int32, and double (see Working with Data Types). Further, Simulink defines two Simulink-specific data types:

These Simulink-specific data types capture Simulink-specific information that is not captured by general-purpose numeric types such as int32. Simulink allows you to create and use instances of Simulink data types, called data objects, as parameters and signals in Simulink models.

You can extend both Simulink data types to create data types that capture information specific to your models.

Solvers

A Simulink model specifies the time derivatives of its continuous states but not the values of the states themselves. Thus, when simulating a system, Simulink must compute continuous states by numerically integrating their state derivatives. There are a variety of general-purpose numerical integration techniques, each having advantages in specific applications. Simulink provides implementations, called ordinary differential equation (ODE) solvers, of the most stable, efficient, and accurate of these numerical integration methods. You can specify the solver to use in the model or when running a simulation.


  Continuous Versus Discrete Blocks Simulating Dynamic Systems