Scientific machine learning for sub-synchronous oscillation (SSO) screening in series-compensated and inverter-rich power grids.
The question it keeps asking: will this machine, at this operating point, on this network, see negative slip at the electrical resonance and feed an oscillation, and how fast will it grow?
The project pairs a first-principles reference solver (network electromagnetic transients kept) with hand calculations of the mechanism and with several kinds of learned model: gradient-boosted trees, Gaussian processes, MLP ensembles, physics-informed networks, DeepONet, Fourier neural operators, neural ODEs and sequence models. Its central experiment compares where the physics goes: in the loss, in the input features, in the architecture, or nowhere.
Status: all thirteen phases of the plan are closed. docs/SCREENING.md names the best deterministic and the best learned screen with their operating points. docs/REPORT.md is the final report: every model side by side, the validation record, a catalogue of failures, and what was not done. The solver is validated against hand calculations, a benchmark's published frequencies and independent formulations; it has not been compared with a recorded event.
| Document | What it is |
|---|---|
| docs/REPORT.md | Final report |
| docs/SCREENING.md | The best deterministic and the best learned screen |
| docs/PLAN.md | Scope, physics, learning tasks, phases, exit checks, risks |
| docs/steps/ | Step log: what was run, the numbers, what disagreed |
| docs/EQUATIONS.md | Model equations and sign conventions |
| docs/ASSUMPTIONS.md | Each modelling assumption, how it was tested, and the result |
| docs/VALIDATION.md | What has been checked against what, and what is still open |
A screen answers one question cheaply: can this case be cleared without a detailed study? It is judged first by the unstable cases it clears, then by the share of cases it saves. Every number below is from the step named; the full account is docs/SCREENING.md.
| Best deterministic screen | Best learned screen | |
|---|---|---|
| What it is | The plant's 2 × 2 admittance scan, fitted by least squares and closed on the network at the 32 ends of the network data's ranges; the largest growth rate decides (step 24). For a doubly-fed plant, the phasor-domain model beside it for the band below 2 Hz (step 21) | Hand calculation plus a learned correction, an ensemble of five perceptrons, with a fallback to the solver on the ensemble spread and a range check before it (steps 40, 42) |
| Needs | A scan good to 1 %, the network known to within 10 %, no training | The plant model and about 100,000 solver runs inside a stated range |
| Unstable cases cleared | 0 of 24,659 (doubly-fed plant and two converter types) | 0 of 1,376 in the range |
| Yield | Clears 57.8 % of doubly-fed cases (73.4 % are stable), 87.8 % of converters with a PLL (91.1 %) and 70.6 % without (77.6 %) | Sends 0.72 % of cases to the solver (0.9 % through the service) |
| Cost per case | 32 closed-loop evaluations of a fitted model, after one scan | 3.2 ms through the service, against 15 ms for the solver |
| Outside its range | Has no training range; holds with control delay, outages, several plants and shunt capacitance when each is modelled (steps 25, 27, 29, 30) | Unsafe without the range check: clears 16 of 1,476 unstable cases at high compensation and 8 of 920 at low speed |
| Use it for | The reference screen, black-box plants, and anything outside a learned model's range | Volume inside the range of a plant whose model is known, with the solver behind it |
The two screens were scored on different cases (step 24 on a random quarter of both plant types with uncertain network data, step 40 on the T1 test fold with the network exact), so the columns are not a head-to-head comparison.
Why the deterministic screen works. Sub-synchronous resonance of a doubly-fed plant is a series resonance with a negative resistance in it. At the resonance the rotor turns faster than the stator field, so the slip is negative. The rotor resistance plus the current controller's gain, divided by that slip, is a large negative resistance. Where the reactances cancel, it is set against the network's positive resistance, and if the sum is negative the oscillation grows. So the closer the resonance to the rotor frequency, the worse (0.3 % unstable at 10 to 15 Hz, 33.8 % at 40 to 45 Hz), the current-loop bandwidth is the one controller number that matters, and network resistance matters as much as any reactance (step 14). A test on the size of the loop gain cannot see this, because the loop gain is near −1 at the resonance whether the case is stable or not: the passivity test clears 0.2 % of doubly-fed cases (step 18). The Nyquist count and the closed-loop growth rate test the sum of the impedances and see it.
How little information decides it. The network's R, X and C, the rotor speed and the current-loop bandwidth: a hand calculation of the loop resistance at the resonance. With a margin of 1 1/s (5 1/s where the PLL is faster than the mode) it clears 79.9 % of doubly-fed cases and no unstable one in the range (step 14). A positive-sequence stability model reports every unstable resonance case as stable, but is exact for the slow control mode below 2 Hz that a terminal scan barely sees; the two together cover both bands (step 21).
Why the learned screen takes this form. The hand calculation as the baseline beats it as inputs, and both beat no physics (0.071 against 0.090 1/s). The physics as a loss is the worst use of it, at five to eight times the cost (steps 34, 36, 47). The ensemble spread is what makes it safe in the range: with a margin alone the same model sends 3.0 % to the solver (step 40).
What Phase 13 added (steps 43 to 51).
| Step | Result |
|---|---|
| 43: a published doubly-fed case | With its unstated current-loop gain fitted, frequency within 1.7 Hz and the compensation boundary within 2 points; the gain boundary off by about a third |
| 44: a second implementation of the full controls | Agrees to 5e-8 of the response |
| 45: three disturbances on the response in time | The reduced model's response as inputs cuts the error 2.6 to 3.5 times in distribution and 6 to 13 times at high compensation; no gain for a power ramp, which the reduced model does not see |
| 46: a neural ODE for the physics-in-architecture arm | 11 % to 34 % better than before, still more than twice the error of the perceptron with physics inputs |
| 47: parametric and inverse PINNs | Both fail: the parametric one learns the steady state (error 0.99); the inverse one does not improve on its start |
| 48: physics residuals as detectors | Neither beats the ensemble spread; on the response in time the spread flags every response with more than 10 % error outside the range |
| 49: the converter as a learned screen | 20 % of cases to the solver, none missed in distribution; misses 1 unstable case on two of three outside sets; does not beat the scan screen |
| 50: active learning | 0.89 % to the solver with 4,000 labels, against 7.2 % at random; missed 2 unstable cases in one of three repeats, so not adopted |
| 51: several plants and a graph network | Trained on 2 to 4 buses, half the error of a plant-by-plant study up to 8 buses; not yet a screen on this mostly unstable dataset |
Recommendation. Screen with the deterministic scan first wherever the plant is a black box, a parameter is outside a learned model's range, or the network is changing. Use the learned screen for volume inside its range, with the range check in front and the solver behind. Keep the hand calculation in every output: it is the only warning that does not come from training data, and the explanation an engineer can check.
Still open. No number has been compared with a recorded event or with an electromagnetic-transient tool. Every number is against this project's solver on a representative plant, and the zero counts are counts on these samples, not guarantees.
On the benchmark, the rotor always sees negative slip at the electrical resonance and always presents negative resistance, but never enough to cancel the network's 0.03 pu. The hand estimate of the decay rate matches the full model within 2.6 %. What destabilises this system is the shaft: at the benchmark compensation the second torsional mode grows at +0.36 1/s. Details in docs/steps/01-solver-core-fbm.md.
For an induction generator on the same line, the hand calculation (net resistance at resonance equal to zero) and the solver agree on the self-excitation boundary within 0.9 points of compensation, and exactly when the rotor speed is held. A typical single-cage machine just above synchronous speed is safe up to 96.5 % compensation. The boundary falls quickly with more rotor resistance or a slower rotor, which is what a doubly-fed machine and its current controller bring. Energy taken from the simulated waveform matches the negative resistance of the slip calculation within 1.4 % for a sustained oscillation. Details in docs/steps/02-induction-generator.md.
In a doubly-fed machine the rotor current controller's proportional gain behaves as added rotor resistance. The hand calculation built on that predicts the largest stable gain within 2 % of the solver at standard tuning, and fails as integral action is made stronger (right panel). The energy budget of the simulated oscillation shows the converter absorbing energy and the shaft supplying all of it. This stage has no phase-locked loop, outer loops or grid-side converter yet, and is less stable than plants in service; see docs/steps/03-dfig-current-control.md.
Adding the phase-locked loop, outer loops, grid-side converter and free rotor speed changes the sub-synchronous growth rate at rated speed by 0.1 1/s, provided the grid-side converter feeds the terminal voltage forward. Without that feed-forward its current controller acts as a resistor across the terminals and removes 5 to 10 1/s. The hand calculation stays within 4 points of compensation of the full solver in the first case and is up to 32 points pessimistic in the second. Details in docs/steps/04-dfig-full-controls.md.
A second formulation, loop impedance as polynomials with no state vector, reproduces the state-space modes to 2e-8. Varying the network with it shows that the radial connection studied so far is the worst case. Plant transformers and one parallel path as strong as the line raise the largest stable current-loop bandwidth at rated speed from 3.5 to 19.2 Hz. A partly loaded plant is worse than a full one. The time-domain model with full controls confirms the network results (20.3 Hz on that network). Details in docs/steps/05-network-and-impedance.md.
With stator and network transients dropped, as in a positive-sequence stability tool, the sub-synchronous mode does not exist in the model: of 54 cases, 28 are unstable and all 28 are reported stable, with growth rates up to 28 1/s missed. Keeping the inductances dynamic but fixing the capacitor at its 60 Hz reactance gives a mode 9 to 14 Hz off. Details in docs/steps/06-assumption-studies.md.
A second time-domain implementation, in phase a, b, c quantities with the trapezoidal rule and no shared equations, gives the same growth rates within 0.00014 1/s and shows the oscillation at 60 Hz minus its rotating-frame frequency, as it should. Details in docs/steps/07-phase-coordinates.md.
The first dataset holds 131,072 cases over 12 plant, network and controller parameters, each with the full-solver growth rate and the hand calculation side by side. The hand calculation is off by 1.3 1/s on average and has the sign right in 95.2 % of cases, but only 50.0 % of the time near the stability boundary. Details in docs/steps/08-t1-dataset.md.
The first learned models predict that growth rate from the 12 parameters. A multilayer perceptron trained on 100,000 cases is off by 0.10 1/s on held-out cases; one that learns the correction to the hand calculation instead is off by 0.08 1/s, and by 1.4 to 3 times less than the plain one on the five extrapolation sets. Cases close to the stability boundary remain hard: the best model still calls 21.7 % of the unstable ones stable. Details in docs/steps/09-t1-arms.md.
Learning the correction has a price. Give the hand calculation a random error of 1 1/s and the correcting model is off by 0.85 1/s, while a model that takes the hand calculation as an input learns to distrust it and stays at 0.11 1/s. Details in docs/steps/10-t1-feature-studies.md.
Error bars calibrated on held-out cases cover 90 % inside the training range and between 36 and 94 % outside it. Used as a screen, they send about 1 % of cases to the full solver and cut the unstable cases called stable from 2.0 % to 0.15 %. In batches the plain network is about 7,500 times faster than the solver. Details in docs/steps/11-t1-uncertainty.md.
A network trained on the equations alone, with no solver data, was tried on one case of the induction generator. Over a 0.5 s window it settles onto the steady state, which satisfies the equations as well as the true response does. Scaling each state and marching through time in windows of 0.05 s fix that: 4 % error after 365 s of training, against 4.7 s for the solver. Details in docs/steps/12-forward-pinn.md.
Putting the model's equations into the training loss did not pay for the growth-rate task. With no solver labels the network finds an eigenvalue of the right matrix, but a slow, well-damped one, not the one that matters. With 100 labels the penalty helps at one weight (0.83 to 0.59 1/s) and hurts at ten times that. And the state matrix the penalty needs costs 96 % of a full solve, so the labels might as well be computed. Details in docs/steps/13-eigen-residual.md.
Deterministic screens were lined up by the data they need and scored on how many cases each clears without clearing an unstable one.
- A positive-sequence (phasor-domain) dynamic model is blind to the problem. It reports every unstable case as stable. Its network data, scaled in frequency, is all the screen below needs.
- A frequency scan of the network, with resistance, clears a quarter of cases with no plant data. Without resistance it clears none.
- The root of the loop impedance (network, machine, current loop) with a safety margin clears 80 % of cases, none of them unstable. The margin is 1 1/s where the PLL is slower than the mode and 5 1/s where it is faster. Outside the tested range it wrongly clears 5 unstable cases of 8,673.
- Trees trained on 20,000 solved cases clear 50 % on the same terms. Learned models win on average error and lose in the tail, and a screen is judged by its tail.
- One controller number matters most: the current-loop bandwidth. Outer loops, rotor resistance and exact PLL tuning hardly matter.
Details in docs/steps/14-screening-ladder.md.
- The waveform needs no time-domain run either. For a capacitor-voltage disturbance of 0.2 pu the oscillation computed from the eigenvalues differs from the time-domain run by 0.44 %. A growing oscillation departs from it only when it has reached about 1 pu. What a time-domain run adds is the effect of converter limits, which the model does not yet have.
Details in docs/steps/15-linear-vs-time-domain.md.
- The first limit a growing oscillation meets is the DC link, and the eigenvalues say roughly when. With the rotor-side converter voltage limited to 0.4 pu, the DC-link voltage leaves a 0.2 pu band first in 96 % of cases. The time to that point follows from the modes to within 8 %, erring late. After it the model loses control; it has no chopper, crowbar or trip logic, so what follows is not to be trusted.
Details in docs/steps/16-converter-limit.md.
The same question was put to a plant with no machine: one converter model that can be a source or a load (wind, solar, storage, drive, UPS, power supply), with a phase-locked loop or without one.
- The rule found for the doubly-fed plant does not carry over; the method does. A current loop alone cannot feed an oscillation here. The negative conductance comes from whichever loop holds power constant: the phase-locked loop for a source, the DC voltage loop for a load. Slowing the PLL tenfold cures 81 % of unstable sources and 23 % of unstable loads.
- One screen clears no unstable case in 60,124, with nothing fitted to data. A case is cleared if the loop gain of converter admittance and network impedance is below 1 at every frequency where the converter's conductance is negative. It clears 76 % of cases with a phase-locked loop and 61 % without. It needs a 2 × 2 admittance scan of the converter, which a black-box model can supply, and the network's R, X and C.
- A Nyquist count on the same scans is exact, if the scan is taken at the operating point from a power-flow solution.
- Positive-sequence scans alone miss 40 % of unstable cases, and the short-circuit ratio alone clears nothing safely.
Details in docs/steps/17-generic-converter.md.
The doubly-fed plant was then scanned the same way, as a 2 × 2 admittance against the impedance of its network.
- The loop-gain test of the converter clears 0.2 % of doubly-fed cases. Sub-synchronous resonance is a series resonance: where the reactances cancel the loop gain is near 1 in every case, stable or not, and the resistance left over decides.
- A gain margin with a 30° guard clears no unstable case in 98,635, with nothing fitted. Every eigenvalue of the loop matrix within 30° of the negative real axis must be below 1 in size. It clears 36 % of doubly-fed cases, 86 % of converters with a phase-locked loop and 74 % of those without.
- A Nyquist count on the same scans settles the rest. It agrees with the eigenvalues in all but 1 of 93,704 cases, and has no margin.
- The scan has to be fine. A thin scan clears unstable cases. Points 2.5 % apart in frequency are enough for a guarded test; the count needs 0.6 %.
- The hand formula of the doubly-fed plant was blind to a second mode. It clears 478 test cases that are unstable in a slow mode of the outer loops. The scan sees them.
Details in docs/steps/18-one-screen-two-plants.md.
- A rational function fitted to a clean scan of 251 points gives the right verdict in all 98,635 cases and the growth rate to within 0.01 1/s in 99.9 % of them. The tests at the scan points needed 4,001 points and still erred on the boundary.
- The number of points is set by the order of the system (13 to 23 terms), not by how sharp its resonances are. At 101 points the fit is wrong twice, on the safe side. At 51 it fails on the doubly-fed plant.
- With 5 % noise the fit is useless, because it passes through its points. The pointwise gain margin degrades gently. Scans from a model suit the fit; noisy scans need the guarded test on a dense grid.
- A margin in 1/s is cheap for the converters and not for the doubly-fed plant, whose slow mode decays at 0.2 to 0.4 1/s in every case.
Details in docs/steps/19-rational-fit.md.
- The fit through the points holds only for exact scans. Noise of one part in a million makes it flag most stable cases.
- A least-squares fit of the admittance, closed on the known network, tolerates noise. In the sub-synchronous band the growth rate is uncertain by about 0.06 1/s per percent of scan error in the median.
- A margin sized to the scan error makes it safe. With 1 % noise a margin of 0.5 1/s clears 1 unstable case in 4,397 and costs 4 to 8 points of cleared cases. With 5 % noise the margin has to be 5 1/s and 32 % to 42 % of cases are cleared.
- Accuracy matters more than density. 126 points at 1 % decide more cases than 501 points at 5 %.
- Modes are sorted by frequency, so each gets its own margin. The slow mode of the doubly-fed plant no longer sets the margin for the resonance. That slow mode is too weakly seen at the terminals to screen from a noisy scan; it has to be checked on the plant alone.
Details in docs/steps/20-noise-and-modes.md.
- The doubly-fed plant has a slow mode near 0.5 Hz in every case, made of the rotor current controller integrators, the outer loops and rotor speed. It is unstable in 3.6 % of test cases: slow current loop (below about 8 Hz), fast outer loops, high rotor speed. The series capacitor plays no part.
- The phasor-domain model reproduces it to 0.006 1/s. The same model sees none of the 1,376 cases unstable in the sub-synchronous band. It is exact below 2 Hz and blind above.
- The plant alone on an ideal voltage misses 96 % of the unstable cases. The network's 60 Hz reactance is what tips the mode.
- Two models with no scan cover both bands. The hand formula for the resonance and the phasor-domain model for the slow mode together clear 75.6 % of test cases and no unstable one.
Details in docs/steps/21-slow-mode.md.
- A perfect plant model on a wrong network is not safe. The growth rate of the resonance is off by about 0.08 1/s per percent of error in the network data, the same size as the effect of scan noise. With 5 % error and no margin, one unstable doubly-fed case in seven is cleared.
- Which number matters depends on the plant. For the doubly-fed plant: the series capacitor (0.8 1/s for a 10 % error), then line resistance. For a converter: line reactance, and resistance not at all.
- Margins of several 1/s are needed, and for 10 % error only a margin of 10 1/s clears no unstable case.
- The slow band is immune. A 10 % error moves the slow mode by less than 0.001 1/s, so the phasor-domain screen stays safe.
Details in docs/steps/22-network-error.md.
- If each network number is known to within a bound, run the screen at the ends of the ranges. Five quantities give 32 ends; the largest growth rate among them decides, with no margin.
- It clears no unstable case on any plant type with the network known to within 5 %, 10 % or 20 %.
- It clears far more than a margin of the same safety. Within 10 %: 58 % of doubly-fed cases, 88 % and 70 % of converters, against 9 %, 46 % and 3 % for the margin that is as safe (10, 5 and 10 1/s).
- A margin is one number for every case; the ends give each case its own. Most converter cases hardly depend on the network and a few depend on it strongly.
Details in docs/steps/23-network-corners.md.
- The complete screen: a 2 × 2 scan of the plant at about a hundred frequencies, a least-squares fit, and the fitted plant closed on the network at the 32 ends of the ranges of its data. The largest growth rate decides.
- With a scan good to 1 % and a network known to within 10 % it needs no margin and clears no unstable case in 24,659. It clears 58 % of doubly-fed cases (73 % are stable in the band), 87.8 % of converters with a phase-locked loop (91.1 %) and 70.6 % of those without (77.6 %).
- Allowances do not stack. The spread over the ends already covers 1 % of scan noise. With 5 % noise a margin on top is needed: 1 1/s, or 5 1/s for a converter with a phase-locked loop.
Details in docs/steps/24-noise-and-ranges.md.
- Losing the parallel path is the worst outage for every plant type. A third of doubly-fed cases that are stable with it are unstable without it, and 13 % and 17 % of converters.
- A margin on the intact network does not cover an outage. About one case in ten that decays at 10 1/s intact is insecure after losing the parallel path.
- Half the units out hurts the machine and helps a converter; half the capacitor out does the reverse.
- One scan serves every outage for the doubly-fed plant (growth rate right to 0.01 1/s) and not for a converter, whose admittance moves with the operating point: 203 and 465 insecure cases are cleared if the scan is reused.
Details in docs/steps/25-outages.md.
- At a given power the converter's admittance depends on one more number: its reactive current if it has a phase-locked loop, its terminal voltage if it has not. A scan retaken at that number after an outage is exact.
- With a phase-locked loop two scans 0.1 pu apart and a straight line are enough: no unstable case cleared in 41,033 outage cases and 1 stable case flagged, where reusing one scan clears 78 unstable ones.
- Without one, three scans and a parabola clear 1 unstable case of 753, against 183 for one scan.
- The power flow after each outage supplies the one number. Nothing else has to be recomputed on the plant side.
Details in docs/steps/26-operating-point.md.
- Two converters that are each stable alone can be unstable together: 104 and 57 cases of 32,768, depending on the kind of load. A unit unstable alone is cured by its neighbour in 28 % to 54 % of cases.
- Three shortcuts are all unsafe. Judging each unit alone misses 16 % and 6 % of the unstable pairs. Adding scans taken alone misses 5 % and 4 %. One converter carrying the net power misses 25 % and 23 %.
- The admittances do add, at the right operating point. Each unit has to be scanned at its operating point in the joint power flow.
- A source and a load offset each other and do not cancel. With almost no net power at the bus, 1.4 % to 2.0 % of cases are unstable.
Details in docs/steps/27-two-converters.md.
- On an inductive network each alone does little; together they make a new instability at the filter resonance, around 1 kHz. The share of unstable cases goes from 5.6 % to 29.9 % with a phase-locked loop and from 12.6 % to 40.1 % without.
- The converter alone is stable in every case. The resonance needs the network, so a bench test on a stiff source does not show it.
- Two numbers nearly settle it: a delay under a fifth of a period of the filter resonance (2 unstable of 13,195), or a damping resistor above a quarter per unit (1.6 % unstable).
- The screen still works with a scan that reaches past the resonance: no unstable case missed in 40,792.
- The delay also moves the modes below 58 Hz in a tail of cases. The earlier counts of unstable cases with a phase-locked loop are low by about a quarter.
Details in docs/steps/28-delay-and-capacitor.md.
- Every screen that was safe without a control delay is safe with it, on 15,034 converter cases in and outside the training range.
- The loop-gain test that rests on passivity stops being useful: it clears 23 % and 16 % of cases with the delay, where it cleared 68 % and 45 %. The other screens lose 2 to 5 points.
- The complete screen holds. With a 1 % scan and the network within 10 % it clears 85.5 % and 69.1 % of converters with the delay and no unstable case.
- A stride through a Sobol dataset is a corner of it, not a sample. Four earlier steps had taken every fourth row. They were rerun on a random quarter and their numbers here are the rerun ones.
Details in docs/steps/29-restated-with-delay.md.
- Below 58 Hz it does not matter: the verdict changes in under 1 % of cases.
- Above 58 Hz it is the case. A converter with a control delay and no filter capacitor is unstable in 44.5 % and 49.1 % of cases on a network with shunt capacitance, at the network's parallel resonance, where it was in 7.0 % and 13.4 % on an inductive one.
- With a phase-locked loop no case is unstable while the delay is under a fifth of a period of that resonance.
- A network model without the capacitance misses 85 % and 75 % of those unstable cases. With the capacitance known to within 20 % and both ends evaluated, 2 of 32,550 are missed.
Details in docs/steps/30-shunt-capacitance.md.
- One scan at rated power gives the wrong verdict in 7 % of cases with a phase-locked loop and 17 % without, in both directions and mostly at light load.
- The admittance is smooth in power. Scans at 0.1, 0.55 and 1 pu and a parabola, at the reactive current or voltage of the case, give no wrong verdict in 15,034 cases.
- With a phase-locked loop nine scans taken once cover every operating point. Without one the voltage axis needs scans closer than 0.1 pu or a scan at the voltage of the case.
Details in docs/steps/31-power-axis.md.
- A converter on the same bus steadies the plant's sub-synchronous mode more often than not: in 86 % and 91 % of cases near the boundary, whether it is a source or a load. A plant unstable alone is stable beside it in 28 % and 43 % of cases.
- The complete screen holds for the pair. Each unit scanned at the joint steady state, the network within 10 %, 32 ends: no unstable case cleared in 32,767 pairs.
- Whether the two share a terminal matters more than the neighbour's controls. Merging two terminals that have a transformer each between them misses 9 % and 26 % of the unstable cases.
Details in docs/steps/32-machine-beside-converter.md.
- There is no limit cycle. With a current limit, anti-windup and a DC chopper in the doubly-fed plant, every case with an unstable sub-synchronous mode trips on rotor overcurrent or is still growing after 5 s.
- Protection decides how an unstable case ends, not whether it is one. The plant trips at the same time with and without it.
- The time of the trip follows from the modes to 0.5 % to 2.1 % at the median, with no time-domain run.
- Stable cases stay stable after capacitor-voltage offsets up to 0.3 pu. The small-signal verdict is the verdict.
Details in docs/steps/33-protection.md.
- As inputs, the hand calculation helps with little data: 32 % lower error at 100 cases, 14 % at 1,000, nothing from 10,000.
- As the baseline it helps at both ends and is the best arm on every test set at 100,000 cases, by 23 % to 63 %.
- As a penalty in training it helps only at 100 labels and makes the model 27 % worse from 10,000. It costs five times the training time.
- A learned screen beats the hand calculation only inside its training range. Outside it, the margin set inside clears unstable cases.
Details in docs/steps/34-arm-comparison.md.
- A reduced model as inputs needs almost no data: 93 % lower error than a plain network at 100 trajectories, 76 % to 80 % after.
- Built into the model it is the best arm on every test set, at 13 times the training time.
- As the baseline it needs 1,000 trajectories and falls behind the plain network where the reduced model is far off.
- As a penalty in training it makes the model two to three times worse from 1,000 trajectories, at any weight tried.
- Training length, not data, was the limit: four times the steps cut the error by 63 % to 75 %, where 25 times the data cut nothing.
Details in docs/steps/36-t2-arms.md. The verdicts on the plan's five hypotheses over both tasks, and a table per task for choosing an arm, are in docs/steps/37-phase6-report.md.
- No operator or sequence model beats a perceptron given the reduced model's response. The Fourier neural operator is 39 % above it in distribution and the temporal convolutional network 48 %.
- The physics inputs matter more than the architecture: they cut the error of every model, by 29 % to 77 %.
- Without them every model fails at high compensation, with errors of 0.35 to 1.32 of the response.
- Only the perceptron with physics inputs stays under 10 % error over the whole window on all three sets outside the training range.
Details in docs/steps/38-t2-operators.md.
- On a clean fault-recorder trace, matrix pencil reads the growth rate to 0.03 1/s from 0.3 s of current. It breaks between 20 and 10 dB of noise.
- A network trained on the plant's waveforms is better from 30 dB down and gets the sign right in 96.6 % of cases at 0 dB.
- A phasor unit at 60 or 30 frames per second reports the mode at a folded frequency, 8 Hz and 30 Hz from the true one. At 60 frames the growth rate survives; at 30 it does not.
- The current pins down the series compensation and little else. The phase-locked loop cannot be identified once the noise passes about 20 dB.
- A fit through the full model reaches the theoretical bound, if a network gives it the start. From the middle of the range it fails in over 90 % of cases.
Details in docs/steps/39-measurement-inverse.md.
- Inside the training range the learned screen needs the solver for 0.7 % of cases and calls no unstable case stable (0 of 1,376). The rule: trust the sign when the prediction is far from zero in units of the spread of five networks.
- The hand calculation as the baseline does most of that: with no detector at all it leaves 3.0 % for the solver, against 14.8 % for a plain network.
- Outside the range no detector is enough. At compensation above 80 % or speed below 0.8 pu every one lets unstable cases through. A check of the inputs against the training range is what works.
- The hand calculation is the best second opinion outside the range, because it is the one signal that does not come from the training data.
Details in docs/steps/40-fallback.md.
- A damping controller that takes the current loop's gain away at the resonance is worth 3 to 11 1/s. The best design always has the loop bandwidth at its floor and the controller at full strength: the gain is the negative resistance.
- Four of five capacitor segments can stay in service; the fifth cannot. At 75 % compensation the mode's frequency spreads over 14 Hz across operating points, more than one filter covers.
- Bayesian optimisation on the solver finds the design in about 260 solver calls, CMA-ES in two to three times that, random search not at all on the hard problem.
- A surrogate with an average error of 0.05 1/s proposed a design it called stable and the solver called unstable. A search goes where the model is too low. The solver has to confirm.
Details in docs/steps/41-design-search.md.
uv run scripts/serve.pystarts a service withPOST /screen(growth rate and frequency of the mode from 12 parameters) andPOST /simulate(the response in time from the solver).- Every answer says where it came from. Inside the training range and far enough from the boundary it is the registered model's, in 3 ms. Otherwise it is the solver's, in 15 ms, with the reason.
- Every answer carries the mechanism: the resonance frequency, the slip there, the machine's and the loop's resistance, and the hand calculation as a second opinion.
- The registered model sends 0.9 % of test cases to the solver and calls no unstable case stable. Its card, with its limits, is docs/model_cards/t1-screen.md.
Details in docs/steps/42-service.md.
Requires uv and, for training, an NVIDIA GPU with a current driver. Developed on Windows 11 with an RTX 3070 (8 GB).
git clone git@github.com:TimThacker/sso-sciml.git
cd sso-sciml
uv sync
uv run scripts/check_gpu.py
uv run pytestuv sync installs the CUDA 13.0 build of PyTorch on Windows and the CPU build elsewhere.
| Task | Command |
|---|---|
| Sync environment to lockfile | uv sync |
| Run tests | uv run pytest |
| Run tests without a GPU | uv run pytest -m "not gpu" |
| Lint | uv run ruff check |
| Add a dependency | uv add <package> |
| GPU report and benchmark | uv run scripts/check_gpu.py |
| Reproduce Phase 1 numbers and figures | uv run scripts/phase1_validate.py |
| Reproduce the induction generator study | uv run scripts/phase2_induction.py |
| Reproduce the doubly-fed machine study | uv run scripts/phase2_dfig.py |
| Reproduce the full-control study | uv run scripts/phase2_dfig_full.py |
| Reproduce the network study | uv run scripts/phase2_network.py |
| Reproduce its time-domain confirmation | uv run scripts/phase2_meshed.py |
| Reproduce the assumption studies | uv run scripts/phase2_assumptions.py |
| Reproduce the phase-coordinate cross-check | uv run scripts/phase2_abc.py |
| Generate the T1 dataset (about 7 minutes) | uv run scripts/phase3_generate_t1.py |
| Generate the converter dataset C1 (about 10 minutes) | uv run scripts/phase3_generate_c1.py |
| Reproduce the converter screens | uv run scripts/converter_screens.py |
| Scan the doubly-fed plant of dataset T1 (about 6 minutes) | uv run scripts/phase3_scan_t1.py |
| Reproduce the screens on scans of both plant types | uv run scripts/scan_screens.py |
| Fit rational functions to the scans (about 30 minutes) | uv run scripts/phase3_fit_scans.py |
| Reproduce the rational-fit screen | uv run scripts/fit_screens.py |
| Fit noisy scans by least squares (about 37 minutes) | uv run scripts/phase3_noise_fits.py |
| Reproduce the noise study | uv run scripts/noise_screens.py |
| Reproduce the slow-mode study (about 10 minutes) | uv run scripts/slow_mode.py |
| Reproduce the network-error study (about 25 minutes) | uv run scripts/network_error.py |
| Reproduce the screen at the ends of the network ranges | uv run scripts/network_corners.py |
| Reproduce scan noise and network ranges together (about 25 minutes) | uv run scripts/noise_and_ranges.py |
| Reproduce the outage study (about 20 minutes) | uv run scripts/outages.py |
| Reproduce the operating-point study (about 20 minutes) | uv run scripts/operating_point.py |
| Reproduce the source-and-load study (about 5 minutes) | uv run scripts/two_converters.py |
| Reproduce the delay and filter-capacitor study (about 8 minutes) | uv run scripts/delay_and_capacitor.py |
| Build and register the screening model (needs the T1 dataset) | uv run scripts/phase11_build.py |
| Start the screening service | uv run scripts/serve.py |
| Gather the numbers of the final report | uv run scripts/phase12_report.py |
MIT. See LICENSE.



























