hermess.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).

Attributes

FIXTURE_ROOT

_COMMON

Functions

_machine()

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

Module Contents

hermess.tests.test_avr_algebraic.FIXTURE_ROOT
hermess.tests.test_avr_algebraic._COMMON
hermess.tests.test_avr_algebraic._machine()[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.

hermess.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.

hermess.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).