**Understanding Parametric Diagram**

In this blog post, we will take a closer look at constraint, one of the important elements of SysML (Block Definition Diagram) and Paramteric Diagram.

**Parametric Modeling in SysML: Integrating Constraints and Analysis**

**SysML and the role of constraint blocks**

SysML is a key tool for system modeling. In particular, the ability to model equations and inequalities as constraint blocks plays an important role in managing the complexity of system design. These constraint blocks encapsulate the equations or inequalities to be modeled, allowing specific mathematical relationships to be defined and enforced within the system.

**The power of parametric models**

Parametric models are an essential part of system design. This model can be used to analyze and optimize critical properties such as performance, reliability, and physical properties of the system. By applying constraints to your model, you gain the ability to specify assertions about system values that are valid within the operating system, detect exceptional conditions, and more. You can also use blocks in your system model to provide input (and capture output) for engineering analysis and simulation during the design phase.

**Parametric diagrams: visualization of complex connections**

Parametric diagrams are used to visualize complex connections between constraints and value properties. This diagram shows the binding between constraint parameters and value properties, applying a fixed mathematical relationship to the value properties of the block. It allows you to create complex systems of equations or inequalities and “connect” these mathematical models to various parts of the system model.

**Purpose of parametric diagrams**

Parametric diagrams serve two purposes:

- Create complex systems of equations (or inequalities) by showing bindings between constraint parameters of various constraint expressions.
- Displays bindings between constraint parameters and value properties to apply constraint expressions to blocks. This applies a fixed mathematical relationship to a set of value properties.

**Relationship between parametric diagrams and BDD**

BDD and parametric diagrams are complementary to each other, and both play a very important role in SysML modeling. BDDs show the definition and composition of blocks and constraint blocks, while parametric diagrams show the actual use of these blocks and the specific bindings between value properties and constraint parameters. These diagrams help you understand and analyze complex systems more clearly.

**Relationship between parametric diagrams and IBD**

Parametric diagrams are a special form of internal block diagram (IBD) that focus on the internal structure of a block and the bindings between constraint parameters. These diagrams, along with Block Definition Diagrams (BDDs), provide a complementary view of blocks. These perspectives are essential for understanding and analyzing various aspects of a system.

**Constraint Blocks**

**Concepts and benefits of constraint blocks**

In SysML, constraint blocks are an important defining element in system modeling. This block primarily defines boolean constraint expressions that must evaluate to true or false. Most often, the expression you define in a constraint block is an equation or inequality. These mathematical relationships are used to constrain the value properties of a block.

Constraint blocks encapsulate specific constraints so they can be defined once and reused in a variety of situations. This works in a similar way to parts that use blocks in other contexts. A constraint block contains a constraint expression, which consists of a mathematical expression. Constraint blocks also define special kinds of properties called constraint parameters. Constraint blocks can be created through bdd and are a special type of block.

**Purpose of Constraint Block**

There are two main reasons to use constraint blocks:

- To specify assertions about system values that are valid in the operating system.
- To perform engineering analysis during the life cycle design phase.

**Constraint parameters and properties**

Variables in a constraint expression are called constraint parameters. These primarily represent quantities and are typed as value types. Constraint parameters are linked to other parameters and properties of the block and are not explicitly specified as independent or dependent variables.

**Notation for constraint blocks**

In a block definition diagram (BDD), a constraint block appears as a rectangle whose name is preceded by the stereotype «constraint». Constraint expressions always appear in the constraint pane within braces ({}), and constraint parameters in the constraint expression are listed individually in the parameters pane. Parameters are defined using strings in the format “parameter name: type[multiplicity]”. There is also an indication of whether the parameters should be sorted or unique.

**Constraint Properties of Block**

**Definition and use of constraint properties**

In SysML, constraint properties are listed in the constraint compartment of a block. Constraint properties typically represent mathematical relationships (equations or inequalities) that apply to a set of value properties. The value properties of these blocks can be constrained using Constraint Blocks. (That is, the method of assigning a Constraint Block to the Constraint Property of the Block is used)

This is achieved by using bdd to create a configuration layer of Constraint Blocks. Constraint properties are an essential part of building a mathematical model of a system, which is represented in a parametric diagram. In parametric diagrams, blocks are represented by external frames, and constraint properties represent the use of constraint blocks. We will discuss this in more detail later in this post, using EA as an example.

**Notation for constraint properties**

When listing constraint properties in the constraints pane of a block, they appear in the following format:** **

`<constraint name> : <type>`

. The constraint name is defined by the modeler, and the type must be the name of the constraint block created within the system model.

For example, consider constraints related to the fuel efficiency of a car. This can be expressed in SysML as:

**Fuel efficiency constraints: Fuel efficiency calculation**

Here, ‘Fuel Efficiency Constraint’ is the name of the constraint, and ‘Fuel Efficiency Calculation’ is the type of this constraint.

**Relationship to constraint blocks**

The roles of constraint properties and constraint blocks can be summarized as follows.

- Blocks can own Constraint Properties, which are used to constrain value properties.
- Constraint properties are usually defined as constraint blocks that encapsulate mathematical relationships.

**Parametric Diagram**

**Basic structure of parametric diagram**

In SysML, parametric diagrams (par) are an essential part of system modeling. Parametric diagrams can represent two types of model elements:

- Block
- Constraint Block (constraintBlock)

The full header for the parametric diagram is as follows:

par [model element type] model element name [diagram name]

**Parametric diagram representing constraint blocks**

A parametric diagram representing a constraint block shows only the constraint properties and bindings that form the internal structure of that constraint block.

**Parametric diagram representing a block**

A parametric diagram representing a block primarily shows the bindings between the value properties and constraint properties of the block. You can also display partial and reference properties for that block, especially if these properties contain nested value properties of interest.

**Others**

If you want to simply convey simple information about constraints without defining a Constraints Block, you can consider the following two options.

**Direct use of constraint expressions in blocks (Single Constraint)**

It is also possible to specify constraint expressions directly in the constraint section of a block without using a constraint block. This is used when the constraint expression is needed in only one block (i.e. there is no intention to reuse it in multiple places). However, as a best practice, it is always a good idea to encapsulate equations and inequalities in constraint blocks. This allows for reuse if necessary.

**Use of note symbols (Note Symbol)**

Constraints are often indicated by attaching a note symbol. This note symbol is attached to the model element being constrained, and the text of the constraint appears within the body of the note. This approach helps you clearly visualize how constraints affect model elements and improves the readability of your model.

The language of a constraint is usually indicated using curly braces preceding the expression text. This indicates the specific language or grammar used by the expression. However, to reduce model complexity and improve readability, this linguistic notation may sometimes be omitted. This helps avoid confusion when modeling and helps you focus on the information that matters.

**Constraint and Parametric Diagram practice through EA**

Now, let’s practice parts related to constraints using EA.

The things to practice here are as follows.

- Single Constraint
- Note Symbol
- Constraint Block
- Constraint Property of Block with Constraint Block

**Single Constraint**

Single Constraint is to specify a constraint expression directly in the Constraint Compartment of the block. Therefore, it cannot be reused as a constraint for other elements.

As an example, let’s create a hexahedron block and assign the constraint for the volume directly to the block’s Constraint Compartment.

I created a bdd and created a block called Hexaeder.

To find the volume of a cube, three values are required: height, width, and length. We also need a value representing the volume. Create 4 Value Properties of Real Type that each represent.

Add the Primitive Value Types Library to the model (added in Model Wizard → SysML 1.5 Libraries), right-click Hexaeder, and create New Child Diagram → Internal Block Diagram.

Then, select Real Value Type in the Primitive Value Types Library and drag and drop it as Property (Part) in Hexaeder idb. The name of the created Value Property is Volume.

Repeat this operation three times and name them Height, Width, and Length respectively.

Now right-click on the Hexaeder block and click properties → special action, or simply double-click on the block and click the Constraint tab in the Block:Hexaeder window that appears. Enter Constraint here.

Enter Volume = Height * Width * length and save. Then, you can display the Consratins property of the block as shown below.

If you set the constraint in this way, the constraint is applied only to the block and is not linked to the parametric diagram.

Therefore, there is no need to use this method unless it simply provides information about the constraints of a specific block.

**Note Symbol**

Note The symbol is a simple concept. Write the constraint in Note and attach it to the block that owns the constraint.

Write down the constraints using Common Elements → Note in Toolbox. According to Sysml rules, write Constraint within braces ({}) and link Note to the Hexaeder block.

**Constraint Block**

Now let’s practice the same example using Constraint Block. I created a new bdd.

Select Constraint Block from Toolbox and create it on bdd.

Then, EA will automatically pop up the Edit Constraint Block chop. The Constraint Block is named Volume of Hexaeder. Then click the Create Constraint section under Build-in Constraints and enter the formula to find the volume of the cube. (Volume = Height * Width * length)

Then, the variables that make up the formula are automatically assigned as Parameters. When you close that window, the following Constraint Block is created. (For reference, if you want to edit the Constraint Block again, right-click on the block → select Edit ConstraintBlock….)

Now create another Hexaeder Block and add the four Real Value Properties of Volume, Height, Length, and Width to the block. And include the Volume of Hexaeder Contraint Block in the Hexaeder Block using Part Relationships.

If you want to more explicitly indicate that the constraints of the Volume of Hexaeder are assigned to the Hexaeder, you can enter additional information in the Constraint Compartment of the Block, as in the Single Constraint described above. (Enter Constraint Name: Constraint Block Type according to the rules of SysML.)

Now you need to connect the parameters of the Constarint Block with the Values of the Hexaeder block where you want to use the constraints. This is where Parametric Diagram comes into play. Right-click the hexaeder block → New Child Diagram → Parametric Diagram to create a parametric diagram.

Right-click on the created par and click the Synchronize Structural Element button to display the Value Property and Constraint Property of the Hexaeder Block in idb.

Parameters are not visible in the volume of Hexaeder, but when you right-click the block and click Features → Parts / Properties, click the All button in the Parts/Properties tab in the Features window that is created, and all parameters will be displayed in idb.

After organizing the Value Property and Parameters nicely, connect the Value Property and Parameters using the Binding Connector in ToolBox.

Through this process, it is possible to model how the Value Properties of the Hexaeder block are assigned to the parameters of the Volume of Hexaeder. As in this example, the bdd only displays which Constraint Block the Value Property of the block is related to, and how the Constriant Block is actually used with the Value Properties of the block is displayed in the Parametric Diagram.

**Composition of Constraint Blocks**

Through the composition relationship of Constraint Blocks, complex formulas can be expressed as a combination of simpler formulas. As an example, let’s draw the model in Practice Guide to SysML, Chapter 8 in EA.

First, let’s draw bdd. A bdd called power onsumption was created.

Then, create a Constraint Block on bdd, name it Jule`s Law, and enter power = current * voltage as the Constraint. Then, three Real Types of current, power, and voltage will be created, and the Type must be designated as A, V, and W, respectively. Create three Value Types on bdd and name them A, V, and W, respectively. (For clearer modeling, you must enter additional information such as Unit.)

And assign each to the parameters of Jule`s Law. For assignment, click on each parameter in the parameters compartment of the created Constraint Block and the information about the parameter will appear in the properties window. Select Type in the property tab and click select type to assign A among the created values. Here are the bdds with work completed to date:

Create another Constarint Block and name it Power Sum, and enter Constriant as total_power = sum. In EA’s Edit Constraint Block, parameters are distinguished by spaces in the constraint, so total power was connected with an underscore and written as total_power. The type is also specified in the same way as above. Multiplicity can also be set in the property tab. For total_power, set Lower bound: 0, Upper bound: *. The bdd completed to date is as follows:

Now create a Constraint Block called Power Consumption. And it is connected to Jule`s Law and Power Sum through Shared Association. (For reference, in the SysML book, when creating a Composite Constraint, it is connected as Part Association, but in EA, it is connected as Shared Association.)

Then double-click Shared Association and name the role pe and ps in the Source section of Role(s), respectively.

Now, right-click the Power Consumption Constraint Block and click New Child Diagram → Composite Structure Diagram to create a composite parametric diagram. Double-click the block to open the parametric diagram. To display the parameters of each Constraint Block (Jule`s Law, Power Sum) displayed in par, right-click each block → Features → Parts/Properties to activate all parts.

Now let’s create the Parameter for Power Consumption itself. Parameters are also properties that Power Consumption has, so click Property in the Toolbox to create three in par. To draw it, it is automatically created on the frame border of par. (The only property that Par can have is a parameter, so the property is automatically assigned as a parameter.)

Each is named current, voltage, and component demands, and types are A, V, and W, and multiplicity is also assigned to component demands.

The bdd and par completed up to this point are as follows.

Now, use the binding connector on par to connect the parameters of Power Consumption Constraint Block, Jule`s Law, and Power Sum Constraint Block. The completed par is as follows.

**Constraint Property of Block with Constraint Block**

There is one thing that is disappointing in the EA example above. It is not displayed in the constraints compartment like the Composite Constraints block below.

First, for practice, I created another Constraint Block called Power Consumption2. Then right-click the block and click New Child Diagram → Composite Structure Diagram to create an internal par. Click Constraint Property in the Toolbox to create two on par and name them ps and pe, respectively. And in the Properties window → Property tab, assign Jule`s Law and Power Sum Constraint Block to the Type respectively.

And if you check again in bdd, the Composite Constraint Blocks are assigned to the Constraint Compartment as follows.

Displaying a composite constraint relationship using a shared association on bdd or creating a composite constraint by assigning a constraint property on a constraint block seems to have no difference in what the composite constraint itself means. However, when configuring a composite constraint using the constraint property, there is a disadvantage in that the relationships between constraints are less visible, but the bdd is kept clean and readable. Choosing one can be done strategically when modeling.

For reference, in the Edit Constraint Block, parameters are automatically created when you enter constraints. However, in some cases, certain characters in Constraint should not become Parameters. (For example, pi **π**) In this case, click the Edit Built-in Variables button in the window to register the corresponding character.

**If you are interested in other articles about the basic Knowledge of SysML with EA, please refer to the links below!**

[SysML] #1. Understanding SysML Diagrams

[SysML] #2. Understanding SysML Package Diagram

[SysML] #3. Understanding Dependencies of Pkg Diagram

[SysML] #5. Understanding SysML Requirement Diagram

[SysML] #6. Understanding Relations In Req Diagram

[SysML] #7. How to draw a Req Diagram with EA

[SysML] #8. Understanding SysML UseCase Diagram

[SysML] #9. How to draw a UseCase Diagram with EA

[SysML] #10. Understanding SysML bdd Diagram

[SysML] #11. Understanding SysML ibd Diagram

[SysML] #12. Understanding Part Property of Block

[SysML] #13. Understanding Reference Property of Block

[SysML] #14. Understanding Value Type

[SysML] #16. Understanding Flow Property

[SysML] #17. Understanding Port and Association Block

[SysML] #18. Understanding Behavior of Block

[SysML] #19. Understanding Generalizations

[SysML] #20. Understanding Dependencies, Allocate, Comment

[SysML] #21. Understanding Activity Diagram

[SysML] #22. How to draw a Activity Diagram with EA

[SysML] #23. Seq Diagram LifeLine and Message

[SysML] #24. Seq Diag Constraints Fragment Decompose

[SysML] #25. How to draw a Sequence Diagram with EA

[SysML] #26. Understanding Stm Diagram State and Transition

[SysML] #27. Understanding Stm Diagram Event Pseudostate Region