Skip to content

Activity Diagrams

ESL

In ESL, transformation-requirements specify how variables are internally transformed. In the example below, torque is converted into water-flow and power-potential into torque.

goal-requirements define the goal of a component with respect to another. Often, the goal is described using verbs such as provide and send.

world.esl
# Specification of a drive-mechanism driving a pump.
define type
  mechanical-energy-flow is a real with unit Nm
  electrical-energy-flow is a real with unit W
  liquid-material-flow is a real with unit L/s
  energy-potential is a real with unit Wh
  control-signal is a boolean
  distance is a real with unit m
  spatial-measure is a distance of at least 0.0 [m]
  efficiency is a real  of at least 0.0 and at most 1.0


define verb
  provide to
  convert into
  send to


define relation
  battery-efficiency-model
    relating parameters
    * potential is an energy-potential
    * output is an electrical-energy-flow


world
  variables
    torque is a mechanical-energy-flow #< Comments on variable torque.
    water-flow is a liquid-material-flow
    drive-length is a spatial-measure
    pump-length is a spatial-measure



  components
    pump is a CentrifugalPump with arguments
      * torque
      * water-flow
      * pump-length

    drive-mechanism is an ElectricalDriveMechanism with arguments
      * torque
      * drive-length



  comments
    pump #< Can be sourced by manufacturer XYZ.
         #< Part number CFG.PMP.0.1


  goal-requirements
    provide-torque: drive-mechanism must provide torque to pump



  design-requirements
    min-water-flow: water-flow must be at least 1.0 [L/s]



  design-constraints
    dc-drive-length: drive-length must be equal to pump-length

  need
    IP68: drive-mechanism must be IP68 compliant


define component CentrifugalPump
  parameters
    torque is a mechanical-energy-flow
    water-flow is a liquid-material-flow
    length is a spatial-measure property

  transformation-requirements
    convert-torque: must convert torque into water-flow


define component ElectricalDriveMechanism
  parameters
    torque is a mechanical-energy-flow
    length is a spatial-measure property

  variables
    power-potential is an energy-potential
    power is an electrical-energy-flow
    motor-control-signal is a control-signal

  transformation-requirements
    convert-power-potential: must convert power-potential into torque


  components
    power-source is a Battery with arguments
      * power-potential
      * power

    motor is a BrushlessMotor with arguments
      * power
      * torque

    power-Switch is a Switch with arguments
      * motor-control-signal


  goal-requirements
    provide-power: power-source must provide power to motor
    send-control-signal: power-Switch must send motor-control-signal to power-source


  behavior-requirements
    toggle-power:
      case on:
        when
          * c1: motor-control-signal is equal to True [-]
        then
          * r1: power must be at least 300 [W]
      case off:
        when no other case applies
        then
          * r2: power must be equal to 0 [W]


define component BrushlessMotor
  parameters
    power is an electrical-energy-flow
    torque is a mechanical-energy-flow

  variables
    conversion is an efficiency

  transformation-requirements
    convert-power: must convert power into torque with subclauses
      * s1: conversion must be at least 0.8


define component Battery
  parameters
    power-potential is an energy-potential
    power is an electrical-energy-flow

  transformation-constraints
    convert-potential: does convert power-potential into power


  relations
    efficiency-model: battery-efficiency-model
      relating arguments
      * power-potential
      * power


define component Switch
  parameters
    motor-control-signal is a control-signal
goal requirement
1
2
3
  goal-requirements
    provide-power: power-source must provide power to motor
    send-control-signal: power-Switch must send motor-control-signal to power-source
transformation requirement
define component ElectricalDriveMechanism
  parameters
    torque is a mechanical-energy-flow
    length is a spatial-measure property

  variables
    power-potential is an energy-potential
    power is an electrical-energy-flow
    motor-control-signal is a control-signal

  transformation-requirements
    convert-power-potential: must convert power-potential into torque

SysML

The transformation- and goal-requirements are mapped to actions in the Activity Diagram. Each action has input and output pins, which specifies what FlowProperty is allowed to flow in and out of the action. The parameter nodes are at the edge of the activity, and define what flows in and out of the activity. FlowProperties type the connectors in between the pins and nodes.

For example, take the following goal-requirement:

\[ \underbrace{\text{power-source}}_{\text{sender}} \quad \text{must } \quad \underbrace{\text{provide }}_{\text{action}} \quad \underbrace{\text{power }}_{\text{input/output}} \quad \text{to } \quad \underbrace{\text{motor }}_{\text{receiver}} \tag{1} \]

and the following transformation-requirement of the drive-mechanism:

\[ \text{must} \ \underbrace{\text{convert}}_{\text{action}} \ \underbrace{\text{power-potential}}_{\text{input}} \ \text{into } \underbrace{\text{torque}}_{\text{output}} \tag{2} \]

The action of the goal-requirement is mapped the Activity Diagram of both the sender (power-source) and the receiver (motor). The action of the sender is provide and the action of the receiver is receive. The input and output pins of both actions have the FlowProperty power.

The transformation-requirement is mapped to the Activity Diagram of the component that owns the transformation requirement. In this case that is the drive-mechanism that has the action convert, with input power-potential and output torque.

The resulting Activity Diagrams for the full system will then look as follows:

Activity Diagram

Note

Goal requirements are mapped to SysML using both Internal Block Diagrams to define the internal structure and Activity Diagrams to emphasize the action within a goal-requirement (such as send and provide).

Tip

For decomposed activities, the input and output should be consistent with the parent block. So count the signals for a sanity check!

Next!

Press next (or N on your keyboard) to head over to the next page! P is for Previous.