VeraGridEngine.Simulations.StateEstimation package

Submodules

VeraGridEngine.Simulations.StateEstimation.observability_analysis module

VeraGridEngine.Simulations.StateEstimation.observability_analysis.add_pseudo_measurements_for_unobservable_buses(bus_dict, unobservable_buses: object, se_input: object, V: object, Ybus: object, Cf: object, Ct: object, sigma_pseudo_meas_value: object = 1.0, Sbase=100, logger: object = None) StateEstimationInput[source]

Full preprocessing: detect unobservable buses and add pseudo-measurements

VeraGridEngine.Simulations.StateEstimation.observability_analysis.build_local_groups(measurement_ids, include_line_measurements_on_both_ends=True)[source]
VeraGridEngine.Simulations.StateEstimation.observability_analysis.bus_observability_profile(measurement_profile)[source]

Convert measurement_profile (from profile_measurements) into a nested dict: {measurement_type: {bus: worst_status}}

VeraGridEngine.Simulations.StateEstimation.observability_analysis.check_for_observability_and_return_unobservable_buses(nc: NumericalCircuit, Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, no_slack: ndarray[tuple[Any, ...], dtype[int64]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, se_input: StateEstimationInput, fixed_slack: bool = True, tolerance_for_observability_score=1e-06, do_profiling_of_measurements: bool = False, include_line_measurements_on_both_ends: bool = True, logger: Logger | None = None)[source]

Fast decoupled WLS state estimator using LU decomposition based observability analysis Active power -> angles Reactive power -> voltage magnitudes

VeraGridEngine.Simulations.StateEstimation.observability_analysis.classify_redundancy(H, idx, tol=1e-09)[source]

Classify redundant measurement into none/single/multiple redundancy.

VeraGridEngine.Simulations.StateEstimation.observability_analysis.parallel_measurement_profiling(Ha, Hr, Hv, Hi, measurement_ids, a_idx, r_idx, v_idx, i_idx, include_line_measurements_on_both_ends=True)[source]

Parallel execution of all 4 measurement profiling strategies.

VeraGridEngine.Simulations.StateEstimation.observability_analysis.plot_bus_observability(bus_status_per_type)[source]

bus_status_per_type: dict of dicts Example: {

β€˜active’: {β€˜bus_1’: β€˜critical’, β€˜bus_2’: β€˜globally redundant’, …}, β€˜reactive’: {…}, β€˜voltage’: {…}, β€˜current’: {…}

}

VeraGridEngine.Simulations.StateEstimation.observability_analysis.profile_measurements(Hsub, ids, tol=1e-09, include_line_measurements_on_both_ends=True)[source]

Condition System rank Local rank Classification Rank drops system-wide ↓ – Critical System rank full full full Locally redundant (local rank unchanged) System rank full full ↓ Globally redundant ( local rank ↓)

VeraGridEngine.Simulations.StateEstimation.observability_analysis.profile_measurements_ultrafast(Hsub, ids, tol=1e-09, include_line_measurements_on_both_ends=True)[source]

Ultra-fast version with identical results to original.

VeraGridEngine.Simulations.StateEstimation.pseudo_measurements_augmentation module

class VeraGridEngine.Simulations.StateEstimation.pseudo_measurements_augmentation.PseudoMeasurement(value, sigma, api_obj: Bus, name='', idtag=None)[source]

Bases: MeasurementTemplate

CLASS_NON_EDITABLE_PROPERTIES = ('idtag', 'diff_changes', 'device_idtag', 'tpe', 'device_name')
CLASS_PROPERTIES_WITH_PROFILE = {'sigma': 'sigma_prof', 'value': 'value_prof'}
CLASS_PROPERTY_DECLARATIONS = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:value, prop:sigma)
CLASS_PROPERTY_LIST = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:device_idtag, prop:tpe, prop:device_name, prop:value, prop:sigma)
CLASS_REGISTERED_PROPERTIES = {'action': prop:action, 'code': prop:code, 'comment': prop:comment, 'device_idtag': prop:device_idtag, 'device_name': prop:device_name, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'name': prop:name, 'rdfid': prop:rdfid, 'sigma': prop:sigma, 'tpe': prop:tpe, 'value': prop:value}
get_standard_deviation_pu(Sbase: float)[source]
get_value_pu(Sbase: float)[source]
VeraGridEngine.Simulations.StateEstimation.pseudo_measurements_augmentation.add_pseudo_measurements(se_input, unobservable_buses, V, Ybus, neighbors, bus_dict, sigma_pseudo=1.0, Sbase=100, logger=None)[source]

Extend se_input with pseudo-measurements for unobservable buses. neighbors: prebuilt neighbor list per bus

VeraGridEngine.Simulations.StateEstimation.pseudo_measurements_augmentation.build_neighbors(Cf, Ct)[source]

Build neighbor list per bus from connectivity matrices. Cf, Ct: sparse branch-to-bus incidence matrices

VeraGridEngine.Simulations.StateEstimation.pseudo_measurements_augmentation.compute_power_injection(bus, V, Ybus, neighbors)[source]

Compute AC active and reactive power injection for a bus using neighbors. neighbors: prebuilt list of lists, neighbors[i] = list of neighbor bus indices

VeraGridEngine.Simulations.StateEstimation.state_estimation module

VeraGridEngine.Simulations.StateEstimation.state_estimation.Jacobian_SE(Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, V: ndarray[tuple[Any, ...], dtype[complex128]], f: ndarray[tuple[Any, ...], dtype[int64]], t: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, inputs: StateEstimationInput, pvpq: ndarray[tuple[Any, ...], dtype[int64]], load_per_bus: ndarray[tuple[Any, ...], dtype[complex128]], fixed_slack: bool)[source]

Get the arrays for calculation :param Ybus: Admittance matrix :param Yf: β€œfrom” admittance matrix :param Yt: β€œto” admittance matrix :param V: Voltages complex vector :param f: array of β€œfrom” indices of branches :param t: array of β€œto” indices of branches :param Cf: Connectivity matrix β€œfrom” :param Ct: Connectivity matrix β€œto” :param inputs: instance of StateEstimationInput :param pvpq: array of pq|pv bus indices :param load_per_bus: Array of load per bus in p.u. (used to compute the Pg and Qg measurements) :param fixed_slack: if true, the measurements on the slack bus are omitted :return: H (jacobian), h (residual), S (power injections)

VeraGridEngine.Simulations.StateEstimation.state_estimation.b_test(sigma2: ndarray[tuple[Any, ...], dtype[float64]], H: csc_matrix, dz: ndarray, HtWH: csc_matrix, c_threshold: float = 4.0, logger: Logger | None = None)[source]

From RELIABLE BAD DATA PROCESSING FOR REAL-TIME STATE ESTIMATION, 1983 Monticelli & Garcia (1983) β€˜b-test’ bad data detection :param sigma2: sigma 2 :param H: Jacobian at the solution (m x k) :param dz: residuals r = z - h(x^) (length m) :param HtWH: G = H^T W H (k x k) :param c_threshold: detection threshold β€˜c’ (use 4.0 as in the paper) :param logger: Logger :return:

β€˜r’ : residuals r_i β€˜sigma2’ : sigma_i^2 β€˜Pii’ : residual variances P_ii β€˜rN’ : normalized residuals r_i / sqrt(P_ii) β€˜imax’ : index of largest |rN| β€˜b’ : b at imax β€˜is_bad’ : bool

VeraGridEngine.Simulations.StateEstimation.state_estimation.decoupled_state_estimation(nc: NumericalCircuit, Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, Yshunt_bus: ndarray[tuple[Any, ...], dtype[complex128]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, se_input: StateEstimationInput, vd: ndarray[tuple[Any, ...], dtype[int64]], pv: ndarray[tuple[Any, ...], dtype[int64]], no_slack: ndarray[tuple[Any, ...], dtype[int64]], tol=1e-09, max_iter=100, verbose: int = 0, c_threshold: float = 4.0, prefer_correct: bool = False, fixed_slack: bool = False, logger: Logger | None = None) NumericStateEstimationResults[source]

Fast decoupled WLS state estimator using LU decomposition. Active power -> angles Reactive power -> voltage magnitudes

VeraGridEngine.Simulations.StateEstimation.state_estimation.get_measurements_and_deviations(t: int | None, se_input: StateEstimationInput, Sbase: float, use_current_squared_meas: bool = True) Tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[object_]]][source]

get_measurements_and_deviations the measurements into β€œmeasurements” and β€œsigma” ordering: Pinj, Pflow, Qinj, Qflow, Iflow, Vm :param t: time step :param se_input: StateEstimationInput object :param Sbase: base power in MVA (i.e. 100 MVA) :param use_current_squared_meas: use squared current measurements? :return: measurements vector in per-unit, sigma vector in per-unit

VeraGridEngine.Simulations.StateEstimation.state_estimation.solve_se_gauss_newton(nc: NumericalCircuit, Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, Yshunt_bus: ndarray[tuple[Any, ...], dtype[complex128]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, se_input: StateEstimationInput, vd: ndarray[tuple[Any, ...], dtype[int64]], pv: ndarray[tuple[Any, ...], dtype[int64]], no_slack: ndarray[tuple[Any, ...], dtype[int64]], tol=1e-09, max_iter=100, verbose: int = 0, c_threshold: float = 4.0, prefer_correct: bool = False, fixed_slack: bool = False, logger: Logger | None = None) NumericStateEstimationResults[source]

Linearize the non-linear measurement model around the current state estimate (Jacobian H)

Solve the linear WLS problem: Ξ”x = 1/(Hα΅€WH)Hα΅€Wdz

Update the state: x = x + Ξ”x

Repeat until convergence

VeraGridEngine.Simulations.StateEstimation.state_estimation.solve_se_lm(nc: NumericalCircuit, Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, Yshunt_bus: ndarray[tuple[Any, ...], dtype[complex128]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, se_input: StateEstimationInput, vd: ndarray[tuple[Any, ...], dtype[int64]], pv: ndarray[tuple[Any, ...], dtype[int64]], no_slack: ndarray[tuple[Any, ...], dtype[int64]], tol=1e-09, max_iter=100, verbose: int = 0, c_threshold: float = 4.0, prefer_correct: bool = False, fixed_slack: bool = False, logger: Logger | None = None) NumericStateEstimationResults[source]

Solve the state estimation problem using the Levenberg-Marquadt method :param nc: instance of NumericalCircuit :param Ybus: Admittance matrix :param Yf: Admittance matrix of the from Branches :param Yt: Admittance matrix of the to Branches :param Yshunt_bus: Array of shunt admittances :param F: array with the from bus indices of all the Branches :param T: array with the to bus indices of all the Branches :param Cf: :param Ct: :param se_input: state estimation input instance (contains the measurements) :param vd: array of slack node indices :param pv: array of PV node indices :param no_slack: array of non-slack node indices :param tol: Tolerance :param max_iter: Maximum nuber of iterations :param verbose: Verbosity level :param c_threshold: Bad data detection threshold β€˜c’ (4 as default) :param prefer_correct: if true the measurements are corrected instead of deleted :param fixed_slack: if true, the measurements on the slack bus are omitted :param logger: log it out :return: NumericPowerFlowResults instance

VeraGridEngine.Simulations.StateEstimation.state_estimation.solve_se_nr(nc: NumericalCircuit, Ybus: csc_matrix, Yf: csc_matrix, Yt: csc_matrix, Yshunt_bus: ndarray[tuple[Any, ...], dtype[complex128]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], Cf: csc_matrix, Ct: csc_matrix, se_input: StateEstimationInput, vd: ndarray[tuple[Any, ...], dtype[int64]], pv: ndarray[tuple[Any, ...], dtype[int64]], no_slack: ndarray[tuple[Any, ...], dtype[int64]], tol=1e-09, max_iter=100, verbose: int = 0, c_threshold: float = 4.0, prefer_correct: bool = False, fixed_slack: bool = False, logger: Logger | None = None) NumericStateEstimationResults[source]

Solve the state estimation problem using the Levenberg-Marquadt method :param nc: instance of NumericalCircuit :param Ybus: Admittance matrix :param Yf: Admittance matrix of the from Branches :param Yt: Admittance matrix of the to Branches :param Yshunt_bus: Array of shunt admittances :param F: array with the from bus indices of all the Branches :param T: array with the to bus indices of all the Branches :param Cf: :param Ct: :param se_input: state estimation input instance (contains the measurements) :param vd: array of slack node indices :param pv: array of PV node indices :param no_slack: array of non-slack node indices :param tol: Tolerance :param max_iter: Maximum nuber of iterations :param verbose: Verbosity level :param c_threshold: Bad data detection threshold β€˜c’ (4 as default) :param prefer_correct: if true the measurements are corrected instead of deleted :param fixed_slack: if true, the measurements on the slack bus are omitted :param logger: log it out :return: NumericPowerFlowResults instance

VeraGridEngine.Simulations.StateEstimation.state_estimation_inputs module

class VeraGridEngine.Simulations.StateEstimation.state_estimation_inputs.StateEstimationInput[source]

Bases: object

size()[source]
slice(bus_idx: ndarray[tuple[Any, ...], dtype[int64]], branch_idx: ndarray[tuple[Any, ...], dtype[int64]]) StateEstimationInput[source]

Slice this object given the island branch and bus indices :param bus_idx: array of bus indices of an island :param branch_idx: array of branch indices of an island :return: new sliced StateEstimationInput

slice_with_mask(mask: ndarray[tuple[Any, ...], dtype[bool]]) StateEstimationInput[source]

Get a new StateEstimationInput without the measurements that fall in the mask marked with a 0 :param mask: mask of measurements to keep :return: StateEstimationInput

VeraGridEngine.Simulations.StateEstimation.state_estimation_inputs.slice_pair(obj_measurements: List[MeasurementTemplate], obj_indices: List[int], index_map: Dict[int, int])[source]

Slice obj_measurements and obj_indices using an index->island index map :param obj_measurements: list of measurements :param obj_indices: list of device indices where the measurement applies :param index_map: main index -> island index mapping :return: new_obj_measurement, new_obj_index

VeraGridEngine.Simulations.StateEstimation.state_estimation_results module

class VeraGridEngine.Simulations.StateEstimation.state_estimation_results.NumericStateEstimationResults(V: ndarray[tuple[Any, ...], dtype[complex128]], Scalc: ndarray[tuple[Any, ...], dtype[complex128]], m: ndarray[tuple[Any, ...], dtype[float64]], tau: ndarray[tuple[Any, ...], dtype[float64]], Sf: ndarray[tuple[Any, ...], dtype[complex128]], St: ndarray[tuple[Any, ...], dtype[complex128]], If: ndarray[tuple[Any, ...], dtype[complex128]], It: ndarray[tuple[Any, ...], dtype[complex128]], loading: ndarray[tuple[Any, ...], dtype[complex128]], losses: ndarray[tuple[Any, ...], dtype[complex128]], Pf_vsc: ndarray[tuple[Any, ...], dtype[float64]], St_vsc: ndarray[tuple[Any, ...], dtype[complex128]], If_vsc: ndarray[tuple[Any, ...], dtype[float64]], It_vsc: ndarray[tuple[Any, ...], dtype[complex128]], losses_vsc: ndarray[tuple[Any, ...], dtype[float64]], loading_vsc: ndarray[tuple[Any, ...], dtype[float64]], Sf_hvdc: ndarray[tuple[Any, ...], dtype[complex128]], St_hvdc: ndarray[tuple[Any, ...], dtype[complex128]], losses_hvdc: ndarray[tuple[Any, ...], dtype[complex128]], loading_hvdc: ndarray[tuple[Any, ...], dtype[float64]], norm_f: float, converged: bool, iterations: int, elapsed: float, bad_data_detected=False, is_observable=True)[source]

Bases: object

NumericStateEstimationResults, used to return values from the numerical methods

If
If_vsc
It
It_vsc
Pf_vsc
Scalc
Sf
Sf_hvdc
St
St_hvdc
St_vsc
V
bad_data_detected
converged
elapsed
is_observable
iterations
loading
loading_hvdc
loading_vsc
losses
losses_hvdc
losses_vsc
method
norm_f
tap_angle
tap_module
class VeraGridEngine.Simulations.StateEstimation.state_estimation_results.StateEstimationResults(n: int, m: int, n_hvdc: int, n_vsc: int, n_gen: int, n_batt: int, n_sh: int, bus_names: ndarray, branch_names: ndarray, hvdc_names: ndarray, vsc_names: ndarray, gen_names: ndarray, batt_names: ndarray, sh_names: ndarray, bus_types: ndarray, clustering_results=None)[source]

Bases: ResultsTemplate

CLASS_DATA_VARIABLES = {'F': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pf_hvdc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pf_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pt_hvdc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sbus': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'T': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Vbranch': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'area_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bad_data_detected': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'batt_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_q': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'branch_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_area_indices': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_types': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_q': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_F': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_T': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_hvdc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses_hvdc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sh_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_q': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_angle': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_module': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'vsc_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>}
CLASS_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
If: CxVec
If_vsc
It: CxVec
It_vsc
LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
Pf_hvdc: Vec
Pf_vsc
Pt_hvdc: Vec
Sbus: CxVec
Sf: CxVec
St: CxVec
St_vsc
Vbranch: CxVec
apply_from_island(results: NumericStateEstimationResults, b_idx: ndarray, br_idx: ndarray, hvdc_idx: ndarray, vsc_idx: ndarray) None[source]

Apply results from another island circuit to the circuit results represented here. :param results: NumericPowerFlowResults from an island circuit :param b_idx: bus original indices :param br_idx: branch original indices :param hvdc_idx: hvdc original indices :param vsc_idx: vsc original indices :return: None

bad_data_detected
batt_names
battery_q: Vec
branch_names: StrVec
bus_names: StrVec
bus_types: IntVec
compare(other: StateEstimationResults, tol=1e-06) Tuple[bool, Logger][source]

Compare this results with another :param other: PowerFlowResults :param tol: absolute comparison tolerance :return: all ok?, Logger

property converged

Check if converged in all modes :return: True / False

convergence_reports: List[ConvergenceReport]
property elapsed

Check if converged in all modes :return: True / False

property error

Check if converged in all modes :return: True / False

export_all()[source]

Exports all the results to DataFrames.

Returns:

Bus results, Branch results

gen_names
gen_q: Vec
get_branch_df() DataFrame[source]

Get a DataFrame with the branches results :return: DataFrame, Pf in MW, Qf in MVAr, Pt in MW, Qt in MVAr, loading in %, Ploss in MW, Qloss in MVAr

get_bus_df() DataFrame[source]

Get a DataFrame with the buses results :return: DataFrame, Vm in p.u., Va in deg, P in MW, Q in MVAr

get_overload_score(branch_prices: ndarray[tuple[Any, ...], dtype[float64]])[source]

Compute the cost of overload :param branch_prices: array of branch prices :return:

get_report_dataframe(island_idx=0)[source]

Get a DataFrame containing the convergence report.

Arguments:

island_idx: (optional) island index

Returns:

DataFrame

hvdc_names: StrVec
property iterations

Check if converged in all modes :return: True / False

loading: CxVec
loading_hvdc: Vec
loading_vsc
losses: CxVec
losses_hvdc: Vec
losses_vsc
mdl(result_type: ResultTypes) ResultsTable[source]

get the ResultsTable model :param result_type: ResultTypes :return: ResultsTable instance

plot_bars_limit: int
sh_names
shunt_q: Vec
tap_angle: Vec
tap_module: Vec
voltage: CxVec
vsc_names: StrVec

VeraGridEngine.Simulations.StateEstimation.state_stimation_driver module

class VeraGridEngine.Simulations.StateEstimation.state_stimation_driver.StateEstimationConvergenceReport[source]

Bases: ConvergenceReport

add_bus_contribution(bus_contribution)[source]
Parameters:

bus_contribution

Returns:

add_measurement_profile(meas_profile)[source]
Parameters:

meas_profile

Returns:

add_pseudo_measurements(se_input)[source]
Parameters:

se_input

Returns:

add_se(method, converged: bool, error: float, elapsed: float, iterations: int, bad_data_detected: bool, is_observable: bool, bus_contribution: list, pseudo_measurements: list, unobservable_buses: list, measurement_profile: dict)[source]
Parameters:
  • method

  • converged

  • error

  • elapsed

  • iterations

  • bad_data_detected

  • is_observable

  • bus_contribution

  • pseudo_measurements

  • unobservable_buses

  • measurement_profile

Returns:

add_unobservable_buses(unobservable_buses)[source]
Parameters:

unobservable_buses

Returns:

bad_data_detected
bus_contribution
get_bad_data_detected() bool[source]

Get bad data detection results :return: List of bad data detection results

get_bus_contribution() list[source]
Returns:

get_measurement_profile() list[source]
Returns:

get_pseudo_measurements() list[source]
Returns:

get_unobservable_buses() list[source]
Returns:

property is_observable: bool

Get info is the island was observable :return: List of is_obsevable booleans

measurement_profile
pseudo_measurements
unobservable_buses
class VeraGridEngine.Simulations.StateEstimation.state_stimation_driver.StateEstimationDriver(circuit: MultiCircuit, options: StateEstimationOptions | None = None)[source]

Bases: DriverTemplate

static collect_measurements(circuit: MultiCircuit) StateEstimationInput[source]

Form the input from the circuit measurements :return: nothing, the input object is stored in this class

name = 'State estimation'
options
run()[source]

Run state estimation :return:

tpe = 'State estimation'
class VeraGridEngine.Simulations.StateEstimation.state_stimation_driver.StateEstimationOptions[source]

Bases: object

add_pseudo_measurements
c_threshold
fixed_slack
include_line_measurements_on_both_ends
max_iter
observability_analysis
prefer_correct
pseudo_meas_std
run_meas_profiling
solver
tol
verbose

Module contents