Describe the bug
The state estimation test: test_observability_analysis_and_pseudo_meas.py is not passing.
To Reproduce
Steps to reproduce the behavior:
- Run test_observability_analysis_and_pseudo_meas.py from tests folder
- Fails with error
============================== 1 failed in 3.28s ==============================
FAILED [100%]
src\tests\StateEstimation\test_observability_analysis_and_pseudo_meas.py:8 (test_se_with_and_without_pseudo_measurements)
def test_se_with_and_without_pseudo_measurements():
grid = gce.MultiCircuit()
# --- Buses ---
b1 = gce.Bus(name='B1', is_slack=True)
b2 = gce.Bus(name='B2')
b3 = gce.Bus(name='B3')
grid.add_bus(b1)
grid.add_bus(b2)
grid.add_bus(b3)
# --- Lines ---
br1 = gce.Line(bus_from=b1, bus_to=b2, r=0.01, x=0.03)
br2 = gce.Line(bus_from=b1, bus_to=b3, r=0.02, x=0.05)
br3 = gce.Line(bus_from=b2, bus_to=b3, r=0.03, x=0.08)
grid.add_line(br1)
grid.add_line(br2)
grid.add_line(br3)
Sb = 100.0
# --- Sparse measurements (insufficient) ---
grid.add_pf_measurement(gce.PfMeasurement(0.888 * Sb, 0.008 * Sb, br1))
# grid.add_pf_measurement(PfMeasurement(1.173 * Sb, 0.008 * Sb, br2))
#grid.add_pi_measurement(PiMeasurement(-0.501 * Sb, 0.01 * Sb, b2))
grid.add_qf_measurement(gce.QfMeasurement(0.568 * Sb, 0.008 * Sb, br1))
grid.add_qf_measurement(gce.QfMeasurement(0.663 * Sb, 0.008 * Sb, br2))
#grid.add_qi_measurement(QiMeasurement(-0.286 * Sb, 0.01 * Sb, b2))
grid.add_vm_measurement(gce.VmMeasurement(1.006, 0.004, b1))
grid.add_vm_measurement(gce.VmMeasurement(0.968, 0.004, b2))
# --- SE without pseudo-measurements ---
se_options_no_pseudo = gce.StateEstimationOptions(
fixed_slack=False,
run_observability_analyis=True,
add_pseudo_measurements=False, # no pseudo
pseudo_meas_std=1.0,
solver=gce.SolverType.NR, # NR used because in LM and GN we have relaxations that tend the
# solution to converge
verbose=0
)
se_no_pseudo = gce.StateEstimationDriver(circuit=grid, options=se_options_no_pseudo)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=MatrixRankWarning)
warnings.filterwarnings("ignore", message="invalid value encountered in divide", category=RuntimeWarning)
se_no_pseudo.run()
report_no_pseudo = se_no_pseudo.results.convergence_reports[0]
assert report_no_pseudo
assert not report_no_pseudo.is_observable
E assert not True
E + where True = <VeraGridEngine.Simulations.StateEstimation.state_stimation_driver.StateEstimationConvergenceReport object at 0x000002025EA0CA10>.is_observable
StateEstimation\test_observability_analysis_and_pseudo_meas.py:58: AssertionError
Expected behavior
There should be no observability or convergence when no measurements are provided.
The problematic lines, found in run method of state estimation driver are:
converged=solution.converged if solution else False,
is_observable=solution.is_observable if solution else is_observable,
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows 11
- Version 6.0.20
Describe the bug
The state estimation test: test_observability_analysis_and_pseudo_meas.py is not passing.
To Reproduce
Steps to reproduce the behavior:
============================== 1 failed in 3.28s ==============================
FAILED [100%]
src\tests\StateEstimation\test_observability_analysis_and_pseudo_meas.py:8 (test_se_with_and_without_pseudo_measurements)
def test_se_with_and_without_pseudo_measurements():
grid = gce.MultiCircuit()
E assert not True
E + where True = <VeraGridEngine.Simulations.StateEstimation.state_stimation_driver.StateEstimationConvergenceReport object at 0x000002025EA0CA10>.is_observable
StateEstimation\test_observability_analysis_and_pseudo_meas.py:58: AssertionError
Expected behavior
There should be no observability or convergence when no measurements are provided.
The problematic lines, found in run method of state estimation driver are:
converged=solution.converged if solution else False,
is_observable=solution.is_observable if solution else is_observable,
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):