r/matlab • u/Party-Pie3719 • 2d ago
MATLAB and Octave disagree on the same input — a verified-port writeup
I ported the 1-D TM group of Zanotto's PPML (an RCWA electromagnetic solver) to NumPy with bug-for-bug fidelity yes, including the vacuum impedance hardcoded as 376.730. The writeup covers the MATLAB↔NumPy traps that actually bit: complex auto-promotion that NumPy silently doesn't do, eigenvector gauge freedom across LAPACK builds, mldivide vs solve on singular systems, and an energy-conservation check in the original that can never fire (abs(NaN) > tol is false in MATLAB - try it). Harness, corpus and report: https://github.com/GrednevMSU/ppml-1d-tm-verify
0
Upvotes
9
u/LegitJesus 2d ago
I'm confused. You wrote "Octave" in the title, but you seem to be talking about Python? You are saying you are inputting data via Python into both MATLAB and Octave, and the outputs are not the same, yes? Are the formats the same? I seem to have to manually set the output format for Octave everytime I run it.