RequirementLog model
Requirements.Examples.Elementary.ViolationStatistics.RequirementLog
ยท source
Verify.Requirement with computeStatistics: the statistics are logged beside the verdict and printed in the summary
Extends Modelica.Icons.Example
The sine of Sine against two
requirements in Verify.Requirement blocks with
computeStatistics = true (tab Statistics). below also has useMargin = true and its
margin input connected to the check's margin; above has no margin; plain has no
statistics. Each requirement with statistics writes a Statistics line to the log file beside its verdict line,
and PrintViolations prints them in a section of its summary:
Violation statistics (2 of 3 requirements): RequirementLog (below): 4 violations, 13.3333 s violated in total (38.1 % of the applicable time), longest 3.33333 s from 0.833333 s, worst margin -2 at 2.5 s RequirementLog (above): 0 violations, 0 s violated in total (0.0 % of the applicable time), longest 0 s from 0 s
Set useEvaluationTime = true in printViolations to print in a tool without terminal().
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Components and variables
| Name | Type | Description |
|---|---|---|
u | Modelica.Blocks.Sources.Sine | u = sin(2 pi t / 10 s) |
always | Requirements.Sources.BooleanConstant | Condition, always true |
during1 | Requirements.ChecksInFixedWindow.During | u shall stay below 0.5, tolerance 0.25 |
during2 | Requirements.ChecksInFixedWindow.During | u shall stay above -1.5 |
below | Requirements.Verify.Requirement | Violated four times; its statistics with the worst margin |
above | Requirements.Verify.Requirement | Satisfied; its statistics without margin |
plain | Requirements.Verify.Requirement | Without statistics: logged as before |
printViolations inner | Requirements.Verify.PrintViolations | Prints the requirement summary at 35 s |