Repository navigation
Version 0.17.0
·
49 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Requirements 0.17.0 (2026-11-09): phasors
Units.Phasors converts between a phasor's two coordinate systems and compares phase angles. All six functions are inlined:
| Function | Converts |
|---|---|
magnitude(re, im) |
rectangular to polar: sqrt(re^2 + im^2) |
phaseAngle(re, im) |
rectangular to polar: atan2(im, re), in (-pi, pi] |
realPart(r, phi) |
polar to rectangular: r*cos(phi) |
imaginaryPart(r, phi) |
polar to rectangular: r*sin(phi) |
wrapAngle(phi) |
an angle wrapped into (-pi, pi] |
phaseDifference(phi1, phi2) |
the phase of one phasor relative to another, wrapped into (-pi, pi] |
- The magnitude is whatever the model carries. The MSL's quasi-static phasors are RMS.
Examples.Elementary.Units.Phasorsasserts:- each function against its closed form;
- agreement with
Modelica.ComplexMath.absandarg; - the round trip;
- the wrap across pi.
- It simulates in OpenModelica 1.27.1, and
Requirements.UnitspassescheckModelthere. Dymola and Modelon Impact were not run for this release. - The SysML v2 side is ChaperoneRequirements v0.16.0. Chaperone's corpus uses these functions to check requirements on a phasor's magnitude, phase angle, and real and imaginary parts.
- No existing class changed. No model conversion is needed:
conversion(noneFromVersion="0.16.0").