Subsystem
Purpose
Create functional entity in hierarchical simulation model
Library
System
Description
A subsystem block represents a system within another system. In order to create a subsystem, copy the subsystem block from the library into your schematic. You can then open the subsystem block and copy components into the subsystem's window.
The input, output, and physical terminals on the block icon correspond to the input, output, and physical port blocks in the subsystem's schematic. If the block names are not hidden, they appear as terminal labels on the subsystem block.
You can move terminals with the mouse around the edges of the subsystem by holding down the Shift key while dragging them with the left mouse button or by using the middle mouse button.
Virtual and Atomic Subsystems
By default, PLECS treats subsystems as virtual, which means that they only represent a graphical grouping of the components that they comprise. At simulation start, virtual subsystems are flattened and the components they comprise are ordered individually when PLECS determines their proper execution order (see Block Sorting).
In an atomic subsystem, on the other hand, the components are not only grouped graphically but they are also executed as a group. This is necessary if the execution depends on a condition such as a common sample time or an enable and/or a trigger signal (see the Enable block and the Trigger block).
Whether a subsystem is virtual or atomic is controlled by the subsystem execution settings.
Note A subsystem that has physical terminals cannot be made atomic.
Execution
Settings
To open the dialog for editing the subsystem settings, select the block, then choose Execution settings... from the Subsystem submenu of the Edit menu or the block's context menu.
- Treat as atomic unit
- If this parameter is checked, PLECS treats the subsystem as atomic, otherwise as virtual (see "Virtual and Atomic Subsystems" above).
- Minimize occurrence of algebraic loops
- This parameter only applies to atomic
subsystems. If it is unchecked, PLECS assumes that all inputs of the subsystem
have direct feedthrough, i.e. the output functions of the blocks feeding these
inputs must be executed before the output function of the subsystem itself can
be executed (see Block Sorting). If the atomic subsystem is part of a feedback
loop this can result in algebraic loop errors where a virtual subsystem could be
used without problems.
If the parameter is checked, PLECS determines the actual feedthrough behavior of the individual inputs from the internal connectivity. A subsystem input that is internally only connected to non-direct feedthrough inputs of other blocks (e.g. the inputs of Integrator, Memory or Delay blocks) does not have direct feedthrough. This can help reduce the occurrence of algebraic loops.
- Sample time
- This parameter only applies to atomic subsystems and specifies the sample time, with which the subsystem and the components that it comprises are executed.
Parameters
You can create a dialog box for your Subsytem by masking the block (see Mask Parameters for more details).