Main Content

Define Formal Requirements with a Duration

Since R2022a

This example shows you how to use the Requirements Table block to create formal requirements with a duration. When modeling behaviors that cause brief noise during normal operation, engineers frequently define requirements that must be true for a specified duration. For example, in electrical circuits, closing a mechanical switch may cause the voltage to oscillate or spike before stabilizing, which is referred to as bounce. For sensitive control systems, bounce can cause measurements that lead to faulty behavior. When you mitigate bounce, which is known as debouncing, you specify controller behavior that executes only when the measurement is a certain value for a specified period of time.

This example shows how to model a requirement with a duration when the Requirement Table block has one or multiple input data. To define a requirement with a duration, use the Duration column, child requirements, semantic requirements, and default requirements. See Using the Duration Column and Establish Hierarchy in Requirements Table Blocks.

Define a Requirement with a Duration for a Single Input

If you want to create a requirement with a duration that uses a single input, specify the requirement along with a default requirement. Open the model reqTableDurationModel1.

open_system("reqTableDurationModel1");

This model specifies a requirement for a sensor that detects a fault in a circuit. The model has one input data, current. The Requirements Table block uses the value of current to confirm the anticipated output of the sensor, overCurrent. The table defines the following requirement:

  • If the measured current is greater than 10 for more than 0.5 seconds, then the sensor shall detect a fault in the circuit.

  • Otherwise, the sensor shall not detect a fault in the circuit.

The requirements in the Requirements Table block in the model reqTableDurationModel1. The current must be greater than 10 for 0.5 seconds, or the default requirement executes.

Define a Requirement with a Duration for Multiple Inputs

If you have a requirement that relies on multiple inputs that each have a duration, and each of the inputs affects the anticipated output of your model, use a semantic requirement. You can use each child in the semantic requirement to represent the requirements for each input. Open the model reqTableDurationModel2.

open_system("reqTableDurationModel2");

In this example, the Requirements Table block specifies a requirement for overspeed detection in a jet engine. A jet engine experiences overspeed when it spins beyond its physical limits. Prolonged overspeed can lead to catastrophic failure of the engine. To address this, jet engine control systems use multiple sensors and overspeed detection mechanisms. If at least one of the sensors detects overspeed, the engine control system shuts down the jet engine by cutting off fuel flow to the combustor. However, aircraft operators and designers also do not want the control system to shut down the engine due to a sensor, physical component, or software error caused by bounce. To reduce the chances of unintended engine shutdown, engineers often specify a short duration that each sensor must include before determining if overspeed occurs.

The table uses, engineSpeed1, engineSpeed2, and engineSpeed3 input data to define the requirement for the overspeed detection.

  • If at least one of the sensors measures the engine speed to be greater than 1000 for more than 0.5 seconds, then the engine control system shall detect engine overspeed.

  • Otherwise, the engine control system shall not detect engine overspeed.

The requirements in the Requirements Table block for reqTableDurationModel2. Three semantic requirements specify that at least one of the sensors must be greater than 1000, otherwise the default requirement executes.

See Also

Related Topics