Skip to content

Constraints vs. requirements

We define requirements as that what is desired for the system. However, some parts may be already present or are to be treated as given. That what is given can be expressed using constraints. goal-, transformation-, and design-constraints exist, and are identical to their ...-requirements counterparts, apart from the change from the must to does verb when expressing constraints instead of requirements.

For instance, let us assume that our battery power source will always convert the chemical power-potential to power regardless of our requirements. It may even be an off-the-shelf part. It can be expressed as such:

world.esl
1
2
3
4
5
6
7
define component Battery
  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow

  transformation-constraints
    convert-potential: does convert power-potential into power
world.esl
define type
  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]


define verb
  provide to
  convert into


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
    drive-mechanism is an ElectricalDriveMechanism

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



define component CentrifugalPump
  variables
    torque is a MechanicalEnergyFlow
    water-flow is a LiquidMaterialFlow

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


define component ElectricalDriveMechanism
  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow
    motor-control-signal is a ControlSignal


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

  components
    motor is a BrushlessMotor
    power-source is a Battery
    power-switch is a Switch

  goal-requirements
    provide-power: power-source must provide power to motor

  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
  variables
    power is an ElectricalEnergyFlow
    torque is a MechanicalEnergyFlow

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


# ---8<--- [start:highlight]
define component Battery
  variables
    power-potential is an EnergyPotential
    power is an ElectricalEnergyFlow

  transformation-constraints
    convert-potential: does convert power-potential into power
# ---8<--- [end:highlight]

define component Switch
  empty

So with minimal changes, we can signal that this transformation is non-negotiable and universally is so.

Nuancing requirements

For constraints, the "verb" inside the sentence is always does.

For requirements further nuance is allowed to be expressed:

  • must
  • shall
  • should
  • could
  • won't

These help to distinguish preferences and requirements. When in doubt, it is often best to stick with must for requirements and does for constraints.

Note

Most compiler implementations will warn you if you use the wrong verb, but will process your specification nonetheless to obtain the dependency network as it generally does not matter for dependency derivation.

Info

If you wish to read up on the nuance between the different verbs, there are some great references to be found in the System specifications in detail explanation page.

Next!

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