RequirementLog model

Requirements.Examples.Elementary.ViolationStatistics.RequirementLog  ยท source

Icon of RequirementLog

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

NameTypeDescription
uModelica.Blocks.Sources.Sineu = sin(2 pi t / 10 s)
alwaysRequirements.Sources.BooleanConstantCondition, always true
during1Requirements.ChecksInFixedWindow.Duringu shall stay below 0.5, tolerance 0.25
during2Requirements.ChecksInFixedWindow.Duringu shall stay above -1.5
belowRequirements.Verify.RequirementViolated four times; its statistics with the worst margin
aboveRequirements.Verify.RequirementSatisfied; its statistics without margin
plainRequirements.Verify.RequirementWithout statistics: logged as before
printViolations innerRequirements.Verify.PrintViolationsPrints the requirement summary at 35 s