Skip to content

Needs

Sometimes you cannot quantify a requirement and must state something qualitatively. For example, you may want to refer to an externally defined standard. This can be specified using a need, which should be used with caution. Needs serve a documentation purpose, but are mostly ignored by the compiler as far as any checks can go.

Let's say our drive-mechanism that lives in the world definition needs to be waterproof up to IP68 compliance. There are no further constraints on need lines than that it needs to start with a variable or a component name as in [variable | component-name] [free text], which is why they are some form of 'escape' in the specifications. Use this wisely and responsibly!

You can add the IP68 need to the world like so:

world.esl
1
2
3
4
world
  # Earlier content is visible in File tab.
  need
    IP68: drive-mechanism must be IP68 compliant
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

# ---8<--- [start:highlight]
  need
    IP68: drive-mechanism must be IP68 compliant
# ---8<--- [end:highlight]


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


define component Battery
  empty

define component Switch
  empty

Tip

When client specifications are too vague (yet) to be implemented in a quantitative manner, it may be wise to document them using a need for the time being. These can serve as action points to reduce the neediness of the specification and support the transition from qualitative to quantitative requirements later on.

Next!

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