VeraGridEngine.Simulations.PowerFlow package

Subpackages

Submodules

VeraGridEngine.Simulations.PowerFlow.grid_analysis module

class VeraGridEngine.Simulations.PowerFlow.grid_analysis.TimeSeriesResultsAnalysis[source]

Bases: object

VeraGridEngine.Simulations.PowerFlow.power_flow_driver module

class VeraGridEngine.Simulations.PowerFlow.power_flow_driver.PowerFlowDriver(grid: MultiCircuit, options: PowerFlowOptions | None = None, opf_results: OptimalPowerFlowResults | None = None, t_idx: int | None = None, engine: EngineType = VeraGrid)[source]

Bases: DriverTemplate

add_report() None[source]

Add a report of the results (in-place)

convergence_reports
get_steps() List[str][source]
Returns:

name = 'Power Flow'
opf_results: OptimalPowerFlowResults | None
options: PowerFlowOptions
run() None[source]

Pack run_pf for the QThread

t_idx: int | None
tpe = 'Power flow'

Power flow wrapper to use with Qt

VeraGridEngine.Simulations.PowerFlow.power_flow_driver_3ph module

class VeraGridEngine.Simulations.PowerFlow.power_flow_driver_3ph.PowerFlowDriver3Ph(grid: MultiCircuit, options: PowerFlowOptions | None = None, opf_results: OptimalPowerFlowResults | None = None, engine: EngineType = VeraGrid)[source]

Bases: DriverTemplate

add_report() None[source]

Add a report of the results (in-place)

done_signal
elapsed
engine
get_steps() List[str][source]
Returns:

grid
logger
name = 'Power Flow 3ph'
progress_signal
progress_text
results: PowerFlowResults3Ph
run() None[source]

Pack run_pf for the QThread

tpe = 'Power flow 3ph'

Power flow wrapper

VeraGridEngine.Simulations.PowerFlow.power_flow_options module

class VeraGridEngine.Simulations.PowerFlow.power_flow_options.PowerFlowOptions[source]

Bases: OptionsTemplate

Power flow options

CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'diff_changes')
CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}
CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:solver_type, prop:retry_with_other_methods, prop:tolerance, prop:max_iter, prop:limit_i_vsc, prop:control_Q, prop:verbose, prop:initialize_with_existing_solution, prop:control_taps_modules, prop:control_taps_phase, prop:control_remote_voltage, prop:orthogonalize_controls, prop:apply_temperature_correction, prop:branch_impedance_tolerance_mode, prop:distributed_slack, prop:ignore_single_node_islands, prop:trust_radius, prop:backtracking_parameter, prop:use_stored_guess, prop:initialize_angles, prop:generate_report)
CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:solver_type, prop:retry_with_other_methods, prop:tolerance, prop:max_iter, prop:limit_i_vsc, prop:control_Q, prop:verbose, prop:initialize_with_existing_solution, prop:control_taps_modules, prop:control_taps_phase, prop:control_remote_voltage, prop:orthogonalize_controls, prop:apply_temperature_correction, prop:branch_impedance_tolerance_mode, prop:distributed_slack, prop:ignore_single_node_islands, prop:trust_radius, prop:backtracking_parameter, prop:use_stored_guess, prop:initialize_angles, prop:generate_report)
CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'action': prop:action, 'apply_temperature_correction': prop:apply_temperature_correction, 'backtracking_parameter': prop:backtracking_parameter, 'branch_impedance_tolerance_mode': prop:branch_impedance_tolerance_mode, 'code': prop:code, 'comment': prop:comment, 'control_Q': prop:control_Q, 'control_remote_voltage': prop:control_remote_voltage, 'control_taps_modules': prop:control_taps_modules, 'control_taps_phase': prop:control_taps_phase, 'diff_changes': prop:diff_changes, 'distributed_slack': prop:distributed_slack, 'generate_report': prop:generate_report, 'idtag': prop:idtag, 'ignore_single_node_islands': prop:ignore_single_node_islands, 'initialize_angles': prop:initialize_angles, 'initialize_with_existing_solution': prop:initialize_with_existing_solution, 'limit_i_vsc': prop:limit_i_vsc, 'max_iter': prop:max_iter, 'name': prop:name, 'orthogonalize_controls': prop:orthogonalize_controls, 'rdfid': prop:rdfid, 'retry_with_other_methods': prop:retry_with_other_methods, 'solver_type': prop:solver_type, 'tolerance': prop:tolerance, 'trust_radius': prop:trust_radius, 'use_stored_guess': prop:use_stored_guess, 'verbose': prop:verbose}
LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:solver_type, prop:retry_with_other_methods, prop:tolerance, prop:max_iter, prop:limit_i_vsc, prop:control_Q, prop:verbose, prop:initialize_with_existing_solution, prop:control_taps_modules, prop:control_taps_phase, prop:control_remote_voltage, prop:orthogonalize_controls, prop:apply_temperature_correction, prop:branch_impedance_tolerance_mode, prop:distributed_slack, prop:ignore_single_node_islands, prop:trust_radius, prop:backtracking_parameter, prop:use_stored_guess, prop:initialize_angles, prop:generate_report)
action: ActionType
comment: str
device_type: DeviceType
diff_changes
selected_to_merge

VeraGridEngine.Simulations.PowerFlow.power_flow_results module

class VeraGridEngine.Simulations.PowerFlow.power_flow_results.NumericPowerFlowResults(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]], Pfp_vsc: ndarray[tuple[Any, ...], dtype[float64]], Pfn_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)[source]

Bases: object

NumericPowerFlowResults, used to return values from the numerical methods

If
If_vsc
It
It_vsc
Pfn_vsc
Pfp_vsc
Scalc
Sf
Sf_hvdc
St
St_hvdc
St_vsc
V
converged
elapsed
iterations
loading
loading_hvdc
loading_vsc
losses
losses_hvdc
losses_vsc
method
norm_f
tap_angle
tap_module
class VeraGridEngine.Simulations.PowerFlow.power_flow_results.PowerFlowResults(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>, 'Pfn_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pfp_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>, 'batt_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_p': <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_p': <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>, <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>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
Pf_hvdc: Vec
Pfn_vsc
Pfp_vsc
Pt_hvdc: Vec
Sbus: CxVec
Sf: CxVec
St: CxVec
St_vsc
Vbranch: CxVec
apply_from_island(results: NumericPowerFlowResults, 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

apply_new_rates(nc: NumericalCircuit)[source]
Parameters:

nc

Returns:

batt_names
battery_p: Vec
battery_q: Vec
branch_names: StrVec
bus_names: StrVec
bus_types: IntVec
compare(other: PowerFlowResults, 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 reuslts

gen_names
gen_p: Vec
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_current_df()[source]
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

get_voltage_df()[source]
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.PowerFlow.power_flow_results_3ph module

class VeraGridEngine.Simulations.PowerFlow.power_flow_results_3ph.PowerFlowResults3Ph(n: int, m: int, n_hvdc: int, n_vsc: int, n_gen: int, n_batt: int, n_sh: int, n_load: int, bus_names: ndarray, branch_names: ndarray, hvdc_names: ndarray, vsc_names: ndarray, gen_names: ndarray, batt_names: ndarray, sh_names: ndarray, load_names: ndarray, bus_types: ndarray, clustering_results=None)[source]

Bases: ResultsTemplate

CLASS_DATA_VARIABLES = {'F': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_N': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'If_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_N': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_vsc_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_vsc_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'It_vsc_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pf_hvdc_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pf_hvdc_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pf_hvdc_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pfp_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pt_hvdc_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pt_hvdc_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pt_hvdc_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sbus_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sbus_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sbus_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sbus_N': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sf_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sf_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sf_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_vsc_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_vsc_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St_vsc_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'T': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Vbranch_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Vbranch_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Vbranch_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'area_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'batt_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_q_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_q_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_q_C': <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_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_q_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_q_C': <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>, 'load_Vn': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_hvdc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses_C': <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_Vn': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_q_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_q_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_q_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_angle': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_module': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage_A': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage_B': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage_C': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage_N': <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>, <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>)
F: IntVec | None
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>, <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>)
T: IntVec | None
apply_from_island(results: NumericPowerFlowResults, 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

area_names: StrVec | None
available_results: Dict[ResultTypes, List[ResultTypes]]
bus_area_indices: IntVec | None
clustering_results
compare(other: PowerFlowResults3Ph, 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

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

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_current_3ph_df() DataFrame[source]

Get a DataFrame with the current results in p.u. :return: DataFrame

get_current_unbalance_factor_df() DataFrame[source]

Get the Current Unbalance Factor (IUF) :return: DataFrame

get_load_neutral_voltage_df() DataFrame[source]

Get a DataFrame with the load neutral voltage results, Vm in p.u., Va in deg :return: DataFrame

get_report_dataframe(island_idx=0)[source]

Get a DataFrame containing the convergence report.

Arguments:

island_idx: (optional) island index

Returns:

DataFrame

get_shunt_neutral_voltage_df() DataFrame[source]

Get a DataFrame with the load neutral voltage results, Vm in p.u., Va in deg :return: DataFrame

get_voltage_3ph_df() DataFrame[source]

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

get_voltage_unbalance_factor_df() DataFrame[source]

Get the Voltage Unbalance Factor (VUF) :return: DataFrame

hvdc_F: IntVec | None
hvdc_T: IntVec | None
property iterations

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

mdl(result_type: ResultTypes) ResultsTable[source]

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

name: str
original_sample_idx: IntVec | None
report_text: str
sampled_probabilities: Vec | None
study_results_type: StudyResultsType
time_indices: IntVec | None
using_clusters
VeraGridEngine.Simulations.PowerFlow.power_flow_results_3ph.get_3p_indices(length_3p: int) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][source]

get the 3-phase indexing :param length_3p: 4N length :return: index N, index A, index B, index C

VeraGridEngine.Simulations.PowerFlow.power_flow_ts_driver module

class VeraGridEngine.Simulations.PowerFlow.power_flow_ts_driver.PowerFlowTimeSeriesDriver(grid: MultiCircuit, options: PowerFlowOptions | None = None, time_indices: ndarray[tuple[Any, ...], dtype[int64]] | None = None, opf_time_series_results=None, clustering_results: ClusteringResults | None = None, engine: EngineType = VeraGrid)[source]

Bases: TimeSeriesDriverTemplate

name = 'Power flow time series'
opf_time_series_results
options
run()[source]

Run the time series simulation @return:

run_bentayga()[source]
run_gslv(time_indices=None) PowerFlowTimeSeriesResults[source]

Run with GSLV :param time_indices: array of time indices :return:

run_newton_pa(time_indices=None) PowerFlowTimeSeriesResults[source]

Run with Newton Power Analytics :param time_indices: array of time indices :return:

run_single_thread(time_indices) PowerFlowTimeSeriesResults[source]

Run single thread time series :param time_indices: array of time indices to consider :return: TimeSeriesResults instance

tpe = 'Power flow time series'

VeraGridEngine.Simulations.PowerFlow.power_flow_ts_input module

class VeraGridEngine.Simulations.PowerFlow.power_flow_ts_input.PowerFlowTimeSeriesInput(s_profile: DataFrame = None, i_profile: DataFrame = None, y_profile: DataFrame = None)[source]

Bases: object

compile()[source]

Generate time-consistent arrays @return:

copy()[source]
get_at(t)[source]

Returns the necessary values @param t: time index @return:

get_from_buses(bus_idx)[source]

@param bus_idx: @return:

VeraGridEngine.Simulations.PowerFlow.power_flow_ts_results module

class VeraGridEngine.Simulations.PowerFlow.power_flow_ts_results.PowerFlowTimeSeriesResults(n: int, m: int, n_hvdc: int, n_vsc: int, bus_names: ndarray[tuple[Any, ...], dtype[str_]], branch_names: ndarray[tuple[Any, ...], dtype[str_]], hvdc_names: ndarray[tuple[Any, ...], dtype[str_]], vsc_names: ndarray[tuple[Any, ...], dtype[str_]], time_array: DatetimeIndex, bus_types: ndarray[tuple[Any, ...], dtype[int64]], n_gen: int, n_batt: int, n_sh: int, gen_names: ndarray[tuple[Any, ...], dtype[str_]], batt_names: ndarray[tuple[Any, ...], dtype[str_]], sh_names: ndarray[tuple[Any, ...], dtype[str_]], area_names: ndarray[tuple[Any, ...], dtype[str_]], clustering_results: ClusteringResults | None = 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_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Pfn_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'S': <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>, 'batt_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_p': <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>, 'converged_values': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'error_values': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_p': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'gen_q': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_F': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_Pf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_Pt': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_T': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_losses': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading_vsc': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses': <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>, 'time_array': <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>, <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: CxMat
If_vsc
It: CxMat
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>, <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_vsc
Pfn_vsc
S
Sf
St
St_vsc
Vbranch
apply_new_time_series_rates(nc: NumericalCircuit) None[source]

Recompute the loading with new rates

Parameters:

nc – NumericalCircuit instance.

batt_names: StrVec
battery_p
battery_q
branch_names: StrVec
bus_names: StrVec
bus_types: IntVec
converged_values
error_values
fill_circuit_info(grid: MultiCircuit) None[source]
Parameters:

grid

Returns:

gen_names: StrVec
gen_p
gen_q
get_branch_values_per_area(branch_values: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]]) ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]][source]
Parameters:

branch_values

Returns:

get_bus_values_per_area(bus_values: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]]) ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]][source]

Aggregate bus-related time-series values per area.

Parameters:

bus_values – Time-series bus values with shape (nt, nbus).

Returns:

Area-aggregated values with shape (nt, n_area).

get_hvdc_values_per_area(hvdc_values: ndarray)[source]
Parameters:

hvdc_values

Returns:

get_inter_area_flows()[source]
Returns:

get_ordered_area_names()[source]
Returns:

hvdc_Pf
hvdc_Pt
hvdc_loading
hvdc_losses
hvdc_names: StrVec
loading
loading_vsc
losses
losses_vsc
mdl(result_type: ResultTypes) ResultsTable[source]
Parameters:

result_type

Returns:

static merge_if(df, arr, ind, cols)[source]

@param df: @param arr: @param ind: @param cols: @return:

set_at(t: int, results: PowerFlowResults) None[source]

Store one snapshot power-flow solution into a time position.

Parameters:
  • t – Time index.

  • results – Snapshot power-flow results.

sh_names: StrVec
shunt_q
tap_angle: Mat
tap_module: Mat
to_json(fname)[source]

Export as json

voltage
vsc_names: StrVec

VeraGridEngine.Simulations.PowerFlow.power_flow_worker module

VeraGridEngine.Simulations.PowerFlow.power_flow_worker.multi_island_pf(multi_circuit: MultiCircuit, options: PowerFlowOptions, opf_results: VALID_OPF_RESULTS | None = None, t: Union[int, None] = None, logger: Logger = <VeraGridEngine.basic_structures.Logger object>, bus_dict: Union[Dict[Bus, int], None] = None, areas_dict: Union[Dict[Area, int], None] = None) PowerFlowResults[source]

Multiple islands power flow (this is the most generic power flow function) :param multi_circuit: MultiCircuit instance :param options: PowerFlowOptions instance :param opf_results: OPF results, to be used if not None :param t: time step, if None, the snapshot is compiled :param logger: list of events to add to :param bus_dict: Dus object to index dictionary :param areas_dict: Area to area index dictionary :return: PowerFlowResults instance

VeraGridEngine.Simulations.PowerFlow.power_flow_worker.multi_island_pf_nc(nc: NumericalCircuit, options: PowerFlowOptions, logger: Logger | None = None, V_guess: ndarray[tuple[Any, ...], dtype[complex128]] | None = None, Sbus_input: ndarray[tuple[Any, ...], dtype[complex128]] | None = None) PowerFlowResults[source]

Multiple islands power flow (this is the most generic power flow function) :param nc: SnapshotData instance :param options: PowerFlowOptions instance :param logger: logger :param V_guess: voltage guess :param Sbus_input: Use this power injections if provided (in p.u.) :return: PowerFlowResults instance

VeraGridEngine.Simulations.PowerFlow.power_flow_worker_3ph module

VeraGridEngine.Simulations.PowerFlow.power_flow_worker_3ph.multi_island_pf_3ph(multi_circuit: MultiCircuit, options: PowerFlowOptions, opf_results: VALID_OPF_RESULTS | None = None, t: Union[int, None] = None, logger: Logger = <VeraGridEngine.basic_structures.Logger object>, bus_dict: Union[Dict[Bus, int], None] = None, areas_dict: Union[Dict[Area, int], None] = None) PowerFlowResults3Ph[source]

Multiple islands power flow (this is the most generic power flow function) :param multi_circuit: MultiCircuit instance :param options: PowerFlowOptions instance :param opf_results: OPF results, to be used if not None :param t: time step, if None, the snapshot is compiled :param logger: list of events to add to :param bus_dict: Dus object to index dictionary :param areas_dict: Area to area index dictionary :return: PowerFlowResults instance

VeraGridEngine.Simulations.PowerFlow.power_flow_worker_3ph.multi_island_pf_nc_3ph(nc: NumericalCircuit, options: PowerFlowOptions, logger: Logger | None = None, V_guess: ndarray[tuple[Any, ...], dtype[complex128]] | None = None, Sbus_input: ndarray[tuple[Any, ...], dtype[complex128]] | None = None) PowerFlowResults3Ph[source]

Multiple islands power flow (this is the most generic power flow function) :param nc: SnapshotData instance :param options: PowerFlowOptions instance :param logger: logger :param V_guess: voltage guess :param Sbus_input: Use this power injections if provided (in p.u.) :return: PowerFlowResults instance

Module contents