Allocation#

APIs for market allocation and power-flow-model solving in the unit-based workflow.

API path: apem.unit_based_model.allocation

class PowerFlowModel[source]#

Bases: ABC

Abstract class to be extended by each power flow model.

class Allocation(
welfare,
x_bt,
y_st,
x_btl,
y_stl,
f_vwt,
alpha_vt,
u_st,
phi_st,
slack_vt,
power_flow_model,
runtime,
num_vars,
num_constrs,
MIP_gap,
num_cont_vars,
num_bin_vars,
dataset,
f_vwkt=None,
)[source]#

Bases: object

Data and information related to an allocation, including the values of the optimization variables and statistics from the optimizer.

consumed_real_power_per_node_period(node, period)[source]#

Compute total real power consumed in specified node and period.

Parameters:
  • node (int) – Node for which the consumed real power is computed.

  • period (int) – Period for which the consumed real power in a node is computed.

Returns:

Total consumed real power per specified node and period.

Return type:

float

excess_supply()[source]#

Compute total excess supply.

Returns:

The difference between the accepted supply and demand.

Return type:

float

generated_real_power_per_node_period(node, period)[source]#

Compute total real power generated in specified node and period.

Parameters:
  • node (int) – Node for which the generated real power is computed.

  • period (int) – Period for which the generated real power in a node is computed.

Returns:

Total generated real power per specified node and period.

Return type:

float

class BuyersAllocation(x_bt, x_btl, df_buyers, blocks_buyers)[source]#

Bases: object

The results of an allocation that relate to the buyers.

demand_acceptance_ratio()[source]#

Compute demand acceptance ratio for all periods. It does not include the inelastic demand.

Returns:

the fraction of elastic demand that is fulfilled in the allocation

Return type:

float

class SellersAllocation(y_st, y_stl, u_st, phi_st, df_sellers)[source]#

Bases: object

The results of an allocation that relate to the sellers.

supply_acceptance_ratio()[source]#

Compute supply acceptance ratio for all periods.

Returns:

the fraction of available supply that is accepted in the allocation

Return type:

float

class TransmissionNetworkAllocation(f_vwt, alpha_vt, slack_vt, network, periods, f_vwkt=None)[source]#

Bases: object

The results of an allocation that relate to the transmission network.

congested_lines()[source]#

Compute congested lines.

Returns:

dictionary with the congested lines for each period

Return type:

dict