pydynamicestimator.tests.test_compute_i_full

Numerical validation of compute_i_full post-processing against CasADi branch_current_fun.

Compares the new vectorized NumPy i_full computation against the original per-step CasADi build_branch_current_fun approach across multiple scenarios.

All tests use frozen fixtures under tests/fixtures/ rather than the shared pydynamicestimator/systems/ workspace, so interactive edits to the demo systems cannot silently change test behavior. See tests/fixtures/README.md.

Attributes

FIXTURE_ROOT

Functions

_recompute_i_full_casadi(sim)

Recompute i_full using the old CasADi branch_current_fun approach.

test_no_faults_incl_lim_true()

nom mode, LOAD step at t=1s, incl_lim=True: should match to machine precision.

test_no_faults_incl_lim_false()

nom mode, LOAD step at t=1s, incl_lim=False: should match to machine precision.

test_bus_fault_incl_lim_true()

nom mode, FAULT_BUS + CLEAR_FAULT_BUS, incl_lim=True.

test_dist_mode_incl_lim_true()

dist mode (has_delta_ref=True) under LOAD step at t=1s, incl_lim=True.

test_coi_mode_incl_lim_true()

coi mode, incl_lim=True.

test_line_dyn_true()

nom mode, line_dyn=True, incl_lim=False.

Module Contents

pydynamicestimator.tests.test_compute_i_full.FIXTURE_ROOT
pydynamicestimator.tests.test_compute_i_full._recompute_i_full_casadi(sim)[source]

Recompute i_full using the old CasADi branch_current_fun approach.

pydynamicestimator.tests.test_compute_i_full.test_no_faults_incl_lim_true()[source]

nom mode, LOAD step at t=1s, incl_lim=True: should match to machine precision.

pydynamicestimator.tests.test_compute_i_full.test_no_faults_incl_lim_false()[source]

nom mode, LOAD step at t=1s, incl_lim=False: should match to machine precision.

pydynamicestimator.tests.test_compute_i_full.test_bus_fault_incl_lim_true()[source]

nom mode, FAULT_BUS + CLEAR_FAULT_BUS, incl_lim=True.

pydynamicestimator.tests.test_compute_i_full.test_dist_mode_incl_lim_true()[source]

dist mode (has_delta_ref=True) under LOAD step at t=1s, incl_lim=True.

pydynamicestimator.tests.test_compute_i_full.test_coi_mode_incl_lim_true()[source]

coi mode, incl_lim=True.

COI frequency deviates from 1.0 pu during transients, so the omega=1.0 approximation in build_y() causes a small error vs the frequency-aware CasADi function. Same root cause as the dist mode discrepancy.

Uses the LOAD-step fixture so the disturbance is pinned.

pydynamicestimator.tests.test_compute_i_full.test_line_dyn_true()[source]

nom mode, line_dyn=True, incl_lim=False.