Version_0_12_0 class
Requirements.UsersGuide.ReleaseNotes.Version_0_12_0
ยท source
Version 0.12.0 (Oct. 19, 2026)
Extends Modelica.Icons.ReleaseNotes
Violation statistics. For a long run a verdict is not enough: a requirement violated once for a second and one violated every summer afternoon are both violated. The new block Verify.ViolationStatistics answers three questions per requirement: how often was it violated, what was the worst violation and when, and what was the longest violation. No existing output, log line or regression reference changed.
The block
- Inputs: the check's
property, and optionally itsmargin(new connector Interfaces.MarginInput). - Outputs:
nViolations,totalDuration,violatedFraction,longestDurationandtLongestStart,worstMarginandtWorst, the same for the current episode, andcurrentDuration. Every output holds its final value withoutterminal(). - A violation is a phase with
property = Violated, not one with a negative margin. A margin is provisional while the check isUndecided, so the worst margin is taken over the decided phases only. This is the rule the verdict follows. mergeGapandminDurationstop a signal that hovers at its limit from counting as hundreds of violations. They change the count and the longest episode, never the total.- Counting and timing cost no extra events: the property only changes at events the check produces anyway.
The worst margin
- Continuous (default): Internal.ContinuousWorst
extends Modelica.Blocks.Math.ContinuousSignalExtrema.
A state event fires at every local extremum of the margin, without sampling. Three changes from the MSL block:
- only the decided phases count;
- the worst value is also tracked per episode;
- the final value does not depend on
terminal(), which Modelon Impact evaluates to false.
Tdefaults to 0.01 s, not the MSL block's 1 µs. At 1 µs the event indicator near an extremum is below the solver tolerance, and the solver reports chattering. ChooseTas about a thousandth of the margin's time scale (60 s for a year). - Ratchet: an event only when the margin falls a
resolution(default 0.01) below the least value so far. The result is withinresolutionof the exact value. Modelica.Blocks.Math.SignalExtrema was considered and not used: it samples, and is no more accurate than the stored result. - Measured on Impact, a year with hourly output and a 0.1 K, 10-minute ripple on a room temperature
(
Examples.Elementary.ViolationStatistics.YearRipple*):
On a smooth margin the continuous method is cheap: two events a day. On an oscillating one the ratchet is three times cheaper.Model Run time State events Episodes Worst margin no statistics 9.0 s 2,804 — — continuous 96.7 s 219,103 374 −3.0844 ratchet 31.1 s 64,991 374 −3.0800
Statistics in the log
- Verify.Requirement and
BooleanRequirement have a new tab Statistics:
computeStatistics(default false),useMarginwith a conditionalmargininput, and the block's parameters. - A requirement with statistics writes a second line to the log file beside its verdict:
Statistics,<observation>,<requirement>,<n>,<total>,<fraction>,<longest>,<longest from>,<worst>,<worst at>,<minDuration>,<mergeGap>. The worst-margin fields are empty without margin. The two filters are included so that a reader can recompute the statistics from the stored result. It is a separate line, not columns added to the verdict line, because the verdict line ends with free text, and a reader would take any added columns for part of the text. - PrintViolations prints a Violation statistics section in its summary, on the console and in the HTML report.
Internal.printViolationsToLogFileno longer takes aStatisticsline of the same requirement for its own verdict line when it checks whether that line is already written.
Examples
Examples.Elementary.ViolationStatistics:
Sine,EpisodesandGatingassert every output against closed-form values.RequirementLogshows the log and the summary.- The
Year*models run a year and measure the cost of the two methods.
The first four are cases in the Impact regression list, with Impact's own references. YearSmooth is in
the list but disabled: its stored result has every event row and would be as large as the rest of the list. Full
Impact suite afterwards: 563/563 checks, every existing case unchanged.
Changes
- New:
Verify.ViolationStatistics,Interfaces.MarginInput,Types.WorstMarginMethod,Internal.ContinuousWorst,Internal.RatchetWorst,Internal.StatisticsLogger,Internal.printStatisticsToLogFile,Examples.Elementary.ViolationStatistics. Interfaces.PartialRequirement: the Statistics tab (no change whilecomputeStatistics = false).Internal.printViolationsToLogFile,Internal.printViolationsToOutput: as above.conversion(noneFromVersion="0.11.1"): no model needs conversion.