Introduction
The «PhSConstant» and «PhSVariable» stereotypes extend the Property metaclass (see the figure below) for physical interaction and signal flow simulation. Simulation modeling specifies how numeric and boolean variable values can change in more detail than in system models. Simulation modeling distinguishes numeric variables with values that can change continuously (possibly infinitesimally) over time from those that always change discretely (finitely), possibly only at regular intervals. It also identifies variables with values that can only change between simulations (constants), rather than during simulations. For mode details, read the OMG SysPhS specification.
Simulation stereotypes.
Using the «PhSConstant» stereotype
Apply a «PhSConstant» stereotype to a SysML property if it has a fixed value and will not change during simulation. It is exported as a Modelica/Simulink parameter.
Block properties stereotyped by «PhSConstant» must:
- Be typed by Real, Integer, or Boolean, or one of their specializations.
- Have a multiplicity of 1, unless they are also stereotyped by a MultidimensionalElement.
- Not redefine more than one other property, which must have the same name and type and must be stereotyped by a «PhSVariable» or «PhSConstant».
In the example below, the «PhSConstant» stereotype is applied for the C1 Value Property of the HeatingCalculation Block and specificHeat, waterVolume Value Property of the TemperatureIncrease Block.
Usage of the «PhSConstant» and «PhSVariable» stereotypes.
Using the «PhSVariable» stereotype
Apply the «PhSVariable» stereotype if you want to mark property as a Modelica/Simulink variable and fill in the appropriate tags (isContinuous, isConserved and changeCycle) if needed.
The descriptions of the «PhSVariable» stereotype tags:
- isContinuous - determines whether the property value varies continuously or discretely.
- isConserved - determines whether values of the property value are conserved or not.
- changeCycle - specifies the time interval at which a discrete property value may change.
Follow the rules below when applying «PhSVariable» stereotype:
- The property must be typed by Real, Integer, or Boolean, or one of their specializations.
- isContinuous may be true only when the stereotyped property is typed by Real or one of its specializations.
- isConserved may be true only when isContinuous is true and the stereotyped property is on a block specialized from ConservedQuantityKind.
- changeCycle may be other than zero only when isContinuous is false.
- changeCycle must be positive or zero.
- A property stereotyped by «PhSVariable» must not be stereotyped by «PhSConstant».
- Properties stereotyped by «PhSVariable» must have a multiplicity of 1, unless they are also stereotyped by MultidimensionalElement.
- Flow properties stereotyped by «PhSVariable» that are connected and matching must have opposite directions (in/out or out/in), the same type and multiplicity, and the same value for isContinuous on the applied stereotype.
- Flow properties stereotyped by «PhSVariable» that have an "in" direction may connect to and match no more than one other flow property stereotyped by «PhSVariable».
- A property stereotyped «PhSVariable» can redefine at most one other property. It must have the same name and type and must be stereotyped by «PhSVariable».
- When a property stereotyped by «PhSVariable» with isContinuous=true redefines another property, the «PhSVariable» applied to the redefined property must have isContinuous=true.
- When a property stereotyped by «PhSVariable» with isContinuous=false redefines another property stereotyped by «PhSVariable» with isContinuous=false, the redefining property’s changeCycle must be an integer multiple of the redefined property’s changeCycle.
As an example, see the figure above, where the «PhSVariable» stereotype is applied for the xlntg Value Property of the HeatingCalculation Block.
Related pages