Skip to content

Subclauses

The requirements are meant to be clear and concise, but often require some hardening or additional measures. That is where subclauses come in. Essentially subclauses are the design rules from before (similar to design-requirements), but attached to another goal-, transformation- or design-requirement.

Say we want to state that the brushless motor has a conversion efficiency of at least 80%. You can add that like so:

world.esl
define type
  Efficiency is a real of at least 0.0 and at most 1.0


define component BrushlessMotor
  parameters
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow

  variables
    conversion is an Efficiency

  transformation-requirements
    convert-power: must convert power into torque with subclauses
      * s1: conversion must be at least 0.8
world.esl
# Specification of a drive-mechanism driving a pump.
# ---8<--- [start:type-def-1]
define type
# ---8<--- [end:type-def-1]
  MechanicalEnergyFlow is a real with unit Nm
  ElectricalEnergyFlow is a real with unit W
  LiquidMaterialFlow is a real with unit L/s
  EnergyPotential is a real with unit Wh
  ControlSignal is a boolean
  Distance is a real with unit m
  SpatialMeasure is a Distance of at least 0.0 [m]
# ---8<--- [start:type-def-2]
  Efficiency is a real of at least 0.0 and at most 1.0


# ---8<--- [end:type-def-2]
define verb
  provide to
  convert into
  send to


define relation
  BatteryEfficiencyModel
    relating parameters
      * potential is an EnergyPotential
      * output is an ElectricalEnergyFlow


world
  variables
    torque is a MechanicalEnergyFlow
    water-flow is a LiquidMaterialFlow
    drive-length is a SpatialMeasure
    pump-length is a SpatialMeasure

  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

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

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

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

  need
    IP68: drive-mechanism must be IP68 compliant


define component CentrifugalPump
  parameters
    torque is a MechanicalEnergyFlow
    water-flow is a LiquidMaterialFlow
    length is a SpatialMeasure property

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


define component ElectricalDriveMechanism
  parameters
    torque is a MechanicalEnergyFlow
    length is a SpatialMeasure property

  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow
    motor-control-signal is a ControlSignal

  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]


# ---8<--- [start:motor-def]
define component BrushlessMotor
  parameters
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow

  variables
    conversion is an Efficiency

  transformation-requirements
    convert-power: must convert power into torque with subclauses
      * s1: conversion must be at least 0.8
# ---8<--- [end:motor-def]


define component Battery
  parameters
    power-potential is an EnergyPotential
    power-out is an ElectricalEnergyFlow

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

  relations
    efficiency-model: BatteryEfficiencyModel
      relating arguments
        * power-potential
        * power-out


define component Switch
  parameters
    motor-control-signal is a ControlSignal

Where we added a new type, Efficiency, that is just a real between 0.0 and 1.0 (100%), and set a subclause on the convert-power transformation requirement of the BrushlessMotor definition by means of the conversion variable that we introduced there.

All it takes to add subclauses to a requirement or constraint is the with arguments at the end, followed by any number of design rules using the asterisk (*) list format.

Next!

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