Components
Specifying Component Parameters
Every component has a dialog box to view and modify the component parameters. To open the parameter dialog, double-click on a component or select the component and choose Parameters... from the Edit menu or the component's context menu.
Most component parameters accept MATLAB expressions as values, provided that they evaluate to an acceptable result. Parameter expressions are evaluated when you start a simulation or update the Simulink model. In case an error occurs during evaluation of the parameters, an error dialog appears and the corresponding component is highlighted.
An exception to this behavior are parameters that affect the appearance of the component such as the parameter Number of windings of the Mutual Inductor or the parameter Width of the Wire Multiplexer. Such parameters must be literal values and are evaluated immediately.
Integer values may be specified as decimal, binary or hexadecimal values. Hexadecimal integers are prefixed by 0x, binary integers are prefixed by 0b. The expressions 0xfa and 0b11111010, for example, both evaluate to 250.
Using Workspace Variables in Parameter Expressions
Parameter expressions that are not evaluated immediately can include MATLAB variables. Expressions are evaluated as a whole in one workspace. By default, the evaluation workspace is the MATLAB base workspace. However, you can define local mask workspaces for subsystems that will then be used for the parameter evaluation in the underlying schematics. For information on subsystem mask workspaces see Mask Parameters.
You can also mask the Circuit block as a whole. This is necessary e.g. if you want parameter expressions to be evaluated in the Simulink model workspace, or when you use the sim command from within a MATLAB function and want to access the function workspace. For more information see Customizing the Circuit Block.
Displaying Parameters in the Schematic
You can cause PLECS to display any component parameter beneath the block icon in the schematic. You specify the parameters to be displayed using the check boxes next to the edit fields in the dialog box. Parameter values can be edited in the schematic directly by double-clicking them.
Changing Parameters of Multiple Components
You can simultaneously change the parameters of multiple components of the same type. To do so, select the components, then double-click any of them or choose Parameters... from the Edit menu or the components' context menu.
In the parameter dialog for multiple components, parameters, for which the selected components have different values, show a placeholder text multiple values. If you leave this placeholder as is, the components retain their individual values for this parameter when you apply any other changes that you have made.
Changing Parameters During a Simulation
Parameters are evaluated once a new simulation is started. Their values remain constant throughout the simulation. Certain parameters can be changed during the simulation, their value is used as soon as the change is applied. Depending on the parameter type it may be necessary to reevaluate other parts of the model, which may take some extra computation time.
Parameters are changeable during the simulation if they do not change the structure of the model. If, for example, a parameter value is a vector the elements of the vector may be changed, whereas the size of the vector must remain the same. Parameters that influence the number of terminals of a component or the width of a signal cannot be changed during simulation.
Changing Component Names
Component names are edited by double-clicking them in the schematic. To show or hide a component name, toggle Show name in the Format menu.
All component names in the same schematic must be unique and must contain at least one non-space character. Trailing spaces are removed from the names.
Changing the Orientation of Components
You can change the orientation of a component by choosing one of these commands from the Format menu:
- The Rotate command rotates a component clockwise 90 degrees (Ctrl-R).
- The Flip left/right command flips a component horizontally (Ctrl-F).
- The Flip up/down command flips a component vertically (Ctrl-I).
Note Unlike in Simulink, flipping a component is not equivalent to rotating it 180 degrees.
Getting Component Help
Use the Help button in the dialog box to get online help about the component.