pydynamicestimator.tests.test_avr_algebraic

Controller-side parity test for the device-private algebraic-equation mechanism.

The generalized AVR strategy protocol lets an exciter expose its field voltage Efd as either a differential state (pure-lag exciter) or a device-private algebraic variable (direct-feedthrough / lead-lag exciter). This test exercises the latter via AVRKundur – the Kundur transducer+lead-lag AVR with Efd as the lead’s algebraic output – and validates it two ways:

  1. The recovered Efd (in dae.y) exactly satisfies its defining equation along the trajectory (internal consistency of the private-algebraic solve).

  2. The lead-lag (algebraic Efd) reproduces AVRKundur_Filter – the same exciter with a parasitic output filter that fakes Efd into a state – in the Tfd -> 0 singular-perturbation limit. The avr_filter fixture uses a small Tfd, so the two systems must agree to O(Tfd).

See docs/algebraic_equations_design.md and CHANGELOG_algebraic_equations.md.

Attributes

FIXTURE_ROOT

_COMMON

Functions

_machine([which])

The synchronous-machine device from the most recent run.

test_avr_leadlag_constraint_holds()

The lead-lag's algebraic field voltage must satisfy its defining equation

test_avr_leadlag_matches_filtered_limit()

AVRKundur (Efd algebraic) must reproduce AVRKundur_Filter (Efd a

test_avr_leadlag_estimation_runs_and_tracks()

An exciter whose field voltage Efd is a device-private ALGEBRAIC variable

Module Contents

pydynamicestimator.tests.test_avr_algebraic.FIXTURE_ROOT
pydynamicestimator.tests.test_avr_algebraic._COMMON
pydynamicestimator.tests.test_avr_algebraic._machine(which='sim')[source]

The synchronous-machine device from the most recent run.

run resets system (clear_module) on entry, so this must be called immediately after a run and before the next one. which selects the simulation or estimation device list.

pydynamicestimator.tests.test_avr_algebraic.test_avr_leadlag_constraint_holds()[source]

The lead-lag’s algebraic field voltage must satisfy its defining equation along the whole trajectory: the recovered Efd (in y_full) equals Vl*(1 - TA/TB) + (TA/TB)*KA*(Vf_ref - Vtr) evaluated on the states.

pydynamicestimator.tests.test_avr_algebraic.test_avr_leadlag_matches_filtered_limit()[source]

AVRKundur (Efd algebraic) must reproduce AVRKundur_Filter (Efd a state behind a fast parasitic filter) in the Tfd -> 0 limit. The avr_filter fixture uses Tfd = 1e-3, so the machine response must agree to O(Tfd).

pydynamicestimator.tests.test_avr_algebraic.test_avr_leadlag_estimation_runs_and_tracks()[source]

An exciter whose field voltage Efd is a device-private ALGEBRAIC variable runs through the full IEKF estimator (qcall noise overlay, init-from-simulation seeding of the private, save/restore) and tracks the simulated truth as well as the eliminated/state-Efd models. Verifies the controller-side private rides the same estimation plumbing as the machine-side SP-DAE privates.