Skip to content

Validation as OpenModelica's library testing: omc's tube comparison in Julia - #14

Merged
JKRT merged 1 commit into
masterfrom
signal-event-timing
Oct 28, 2026
Merged

JKRT merged 1 commit into
masterfrom
signal-event-timing

Conversation

@JKRT

@JKRT JKRT commented Oct 28, 2026

Copy link
Copy Markdown
Member

Signals were compared at 101 evenly spaced samples with atol 0.01 + reltol 3e-3: a switch up to a sample interval late passed, a deviation between samples was not seen, and small-range signals were hardly checked.

compare_signal now compares as OpenModelica's library testing does: omc's diffSimulationResults band (SimulationResultsCmpTubes.c, v1.27.1) ported to Julia as tube_compare (src/tubes.jl), with relTol 3e-3, relTolDiffMinMax 3e-3, rangeDelta 1e-3, at every reference time over [StartTime, stopTime]; a model's signals in order on shared reference times as omc's one call; reference events not compared; a non-finite value fails. Fused multiply-adds where clang contracts (TUBE_FUSED; fused = false for an unfused build).

  • Experiment lists record StartTime; simulated and compared from it (ForceStrokeBehaviour: -4).
  • SignalComparison / signals.json carry the band at the plotted samples and compared/events/outside counts; the viewer draws the band.
  • Checked against omc 1.27.1: 0 of 27,853 verdicts differ (all 4.1.0 references' signals, 7 altered copies) and 0 of 439 real OM.jl result signals (43 models). Tests: 156/156, incl. 11 cases with omc's verdicts and band values.
  • Local MSL 4.1.0 run: validate 486/534 (483 before): -5 that omc also fails (DemoSignalCharacteristic, SmoothStep, ComparisonQuasiStatic, PointGravityWithPointMasses2, HeatLosses), +11 that omc passes, -3 local memory cap.

🤖 Generated with Claude Code

…n Julia

compare_signal compared at 101 evenly spaced samples: a switch up to a sample
interval late passed and a deviation between samples was not seen. It now
compares OM.jl's values at every reference time against the band omc's
diffSimulationResults builds (SimulationResultsCmpTubes.c, ported as
tube_compare in src/tubes.jl, fused multiply-adds where clang contracts) with
OpenModelica's library testing settings (relTol 3e-3, relTolDiffMinMax 3e-3,
rangeDelta 1e-3): a model's signals in order sharing the reference's times as
omc's one call does, over [StartTime, stopTime], a reference event not
compared, a non-finite value failing. The experiment lists record StartTime,
simulated from there (MSL ForceStrokeBehaviour: -4). SignalComparison and
signals.json carry the band at the plotted samples and the
compared/event/outside counts; the viewer draws the band and where OM.jl is
furthest outside it. Tests check the port against omc's verdicts and band.

Assisted-by: Claude Opus 5.5
@JKRT
JKRT merged commit 7ef7d9c into master Oct 28, 2026
1 check passed
@JKRT
JKRT deleted the signal-event-timing branch October 28, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant