Prev | Next |
Working with SysPhS Components
If you are working with an example model held in Modelica or Simulink and you want to refer - in Enterprise Architect - to components that already exist in that model, you can drag the appropriate Block, Parameter or Port element-types from the Toolbox onto a diagram to create the referring elements.
Displaying Properties and Parts
A point to note when working with Properties and Parts in a SysML diagram is that their default display is as Part object. They can be left in that rendering or set to show as text in compartments. Here is an example of both:

Properties 1, 2, 3 and 5 have been dragged onto the diagram as elements that were then deleted from the diagram (but not from the Browser window). On deletion, they were replaced on the diagram by text entries in their respective Block compartments. Property 4 was left on the diagram as a Part element; if deleted from the diagram, it would also become a text entry in a compartment.
Block Element-type
Dragging a Modelica or Simulink Block-type onto a diagram creates a non-specific SysPhS Block. To set this Block to a specific Modelica or Simulink Block, set the 'Name' field under the SimulinkBlock ( SysPhS ) or ModelicaBlock ( SysPhS ) segment in the Properties window.

For more details on referencing the Simulink and Modelica Properties in these external tools, see the Creating Modelica Specific Blocks and Creating Simulink Specific Blocks Help topics.
Note: As shown in the image, the two SysPhS Stereotypes can both be applied if you want to simulate the model in both external tools. See the Setting Blocks as Both Modelica and Simulink Help topic.
Parameter Element-type
The Parameter element-type creates Property elements with SimulinkParameter or ModelicaParameter stereotypes. If you delete the elements from the diagram, they are listed in the phs constants compartment of the parent Block element. Here is an example of a SysPhS Parameter set to both Modelica and Simulink, showing a stereotype for each as well as a reference to the respective product's Parameter name in the 'Name' fields.

PhsConstant and PhsVariable
To define constant and variable properties of a Block element you can drag the 'PhS Constant' and 'PhS Variable' icons onto an element in the diagram. Again, if you delete the elements from the diagram they are listed in the phs constants or phs variables compartment.
When setting the value of constants in the model, the values can be set in the Block or in a Part derived from the Block. In the case of, say, gravity as an absolute constant, this is best defined in the Block. The values from the Part or Block can be further altered in the Simulation properties.
The next illustration shows the Fluid Density set for water, which could be overridden in the Part or the simulation to define the density of another fluid (e.g. oil). Where a Block is used repetitively with different values - e.g. one resistor of say 3.3 kohms and another of 5.6 kohms, then the initial value is best defined in the specific Parts, in the IBD, which are derived from a Block that has no initial value.

The 'Properties > Property' tab has two fields:
- Type
- Initial
The type can be set as a standard type or, as in this case, as SysML ValueType referenced in the model.
Note that if a PhsConstant or a PhsVariable has an initial value set, it is displayed on the diagram in an initial value compartment of the element.