Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Electrical coverage work

Reviewed reference boundaries for Modelica.Electrical.Analog and Modelica.Electrical.PowerConverters parity. A boundary here grants no strict-high or certification credit; the model stays in every cohort sweep.

AmplifierWithOpAmpDetailed has no converged OMC reference

Against the default OMC reference the Rumoca trace compares 66 channels: 24 high, 31 minor, and 11 deviating (maximum bounded normalized L1 0.221). The deviating channels are the op-amp’s internal states. Between 0.9 ms and 1.4 ms the default OMC trace makes a single non-periodic excursion that the periodic Rumoca trace does not make; outside that window the traces agree.

OMC cannot refine its own reference. The same model, simulated by the same OMC build with only the tolerance tightened, fails partway through the run:

loadModel(Modelica, {"4.1.0"}); getErrorString();
simulate(Modelica.Electrical.Analog.Examples.AmplifierWithOpAmpDetailed,
  tolerance=1e-10, numberOfIntervals=12, outputFormat="csv",
  variableFilter="time|opAmp.v_in|opAmp.v_source|opAmp.q_fp1",
  fileNamePrefix="amp_tight"); getErrorString();
simulate(Modelica.Electrical.Analog.Examples.AmplifierWithOpAmpDetailed,
  numberOfIntervals=12, outputFormat="csv",
  variableFilter="time|opAmp.v_in|opAmp.v_source|opAmp.q_fp1",
  fileNamePrefix="amp_default"); getErrorString();

Tolerance 1e-10 (method = 'dassl', stop time 0.003 s):

messages = "Simulation execution failed for model: Modelica.Electrical.Analog.Examples.AmplifierWithOpAmpDetailed
DASKR--  NONLINEAR SOLVER FAILED TO CONVERGE
LOG_STDOUT        | info    | model terminate | Integrator failed. | Simulation terminated at time 0.000136928

Default tolerance 2e-7:

LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.

The only OMC trace that exists is therefore the one with the excursion, and no tighter OMC run can confirm or refute it. The comparison is not identifying, so the model carries a reference_failure row in crates/rumoca-test-msl/tests/msl_tests/msl_trace_compare_exclusions.json. Official reference traces and tolerances are unchanged.

OMC folds atan2(0, x) to 0

Modelica.ComplexMath.arg(c) is atan2(c.im, c.re), which is pi for a negative real number. The OMC build that produces the references returns 0 instead whenever the imaginary part is structurally zero, whatever the sign of the real part:

model ARG2
  Real x = sin(10*time);
  Real zero = 0;
  Real a = atan2(zero, x);
  Complex c = Complex(x, 0);
  Real b = Modelica.ComplexMath.arg(c);
end ARG2;
loadModel(Modelica, {"4.1.0"}); getErrorString();
loadFile("ARG2.mo"); getErrorString();
simulate(ARG2, stopTime=1, numberOfIntervals=10, outputFormat="csv"); getErrorString();

OMC (openmodelica-unstable-2026-07-21), columns time, x, a, b:

0.4  -0.7568024953079282  0  0
0.5  -0.9589242746631385  0  0
0.6  -0.2794154981989259  0  0
1.0  -0.5440211108893698  0  0

Rumoca at the same samples returns a = b = 3.141592653589793, and 0 where x > 0. An OMC channel computed this way is the constant 0, so it cannot distinguish a correct angle from a wrong one.

Two FundamentalWave models have no deviating or minor channel other than such an angle. Their phase-1 winding has orientation 0, so V_m = (2/pi)*N*i has a structurally zero imaginary part while its real part follows the alternating current: Rumoca’s angle alternates between 0 and pi, OMC’s is 0 throughout.

ModelChannels (high / minor / deviating)Deviating channels
Magnetic.FundamentalWave.Examples.Components.EddyCurrentLosses678 / 0 / 2arg_V_m of the phase-1 converter of converter_m and converter_e
Magnetic.FundamentalWave.Examples.Components.SinglePhaseInductance78 / 0 / 4arg_Phi, arg_V_m of reluctance_m and converter_m

Each carries a reference_failure row in crates/rumoca-test-msl/tests/msl_tests/msl_trace_compare_exclusions.json.

Angles of zero and negative real phasors in QuasiStatic models

In six QuasiStatic examples every channel that differed pointwise was an angle or a power factor, and every difference was the sign of a zero, not a value:

  • Where a phasor is exactly zero, atan2 returns 0, pi or -pi according to the signs of its two zeros (Rumoca evaluates cuboidLeft.Phi as (-0, -0), hence -pi; OMC records 0). The FluxTubes phasors are zero at t = 0 and in QuadraticCoreAirgap until t = 0.0124; the Rectifier current is zero until the load ramp starts at t = 0.1, so voltageQS.pf = cos(arg(P + jQ)) is 1 against -1 there; the BalancingStar neutral current is zero throughout, carrying only floating-point residue (at most 4e-15 A).
  • A phasor with a negative real part and a zero imaginary part lies on the branch cut: atan2(+0, x) is pi and atan2(-0, x) is -pi, the same angle.

Solve lowering records each such channel’s phasor from its defining equation (SPEC_0040 SOLVE-C65), and the comparator compares angles on the circle and drops a sample only where the phasor is zero in both traces and its component channels agree (SPEC_0050). Under that rule all six are strict-high:

ModelCompared channels (high / minor / deviating)Undefined phasor channels
Electrical.QuasiStatic.Polyphase.Examples.BalancingStar1213 / 0 / 0currentSensor0.arg_i
Electrical.QuasiStatic.SinglePhase.Examples.Rectifier236 / 0 / 0none
Magnetic.QuasiStatic.FluxTubes.Examples.BasicExamples.QuadraticCoreAirgap318 / 0 / 0magFluxSensor.arg_V_m
Magnetic.QuasiStatic.FluxTubes.Examples.FixedShapes.CuboidSections175 / 0 / 07 arg_* channels of exactly zero phasors
Magnetic.QuasiStatic.FluxTubes.Examples.FixedShapes.CylinderSections164 / 0 / 0none
Magnetic.QuasiStatic.FluxTubes.Examples.Leakage.CylinderLeakage232 / 0 / 0magneticFluxSensor.arg_V_m, magneticPotentialDifferenceSensor.arg_Phi

An undefined phasor channel is one whose phasor is zero, at the comparator’s resolution, in both traces wherever it is sampled, so it has no angle to compare; its component channels are compared and high. In these six models every such phasor is exactly zero or floating-point residue. Official reference traces and tolerances are unchanged.