Commit 033a5f8
committed
fix(cmc): analytical voltage waveform must lead current by 90 degrees
Inputs::create_waveform now accepts an optional phase (radians) argument
applied to SINUSOIDAL waveforms only (default 0, backward compatible).
CommonModeChoke's analytical path passes pi/2 for the voltage so the
ideal-inductor relation V = L * dI / dt is honoured: if I = Ipeak*sin(wt)
then V = L*w*Ipeak*cos(wt), leading I by 90 degrees.
Previously both V and I were emitted as sin(wt) with no phase offset,
which disagreed with the simulated (ngspice) path and was unphysical
for a pure inductor. A new regression SECTION in
Test_Cmc_AnalyticalVsSimulated_WaveformShapeEquality locks the 90 deg
lead in place by checking peak-index separation on the analytical
samples.
Also updated the 3-winding section of
Test_Cmc_AnalyticalVsSimulated_CurrentConsistency to scale iCmPeak by
V_mains / 230 V, matching the cmExcitationScaling factor introduced
upstream so the assertion stays meaningful at non-default mains voltage.1 parent cba12bd commit 033a5f8
4 files changed
Lines changed: 104 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
| |||
328 | 351 | | |
329 | 352 | | |
330 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
331 | 358 | | |
332 | 359 | | |
333 | 360 | | |
| |||
354 | 381 | | |
355 | 382 | | |
356 | 383 | | |
357 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
358 | 387 | | |
359 | 388 | | |
360 | 389 | | |
361 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
362 | 397 | | |
363 | 398 | | |
364 | 399 | | |
365 | 400 | | |
366 | 401 | | |
367 | | - | |
368 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
369 | 406 | | |
370 | 407 | | |
371 | 408 | | |
| |||
737 | 774 | | |
738 | 775 | | |
739 | 776 | | |
740 | | - | |
741 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
742 | 782 | | |
743 | 783 | | |
744 | 784 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
| 693 | + | |
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
| 942 | + | |
942 | 943 | | |
943 | 944 | | |
944 | 945 | | |
| |||
950 | 951 | | |
951 | 952 | | |
952 | 953 | | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
957 | 965 | | |
958 | 966 | | |
959 | 967 | | |
| |||
1071 | 1079 | | |
1072 | 1080 | | |
1073 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1074 | 1120 | | |
1075 | 1121 | | |
1076 | 1122 | | |
| |||
0 commit comments