pydynamicestimator.tests.test_post_fault_omega_modes

Regression tests: simulation must stay finite and bounded after a fault for every reference-frame mode (nom, coi, single, dist) and both line_dyn settings.

Covers the bug where DaeSim.exec_dist() rebuilt self.x via init_symbolic() but did not refresh self.omega_ref_*_expr, leaving the post-fault integrator substituting placeholders with expressions that referenced the pre-rebuild SX symbols. The symptom was post-fault divergence or garbage trajectories for every omega_mode except ‘nom’ (whose ω_ref is a numeric constant).

Attributes

FIXTURE_ROOT

Functions

_base_config(omega_mode, line_dyn, testsystemfile)

_omega_state_indices(→ list[int])

Return indices of states whose name ends in '_omega' (synchronous-machine

_assert_post_fault_healthy(→ None)

test_open_line_post_fault(→ None)

3_bus_lineopen: OPEN_LINE at t=1.0s. Sim must complete and stay sane.

test_bus_fault_post_clear(→ None)

3_bus_busfault: FAULT_BUS at t=1.0s, CLEAR at t=1.04s. Sim must

Module Contents

pydynamicestimator.tests.test_post_fault_omega_modes.FIXTURE_ROOT
pydynamicestimator.tests.test_post_fault_omega_modes._base_config(omega_mode: str, line_dyn: bool, testsystemfile: str)[source]
Parameters:
  • omega_mode (str)

  • line_dyn (bool)

  • testsystemfile (str)

pydynamicestimator.tests.test_post_fault_omega_modes._omega_state_indices(sim) list[int][source]

Return indices of states whose name ends in ‘_omega’ (synchronous-machine rotor speeds and similar). Used as a sanity-check probe.

Return type:

list[int]

pydynamicestimator.tests.test_post_fault_omega_modes._assert_post_fault_healthy(sim, fault_time: float) None[source]
Parameters:

fault_time (float)

Return type:

None

pydynamicestimator.tests.test_post_fault_omega_modes.test_open_line_post_fault(omega_mode: str, line_dyn: bool) None[source]

3_bus_lineopen: OPEN_LINE at t=1.0s. Sim must complete and stay sane.

Parameters:
  • omega_mode (str)

  • line_dyn (bool)

Return type:

None

pydynamicestimator.tests.test_post_fault_omega_modes.test_bus_fault_post_clear(omega_mode: str, line_dyn: bool) None[source]

3_bus_busfault: FAULT_BUS at t=1.0s, CLEAR at t=1.04s. Sim must complete and recover to plausible state.

Parameters:
  • omega_mode (str)

  • line_dyn (bool)

Return type:

None