VeraGridEngine.Simulations.OPF packageο
Subpackagesο
- VeraGridEngine.Simulations.OPF.Formulations package
- Submodules
- VeraGridEngine.Simulations.OPF.Formulations.ac_opf_problem module
NonLinearOptimalPfProblemNonLinearOptimalPfProblem.CdispgenNonLinearOptimalPfProblem.Cdispgen_shNonLinearOptimalPfProblem.Cdispgen_sh_tNonLinearOptimalPfProblem.Cdispgen_tNonLinearOptimalPfProblem.CfmonNonLinearOptimalPfProblem.Cfmon_tNonLinearOptimalPfProblem.CtmonNonLinearOptimalPfProblem.Ctmon_tNonLinearOptimalPfProblem.F_vscNonLinearOptimalPfProblem.InomNonLinearOptimalPfProblem.It_vscNonLinearOptimalPfProblem.NVNonLinearOptimalPfProblem.P_hvdc_maxNonLinearOptimalPfProblem.Pf_nondispNonLinearOptimalPfProblem.Pf_vscNonLinearOptimalPfProblem.PfdcNonLinearOptimalPfProblem.PgNonLinearOptimalPfProblem.Pg_maxNonLinearOptimalPfProblem.Pg_minNonLinearOptimalPfProblem.Pt_vscNonLinearOptimalPfProblem.QgNonLinearOptimalPfProblem.Qg_maxNonLinearOptimalPfProblem.Qg_minNonLinearOptimalPfProblem.Qsh_maxNonLinearOptimalPfProblem.Qsh_minNonLinearOptimalPfProblem.Qt_vscNonLinearOptimalPfProblem.RNonLinearOptimalPfProblem.SbaseNonLinearOptimalPfProblem.ScalcNonLinearOptimalPfProblem.SdNonLinearOptimalPfProblem.SfNonLinearOptimalPfProblem.Sf2NonLinearOptimalPfProblem.Sg_undisNonLinearOptimalPfProblem.StNonLinearOptimalPfProblem.St2NonLinearOptimalPfProblem.T_vscNonLinearOptimalPfProblem.VNonLinearOptimalPfProblem.VaNonLinearOptimalPfProblem.Va_maxNonLinearOptimalPfProblem.Va_minNonLinearOptimalPfProblem.VmNonLinearOptimalPfProblem.Vm_maxNonLinearOptimalPfProblem.Vm_minNonLinearOptimalPfProblem.XNonLinearOptimalPfProblem.Ybus_colsNonLinearOptimalPfProblem.Ybus_diag_posNonLinearOptimalPfProblem.Ybus_indicesNonLinearOptimalPfProblem.Ybus_indptrNonLinearOptimalPfProblem.ac_bus_idxNonLinearOptimalPfProblem.admittancesNonLinearOptimalPfProblem.allSfNonLinearOptimalPfProblem.allStNonLinearOptimalPfProblem.all_tap_mNonLinearOptimalPfProblem.all_tap_tauNonLinearOptimalPfProblem.analyze_branch_controls()NonLinearOptimalPfProblem.br_idxNonLinearOptimalPfProblem.br_mon_idxNonLinearOptimalPfProblem.c0NonLinearOptimalPfProblem.c0nNonLinearOptimalPfProblem.c1NonLinearOptimalPfProblem.c1nNonLinearOptimalPfProblem.c2NonLinearOptimalPfProblem.c2nNonLinearOptimalPfProblem.c_sNonLinearOptimalPfProblem.c_vNonLinearOptimalPfProblem.c_vscNonLinearOptimalPfProblem.capacity_nodes_idxNonLinearOptimalPfProblem.compute_branch_power_derivatives()NonLinearOptimalPfProblem.compute_branch_power_second_derivatives()NonLinearOptimalPfProblem.dc_bus_idxNonLinearOptimalPfProblem.f_disp_hvdcNonLinearOptimalPfProblem.f_nd_hvdcNonLinearOptimalPfProblem.from_idxNonLinearOptimalPfProblem.gen_bus_idxNonLinearOptimalPfProblem.gen_disp_idxNonLinearOptimalPfProblem.gen_disp_idx_shNonLinearOptimalPfProblem.gen_nondisp_idxNonLinearOptimalPfProblem.get_jacobians_and_hessians()NonLinearOptimalPfProblem.get_solution()NonLinearOptimalPfProblem.hvdc_disp_idxNonLinearOptimalPfProblem.hvdc_nondisp_idxNonLinearOptimalPfProblem.id_Vm_max0NonLinearOptimalPfProblem.id_Vm_min0NonLinearOptimalPfProblem.id_shNonLinearOptimalPfProblem.ind_gensNonLinearOptimalPfProblem.indicesNonLinearOptimalPfProblem.k_mNonLinearOptimalPfProblem.k_mtauNonLinearOptimalPfProblem.k_tauNonLinearOptimalPfProblem.loggerNonLinearOptimalPfProblem.n_br_monNonLinearOptimalPfProblem.n_dc_busNonLinearOptimalPfProblem.n_disp_hvdcNonLinearOptimalPfProblem.n_gen_dispNonLinearOptimalPfProblem.n_gen_disp_shNonLinearOptimalPfProblem.n_sl_vscNonLinearOptimalPfProblem.n_slackNonLinearOptimalPfProblem.n_vsc_limNonLinearOptimalPfProblem.n_vsc_varsNonLinearOptimalPfProblem.nbrNonLinearOptimalPfProblem.nbusNonLinearOptimalPfProblem.ncNonLinearOptimalPfProblem.neqNonLinearOptimalPfProblem.ngenNonLinearOptimalPfProblem.nineqNonLinearOptimalPfProblem.nodal_capacity_signNonLinearOptimalPfProblem.npqNonLinearOptimalPfProblem.npvNonLinearOptimalPfProblem.nshNonLinearOptimalPfProblem.nslNonLinearOptimalPfProblem.nslcapNonLinearOptimalPfProblem.ntapmNonLinearOptimalPfProblem.ntaptNonLinearOptimalPfProblem.nvscNonLinearOptimalPfProblem.optimize_nodal_capacityNonLinearOptimalPfProblem.optionsNonLinearOptimalPfProblem.pfNonLinearOptimalPfProblem.pqNonLinearOptimalPfProblem.pvNonLinearOptimalPfProblem.ratesNonLinearOptimalPfProblem.rates2NonLinearOptimalPfProblem.resultsNonLinearOptimalPfProblem.sh_bus_idxNonLinearOptimalPfProblem.sl_sfNonLinearOptimalPfProblem.sl_stNonLinearOptimalPfProblem.sl_vmaxNonLinearOptimalPfProblem.sl_vminNonLinearOptimalPfProblem.sl_vscNonLinearOptimalPfProblem.slackNonLinearOptimalPfProblem.slackgensNonLinearOptimalPfProblem.slcapNonLinearOptimalPfProblem.slcap0NonLinearOptimalPfProblem.t_disp_hvdcNonLinearOptimalPfProblem.t_nd_hvdcNonLinearOptimalPfProblem.tanmaxNonLinearOptimalPfProblem.tap_mNonLinearOptimalPfProblem.tap_tauNonLinearOptimalPfProblem.tapm_maxNonLinearOptimalPfProblem.tapm_minNonLinearOptimalPfProblem.tapt_maxNonLinearOptimalPfProblem.tapt_minNonLinearOptimalPfProblem.to_idxNonLinearOptimalPfProblem.update()NonLinearOptimalPfProblem.var2x()NonLinearOptimalPfProblem.vsc_alpha1NonLinearOptimalPfProblem.vsc_alpha2NonLinearOptimalPfProblem.vsc_alpha3NonLinearOptimalPfProblem.vsc_idxNonLinearOptimalPfProblem.vsc_lim_idxNonLinearOptimalPfProblem.vsc_rate_puNonLinearOptimalPfProblem.x0NonLinearOptimalPfProblem.x2var()
NonlinearOPFResultsNonlinearOPFResults.PcostNonlinearOPFResults.PgNonlinearOPFResults.QgNonlinearOPFResults.QshNonlinearOPFResults.SNonlinearOPFResults.SfNonlinearOPFResults.StNonlinearOPFResults.VNonlinearOPFResults.VaNonlinearOPFResults.VmNonlinearOPFResults.convergedNonlinearOPFResults.errorNonlinearOPFResults.hvdc_PfNonlinearOPFResults.hvdc_loadingNonlinearOPFResults.initialize()NonlinearOPFResults.iterationsNonlinearOPFResults.lam_pNonlinearOPFResults.lam_qNonlinearOPFResults.loadingNonlinearOPFResults.merge()NonlinearOPFResults.nodal_capacityNonlinearOPFResults.sl_sfNonlinearOPFResults.sl_stNonlinearOPFResults.sl_vmaxNonlinearOPFResults.sl_vminNonlinearOPFResults.tap_moduleNonlinearOPFResults.tap_phaseNonlinearOPFResults.voltageNonlinearOPFResults.vsc_ItNonlinearOPFResults.vsc_PfNonlinearOPFResults.vsc_PtNonlinearOPFResults.vsc_QtNonlinearOPFResults.vsc_loading
- VeraGridEngine.Simulations.OPF.Formulations.linear_opf_ts module
BatteryVarsBranchVarsBusVarsFluidInjectionVarsFluidNodeVarsFluidPathVarsGenerationVarsHvdcVarsLoadVarsNodalCapacityVarsOpfVarsSystemVarsVscVarsadd_copper_plate_balance()add_hydro_formulation()add_linear_battery_formulation()add_linear_branches_contingencies_formulation()add_linear_branches_formulation()add_linear_generation_expansion_planning_formulation()add_linear_generation_redispatch_formulation()add_linear_generation_unit_commitment_formulation()add_linear_hvdc_formulation()add_linear_load_formulation()add_linear_nodal_capacity_generation_formulation()add_linear_node_balance()add_linear_simple_generation_formulation()add_linear_vsc_formulation()add_nodal_capacity_formulation()get_contingency_flow_with_filter()pmode3_formulation_impr()run_linear_opf_ts()
- VeraGridEngine.Simulations.OPF.Formulations.linear_opf_ts_b module
BatteryVarsBranchVarsBusVarsFluidInjectionVarsFluidNodeVarsFluidPathVarsGenerationVarsHvdcVarsLoadVarsNodalCapacityVarsOpfVarsSystemVarsVscVarsadd_copper_plate_balance()add_hydro_formulation()add_linear_battery_formulation()add_linear_branches_contingencies_formulation()add_linear_branches_formulation()add_linear_generation_formulation()add_linear_hvdc_formulation()add_linear_load_formulation()add_linear_node_balance()add_linear_vsc_formulation()add_nodal_capacity_formulation()get_contingency_flow_with_filter()run_linear_opf_ts()
- Module contents
- VeraGridEngine.Simulations.OPF.NumericalMethods package
- Submodules
- VeraGridEngine.Simulations.OPF.NumericalMethods.ac_opf_derivatives module
- VeraGridEngine.Simulations.OPF.NumericalMethods.newton_raphson_ips_fx module
IpsFunctionReturnIpsFunctionReturn.GIpsFunctionReturn.GxIpsFunctionReturn.GxxIpsFunctionReturn.HIpsFunctionReturn.HxIpsFunctionReturn.HxxIpsFunctionReturn.SIpsFunctionReturn.SfIpsFunctionReturn.StIpsFunctionReturn.compare()IpsFunctionReturn.fIpsFunctionReturn.fxIpsFunctionReturn.fxxIpsFunctionReturn.get_data()IpsFunctionReturn.get_headers()
IpsSolutioncalc_c_cond()calc_error()calc_feas_cond()calc_grad_cond()calc_o_cond()interior_point_solver()max_abs()split()step_calculation()
- Module contents
Submodulesο
VeraGridEngine.Simulations.OPF.ac_opf_worker moduleο
- VeraGridEngine.Simulations.OPF.ac_opf_worker.remap_original_bus_indices(n_bus, original_bus_idx: Sequence[int]) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][source]ο
Get arrays of bus mappings :param n_bus: number of buses :param original_bus_idx: array of bus indices in the multi-island scheme :return: original_indices: array of bus indices in the multi-island that apply for this island,
island_indices: array of island indices that apply for this island
- VeraGridEngine.Simulations.OPF.ac_opf_worker.run_nonlinear_opf(grid: ~VeraGridEngine.Devices.multi_circuit.MultiCircuit, opf_options: ~VeraGridEngine.Simulations.OPF.opf_options.OptimalPowerFlowOptions, t_idx: None | int = None, plot_error: bool = False, optimize_nodal_capacity: bool = False, nodal_capacity_sign: float = 1.0, capacity_nodes_idx: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.int64]] | None = None, logger: ~VeraGridEngine.basic_structures.Logger = <VeraGridEngine.basic_structures.Logger object>) NonlinearOPFResults[source]ο
Run optimal power flow for a MultiCircuit :param grid: MultiCircuit :param opf_options: OptimalPowerFlowOptions :param t_idx: Time index :param plot_error: Plot the error evolution :param optimize_nodal_capacity: :param nodal_capacity_sign: :param capacity_nodes_idx: :param logger: Logger object :return: NonlinearOPFResults
VeraGridEngine.Simulations.OPF.opf_driver moduleο
- class VeraGridEngine.Simulations.OPF.opf_driver.OptimalPowerFlowDriver(grid: MultiCircuit, options: OptimalPowerFlowOptions | None = None, engine: EngineType = VeraGrid)[source]ο
Bases:
TimeSeriesDriverTemplate- all_solvedο
- name = 'Optimal power flow'ο
- opf(remote=False, batteries_energy_0=None) OptimalPowerFlowResults[source]ο
Run a power flow for every circuit :param remote: is this function being called from the time series? :param batteries_energy_0: initial state of the batteries, if None the default values are taken :return: OptimalPowerFlowResults object
- optionsο
- property pf_options: PowerFlowOptionsο
Get the PowerFlow options provides with the OpfOptions :return: PowerFlowOptions
- tpe = 'Optimal power flow'ο
VeraGridEngine.Simulations.OPF.opf_options moduleο
- class VeraGridEngine.Simulations.OPF.opf_options.OptimalPowerFlowOptions[source]ο
Bases:
OptionsTemplate- CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'selected_to_merge', '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:selected_to_merge, prop:comment, prop:diff_changes, prop:verbose, prop:solver, prop:time_grouping, prop:zonal_grouping, prop:mip_solver, prop:dispatch_mode, prop:power_flow_options, prop:skip_generation_limits, prop:consider_contingencies, prop:contingency_groups_used, prop:lodf_tolerance, prop:add_losses_approximation, prop:use_glsk_as_cost, prop:inter_aggregation_info, prop:consider_ramps, prop:consider_time_up_down, prop:area_spinning_reserve, prop:report_formulation, prop:generate_report, prop:acopf_mode, prop:ips_method, prop:ips_tolerance, prop:ips_iterations, prop:ips_trust_radius, prop:ips_init_with_pf, prop:ips_control_q_limits, prop:robust, prop:acopf_v0, prop:acopf_S0)ο
- CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:verbose, prop:solver, prop:time_grouping, prop:zonal_grouping, prop:mip_solver, prop:dispatch_mode, prop:power_flow_options, prop:skip_generation_limits, prop:consider_contingencies, prop:contingency_groups_used, prop:lodf_tolerance, prop:add_losses_approximation, prop:use_glsk_as_cost, prop:inter_aggregation_info, prop:consider_ramps, prop:consider_time_up_down, prop:area_spinning_reserve, prop:report_formulation, prop:generate_report, prop:acopf_mode, prop:ips_method, prop:ips_tolerance, prop:ips_iterations, prop:ips_trust_radius, prop:ips_init_with_pf, prop:ips_control_q_limits, prop:robust, prop:acopf_v0, prop:acopf_S0)ο
- CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'acopf_S0': prop:acopf_S0, 'acopf_mode': prop:acopf_mode, 'acopf_v0': prop:acopf_v0, 'action': prop:action, 'add_losses_approximation': prop:add_losses_approximation, 'area_spinning_reserve': prop:area_spinning_reserve, 'code': prop:code, 'comment': prop:comment, 'consider_contingencies': prop:consider_contingencies, 'consider_ramps': prop:consider_ramps, 'consider_time_up_down': prop:consider_time_up_down, 'contingency_groups_used': prop:contingency_groups_used, 'diff_changes': prop:diff_changes, 'dispatch_mode': prop:dispatch_mode, 'generate_report': prop:generate_report, 'idtag': prop:idtag, 'inter_aggregation_info': prop:inter_aggregation_info, 'ips_control_q_limits': prop:ips_control_q_limits, 'ips_init_with_pf': prop:ips_init_with_pf, 'ips_iterations': prop:ips_iterations, 'ips_method': prop:ips_method, 'ips_tolerance': prop:ips_tolerance, 'ips_trust_radius': prop:ips_trust_radius, 'lodf_tolerance': prop:lodf_tolerance, 'mip_solver': prop:mip_solver, 'name': prop:name, 'power_flow_options': prop:power_flow_options, 'rdfid': prop:rdfid, 'report_formulation': prop:report_formulation, 'robust': prop:robust, 'selected_to_merge': prop:selected_to_merge, 'skip_generation_limits': prop:skip_generation_limits, 'solver': prop:solver, 'time_grouping': prop:time_grouping, 'use_glsk_as_cost': prop:use_glsk_as_cost, 'verbose': prop:verbose, 'zonal_grouping': prop:zonal_grouping}ο
- LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:verbose, prop:solver, prop:time_grouping, prop:zonal_grouping, prop:mip_solver, prop:dispatch_mode, prop:power_flow_options, prop:skip_generation_limits, prop:consider_contingencies, prop:contingency_groups_used, prop:lodf_tolerance, prop:add_losses_approximation, prop:use_glsk_as_cost, prop:inter_aggregation_info, prop:consider_ramps, prop:consider_time_up_down, prop:area_spinning_reserve, prop:report_formulation, prop:generate_report, prop:acopf_mode, prop:ips_method, prop:ips_tolerance, prop:ips_iterations, prop:ips_trust_radius, prop:ips_init_with_pf, prop:ips_control_q_limits, prop:robust, prop:acopf_v0, prop:acopf_S0)ο
- action: ActionTypeο
- comment: strο
- device_type: DeviceTypeο
- diff_changesο
- selected_to_mergeο
VeraGridEngine.Simulations.OPF.opf_results moduleο
- class VeraGridEngine.Simulations.OPF.opf_results.OptimalPowerFlowResults(bus_names: ndarray[tuple[Any, ...], dtype[str_]], branch_names: ndarray[tuple[Any, ...], dtype[str_]], load_names: ndarray[tuple[Any, ...], dtype[str_]], generator_names: ndarray[tuple[Any, ...], dtype[str_]], shunt_like_names: ndarray[tuple[Any, ...], dtype[str_]], battery_names: ndarray[tuple[Any, ...], dtype[str_]], hvdc_names: ndarray[tuple[Any, ...], dtype[str_]], vsc_names: ndarray[tuple[Any, ...], dtype[str_]], bus_types: ndarray[tuple[Any, ...], dtype[int64]], area_names: ndarray[tuple[Any, ...], dtype[str_]], fluid_node_names: ndarray[tuple[Any, ...], dtype[str_]], fluid_path_names: ndarray[tuple[Any, ...], dtype[str_]], fluid_inj_names: ndarray[tuple[Any, ...], dtype[str_]], F: ndarray[tuple[Any, ...], dtype[int64]], T: ndarray[tuple[Any, ...], dtype[int64]], F_hvdc: ndarray[tuple[Any, ...], dtype[int64]], T_hvdc: ndarray[tuple[Any, ...], dtype[int64]], bus_area_indices: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Bases:
ResultsTemplate- CLASS_DATA_VARIABLES = {'F': <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>, 'T': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'area_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_power': <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_shadow_prices': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_types': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_flows_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_flows_slacks_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_indices_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_rates': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'converged': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'error': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_inj_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_injection_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_current_level': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_flow_in': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_flow_out': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_p2x_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_spillage': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_path_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_path_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_reactive_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_shedding': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_F': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_Pf': <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>, 'load_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_shedding': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_shedding_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'non_linear': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'overloads': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'overloads_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'rates': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_like_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_like_reactive_power': <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_Pf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'vsc_loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'vsc_losses': <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>)ο
- 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>)ο
- Sbusο
- Sfο
- Stο
- battery_namesο
- battery_powerο
- branch_namesο
- bus_namesο
- bus_shadow_pricesο
- bus_typesο
- contingency_flows_listο
- contingency_flows_slacks_listο
- contingency_indices_listο
- contingency_ratesο
- convergedο
- errorο
- fluid_inj_namesο
- fluid_injection_flowο
- fluid_node_current_levelο
- fluid_node_flow_inο
- fluid_node_flow_outο
- fluid_node_namesο
- fluid_node_p2x_flowο
- fluid_node_spillageο
- fluid_path_flowο
- fluid_path_namesο
- generator_namesο
- generator_powerο
- generator_reactive_powerο
- generator_sheddingο
- hvdc_Pfο
- hvdc_loadingο
- hvdc_lossesο
- hvdc_namesο
- load_namesο
- load_powerο
- load_sheddingο
- load_shedding_costο
- loadingο
- lossesο
- mdl(result_type) ResultsTable[source]ο
Plot the results :param result_type: type of results (string) :return: DataFrame of the results (or None if the result was not understood)
- non_linearο
- overloadsο
- overloads_costο
- property phase_shift: ndarray[tuple[Any, ...], dtype[float64]]ο
Cover for old API :return: tap angles in rad
- plot_bars_limitο
- ratesο
- shunt_like_namesο
- shunt_like_reactive_powerο
- tap_angleο
- tap_moduleο
- voltageο
- vsc_Pfο
- vsc_loadingο
- vsc_lossesο
- vsc_namesο
VeraGridEngine.Simulations.OPF.opf_ts_driver moduleο
- class VeraGridEngine.Simulations.OPF.opf_ts_driver.OptimalPowerFlowTimeSeriesDriver(grid: MultiCircuit, options: OptimalPowerFlowOptions | None = None, time_indices: ndarray[tuple[Any, ...], dtype[int64]] | None = None, clustering_results: ClusteringResults | None = None, engine: EngineType = VeraGrid)[source]ο
Bases:
TimeSeriesDriverTemplate- all_solvedο
- name = 'Optimal power flow time series'ο
- opf(remote=False, batteries_energy_0=None)[source]ο
Run a power flow for every circuit :param remote: is this function being called from the time series? :param batteries_energy_0: initial state of the batteries, if None the default values are taken :return: OptimalPowerFlowResults object
- optionsο
- property pf_options: PowerFlowOptionsο
Get the PowerFlow options provides with the OpfOptions :return: PowerFlowOptions
- run_greedy_dispatch_indices(time_indices: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
- Parameters:
time_indices
- Returns:
- run_linear_opf_indices(time_indices: ndarray[tuple[Any, ...], dtype[int64]], energy_0: ndarray[tuple[Any, ...], dtype[float64]], fluid_level_0: ndarray[tuple[Any, ...], dtype[float64]])[source]ο
- run_nonlinear_opf_indices(time_indices: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
- Parameters:
time_indices
- Returns:
- tpe = 'Optimal power flow time series'ο
VeraGridEngine.Simulations.OPF.opf_ts_results moduleο
- class VeraGridEngine.Simulations.OPF.opf_ts_results.OptimalPowerFlowTimeSeriesResults(bus_names: StrVec, branch_names: StrVec, load_names: StrVec, generator_names: StrVec, battery_names: StrVec, shunt_like_names: StrVec, hvdc_names: StrVec, vsc_names: StrVec, fuel_names: StrVec, emission_names: StrVec, technology_names: StrVec, fluid_node_names: StrVec, fluid_path_names: StrVec, fluid_injection_names: StrVec, nt: int, time_array=None, bus_types=(), clustering_results: None | ClusteringResults = None)[source]ο
Bases:
ResultsTemplateOptimal power flow time series results
- CLASS_DATA_VARIABLES = {'Sbus': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'Sf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'St': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_energy': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_invested': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'battery_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'branch_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_shadow_prices': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'bus_types': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_flows_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_flows_slacks_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_indices_list': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'contingency_rates': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'converged': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'emission_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_injection_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_injection_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_current_level': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_flow_in': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_flow_out': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_p2x_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_node_spillage': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_path_flow': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fluid_path_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'fuel_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_invested': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_producing': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_reactive_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_shedding': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_shutting_down': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'generator_starting_up': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_Pf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'hvdc_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_shedding': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'load_shedding_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'loading': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'losses': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'overloads': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'overloads_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'power_by_technology': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'rates': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_like_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'shunt_like_reactive_power': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'system_emissions': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'system_energy_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'system_fuel': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'system_total_energy_cost': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_angle': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'tap_module': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'technology_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'voltage': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'vsc_Pf': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'vsc_loading': <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>)ο
- 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>)ο
- Sbusο
- Sfο
- Stο
- apply_new_time_series_rates(nc: NumericalCircuit)[source]ο
- Parameters:
nc
- battery_energyο
- battery_investedο
- battery_namesο
- battery_powerο
- branch_namesο
- bus_namesο
- bus_shadow_pricesο
- bus_typesο
- contingency_flows_listο
- contingency_flows_slacks_listο
- contingency_indices_listο
- contingency_ratesο
- convergedο
- emission_namesο
- fluid_injection_flowο
- fluid_injection_namesο
- fluid_node_current_levelο
- fluid_node_flow_inο
- fluid_node_flow_outο
- fluid_node_namesο
- fluid_node_p2x_flowο
- fluid_node_spillageο
- fluid_path_flowο
- fluid_path_namesο
- fuel_namesο
- generator_costο
- generator_investedο
- generator_namesο
- generator_powerο
- generator_producingο
- generator_reactive_powerο
- generator_sheddingο
- generator_shutting_downο
- generator_starting_upο
- hvdc_Pfο
- hvdc_loadingο
- hvdc_namesο
- load_namesο
- load_powerο
- load_sheddingο
- load_shedding_costο
- loadingο
- lossesο
- mdl(result_type) ResultsTable[source]ο
Plot the results :param result_type: :return:
- overloadsο
- overloads_costο
- property phase_shift: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]]ο
Cover for old API :return: tap angles in rad
- power_by_technologyο
- ratesο
- set_at(t, res: OptimalPowerFlowResults)[source]ο
Set the results :param t: time index :param res: OptimalPowerFlowResults instance
- shunt_like_namesο
- shunt_like_reactive_powerο
- system_emissionsο
- system_energy_costο
- system_fuelο
- system_total_energy_costο
- tap_angleο
- tap_moduleο
- technology_namesο
- voltageο
- vsc_Pfο
- vsc_loadingο
- vsc_namesο
VeraGridEngine.Simulations.OPF.simple_dispatch_ts moduleο
This file implements a DC-OPF for time series That means that solves the OPF problem for a complete time series at once
- class VeraGridEngine.Simulations.OPF.simple_dispatch_ts.GreedyDispatchInputs(grid: ~VeraGridEngine.Devices.multi_circuit.MultiCircuit, time_indices: ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy.int64]] | None = None, logger: ~VeraGridEngine.basic_structures.Logger = <VeraGridEngine.basic_structures.Logger object>)[source]ο
Bases:
object
- class VeraGridEngine.Simulations.OPF.simple_dispatch_ts.GreedyDispatchInputsSnapshot(grid: MultiCircuit, logger: Logger = <VeraGridEngine.basic_structures.Logger object>)[source]ο
Bases:
object
- VeraGridEngine.Simulations.OPF.simple_dispatch_ts.greedy_dispatch(load_profile: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_profile: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_p_max: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_p_min: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_dispatchable: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_active: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_cost: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_active: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_p_max_charge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_p_max_discharge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_energy_max: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_eff_charge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_eff_discharge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_cost: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_soc0: ndarray[tuple[Any, ...], dtype[float64]], batt_soc_min: ndarray[tuple[Any, ...], dtype[float64]], dt: ndarray[tuple[Any, ...], dtype[float64]], force_charge_if_low: bool, tol=1e-06)[source]ο
Greedy dispatch algorithm with dispatchable and non-dispatchable (e.g., renewable) generators. :param load_profile: ndarray (T, L) - Load time series per timestep and load element. :param gen_profile: ndarray (T, G) - Precomputed generator output (for renewables or constraints). :param gen_p_max: ndarray (T, G) - array of generators maximum power :param gen_p_min: ndarray (T, G) - array of generators minimum power :param gen_dispatchable: ndarray (T, G) - Boolean flag per generator (True if dispatchable). :param gen_active: ndarray (T, G) - Boolean array indicating whether each generator is active. :param gen_cost: ndarray (T, G) - Generator cost profile per timestep. :param batt_active: ndarray (T, B) - Battery active states. :param batt_p_max_charge: ndarray (T, B) - Battery charge limits. :param batt_p_max_discharge: ndarray (T, B) - Battery discharge limits. :param batt_energy_max: ndarray (T, B) - Battery energy capacity. :param batt_eff_charge: ndarray (T, B) - Battery efficiencies. :param batt_eff_discharge: ndarray (T, B) - Battery efficiencies. :param batt_cost (T, B) - Battery costs of discharge :param batt_soc0: ndarray (B,) - Initial SOC. :param batt_soc_min: ndarray (B) - Battery minimum state of charge :param dt: float - Timestep duration [h]. :param force_charge_if_low: Force to charge if low? :param tol: Tolerance (numerical zero) :return:
dispatch_gen : ndarray (T, G) dispatch_batt : ndarray (T, B) soc : ndarray (T, B) total_cost : float
- VeraGridEngine.Simulations.OPF.simple_dispatch_ts.greedy_dispatch2(load_profile: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_profile: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_p_max: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_p_min: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_dispatchable: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_active: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], gen_cost: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_active: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_p_max_charge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_p_max_discharge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_energy_max: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_eff_charge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_eff_discharge: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_cost: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], batt_soc0: ndarray[tuple[Any, ...], dtype[float64]], batt_soc_min: ndarray[tuple[Any, ...], dtype[float64]], dt: ndarray[tuple[Any, ...], dtype[float64]], force_charge_if_low: bool, tol=1e-06)[source]ο
Greedy dispatch algorithm with dispatchable and non-dispatchable (e.g., renewable) generators.
(A) non-dispatchable gens β (B) battery discharge β (C) dispatchable gens β (D) charge batteries from NDG excess
(and, if force_charge_if_low=True, allow charging even with no excess for depleted batteries).
- Parameters:
load_profile β ndarray (T, L) - Load time series per timestep and load element.
gen_profile β ndarray (T, G) - Precomputed generator output (for renewables or constraints).
gen_p_max β ndarray (T, G) - array of generators maximum power
gen_p_min β ndarray (T, G) - array of generators minimum power
gen_dispatchable β ndarray (T, G) - Boolean flag per generator (True if dispatchable).
gen_active β ndarray (T, G) - Boolean array indicating whether each generator is active.
gen_cost β ndarray (T, G) - Generator cost profile per timestep.
batt_active β ndarray (T, B) - Battery active states.
batt_p_max_charge β ndarray (T, B) - Battery charge limits.
batt_p_max_discharge β ndarray (T, B) - Battery discharge limits.
batt_energy_max β ndarray (T, B) - Battery energy capacity.
batt_eff_charge β ndarray (T, B) - Battery efficiencies.
batt_eff_discharge β ndarray (T, B) - Battery efficiencies.
:param batt_cost (T, B) - Battery costs of discharge :param batt_soc0: ndarray (B,) - Initial SOC. :param batt_soc_min: ndarray (B) - Battery minimum state of charge :param dt: float - Timestep duration [h]. :param force_charge_if_low: Force to charge if low? :param tol: Tolerance (numerical zero) :return:
dispatch_gen : ndarray (T, G) dispatch_batt : ndarray (T, B) soc : ndarray (T, B) total_cost : float load_not_supplied: load_shedding: ndg_surplus_after_batt, ndg_curtailment_per_gen (T, G)
- VeraGridEngine.Simulations.OPF.simple_dispatch_ts.run_greedy_dispatch_ts(grid: MultiCircuit, time_indices: ndarray[tuple[Any, ...], dtype[int64]] | None, logger: Logger, text_prog=None, prog_func=None) Tuple[ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], GreedyDispatchInputs][source]ο
Run a simple (greedy) dispatch :param grid: MultiCircuit :param time_indices: array of time indices (optional) :param logger: Logger :param text_prog: text report function (optional) :param prog_func: progress report function (optional) :return:
- VeraGridEngine.Simulations.OPF.simple_dispatch_ts.run_simple_dispatch(grid: MultiCircuit, text_prog=None, prog_func=None) Tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]][source]ο
Simple generation dispatch for the snapshot :param grid: MultiCircuit instance :param text_prog: text report function :param prog_func: progress report function :return Pl, Pg