VeraGridEngine.Simulations.InvestmentsEvaluation.Problems package

Submodules

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.adequacy_problem module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.adequacy_problem.AdequacyInvestmentProblem(grid: MultiCircuit, n_monte_carlo_sim=10000, use_monte_carlo: bool = True, minimum_firm_share: float = 0.2, use_firm_capacity_penalty: bool = True, save_file: bool = True, time_indices: ndarray[tuple[Any, ...], dtype[int64]] | None = None)[source]

Bases: BlackBoxProblemTemplate

get_objectives_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of f :return:

get_vars_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of x :return:

n_objectives() int[source]

Number of objectives (size of f) :return:

n_vars() int[source]

Number of variables (size of x) :return:

objective_function(x: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]]) ndarray[tuple[Any, ...], dtype[float64]][source]

Evaluate x and return f(x) :param x: array of variable values :return: array of objectives

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.adequacy_problem.apply_actives_mask(original_active: ndarray[tuple[Any, ...], dtype[int64]], mask_indices: ndarray[tuple[Any, ...], dtype[int64]], mask: ndarray[tuple[Any, ...], dtype[int64]], years_starts_indices: ndarray[tuple[Any, ...], dtype[int64]])[source]
Parameters:
  • original_active

  • mask_indices

  • mask – x applied to generators or batteries (goes from 0 to N-years + 1)

  • years_starts_indices – array saying in which profile index starts each year

Returns:

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.adequacy_problem.correct_x(x, lb, ub)[source]

Correct x in place to the given boundaries :param x: :param lb: :param ub: :return:

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.adequacy_problem.determine_starting_index_of_every_year(index) ndarray[tuple[Any, ...], dtype[int64]][source]

Find the index where each different year starts :param index: :return:

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.black_box_problem_template module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.black_box_problem_template.BlackBoxProblemTemplate(grid: MultiCircuit, x_dim: int, plot_x_idx: int, plot_y_idx: int)[source]

Bases: object

get_investments_for_combination(x: ndarray[tuple[Any, ...], dtype[int64]]) List[Investment][source]

Get the list of the investments that belong to a certain combination :param x: array of 0/1 :return: list of investments objects

get_objectives_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of f :return:

get_vars_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of x :return:

n_objectives() int[source]

Number of objectives (size of f) :return:

n_vars() int[source]

Number of variables (size of x) :return:

objective_function(x: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]]) ndarray[tuple[Any, ...], dtype[float64]][source]

Evaluate x and return f(x) :param x: array of variable values :return: array of objectives

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_problem module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_problem.PowerFlowInvestmentProblem(grid: MultiCircuit, pf_options: PowerFlowOptions)[source]

Bases: BlackBoxProblemTemplate

get_objectives_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of f :return:

get_vars_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of x :return:

n_objectives() int[source]

Number of objectives (size of f) :return:

n_vars() int[source]

Number of variables (size of x) :return:

objective_function(x: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]]) ndarray[tuple[Any, ...], dtype[float64]][source]

Evaluate x and return f(x) :param x: array of variable values :return: array of objectives

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_problem.power_flow_function(inv_list: List[Investment], grid: MultiCircuit, pf_options: PowerFlowOptions, branches_cost, vm_cost: ndarray[tuple[Any, ...], dtype[float64]], vm_max: ndarray[tuple[Any, ...], dtype[float64]], vm_min: ndarray[tuple[Any, ...], dtype[float64]], va_cost: ndarray[tuple[Any, ...], dtype[float64]], va_max: ndarray[tuple[Any, ...], dtype[float64]], va_min: ndarray[tuple[Any, ...], dtype[float64]]) TechnoEconomicScores[source]

Compute the power flow of the grid given an investments group :param inv_list: list of Investments :param grid: MultiCircuit grid :param pf_options: Power flow options :param branches_cost: Array with all overloading cost for the branches :param vm_cost: Array with all the bus voltage module violation costs :param vm_max: Array with the Vm min values :param vm_min: Array with the Vm max values :param va_cost: Array with all the bus voltage angles violation costs :param va_max: Array with the Va max values :param va_min: Array with the Va min values :return: InvestmentScores

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_ts_problem module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_ts_problem.TimeSeriesPowerFlowInvestmentProblem(grid: MultiCircuit, pf_options: PowerFlowOptions, time_indices: ndarray[tuple[Any, ...], dtype[int64]], clustering_results: ClusteringResults | None = None, opf_time_series_results: None | OptimalPowerFlowTimeSeriesResults = None, engine: EngineType = VeraGrid)[source]

Bases: BlackBoxProblemTemplate

get_objectives_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of f :return:

get_vars_names() ndarray[tuple[Any, ...], dtype[str_]][source]

Get a list of names for the elements of x :return:

n_objectives() int[source]

Number of objectives (size of f) :return:

n_vars() int[source]

Number of variables (size of x) :return:

objective_function(x: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]]) ndarray[tuple[Any, ...], dtype[float64]][source]

Evaluate x and return f(x) :param x: array of variable values :return: array of objectives

VeraGridEngine.Simulations.InvestmentsEvaluation.Problems.power_flow_ts_problem.power_flow_ts_function(inv_list: List[Investment], grid: MultiCircuit, pf_options: PowerFlowOptions, time_indices: ndarray[tuple[Any, ...], dtype[int64]], opf_time_series_results: None | OptimalPowerFlowTimeSeriesResults, clustering_results: ClusteringResults | None, engine: EngineType, branches_cost, vm_cost: ndarray[tuple[Any, ...], dtype[float64]], vm_max: ndarray[tuple[Any, ...], dtype[float64]], vm_min: ndarray[tuple[Any, ...], dtype[float64]], va_cost: ndarray[tuple[Any, ...], dtype[float64]], va_max: ndarray[tuple[Any, ...], dtype[float64]], va_min: ndarray[tuple[Any, ...], dtype[float64]]) TechnoEconomicScores[source]

Compute the power flow of the grid given an investments group :param inv_list: list of Investments :param grid: MultiCircuit grid :param pf_options: Power flow options :param time_indices: Time indices of the investments :param opf_time_series_results: Optimal power flow results :param clustering_results: Clustering results :param engine: Engine type :param branches_cost: Array with all overloading cost for the branches :param vm_cost: Array with all the bus voltage module violation costs :param vm_max: Array with the Vm min values :param vm_min: Array with the Vm max values :param va_cost: Array with all the bus voltage angles violation costs :param va_max: Array with the Va max values :param va_min: Array with the Va min values :return: InvestmentScores

Module contents