cronian.results

Functions

extract_market_schedule(→ pandas.DataFrame)

Extract the market schedule from the solved optimization model.

extract_market_schedule_milp(→ pandas.DataFrame)

Extract the market schedule from the solved MILP optimization model.

build_market_schedule(→ pandas.DataFrame)

Build market schedule dataframe from the solved optimization model.

get_electricity_price(→ numpy.ndarray)

Get electricity price as the cost of the most expensive dispatched generator.

marginal_cost(→ float)

Calculate generator marginal cost as the derivative of the cost function w.r.t. power output.

extract_prosumer_dispatch(→ pandas.DataFrame)

Extract the dispatch of a prosumer from the solved optimization model.

get_flexible_demand_schedule(→ dict)

Get the schedule (power & store level) of the prosumer's flexible demand.

get_schedule_of_all_assets(→ dict)

Get the schedule of all assets of a prosumer.

Module Contents

cronian.results.extract_market_schedule(model: pyomo.environ.ConcreteModel, agent_ids: Iterable[str]) pandas.DataFrame

Extract the market schedule from the solved optimization model.

Args:

model: Solved Pyomo optimization model. agent_ids: Set of agent (generators and prosumers) IDs.

Returns:

market_schedule: DataFrame containing generator and prosumer dispatch.

cronian.results.extract_market_schedule_milp(model: pyomo.environ.ConcreteModel, agent_ids: Iterable[str]) pandas.DataFrame

Extract the market schedule from the solved MILP optimization model.

In a MILP model, the concept of duality is no longer applicable, hence, market price cannot be directly derived as the dual of the system electric power balance constraint. It is calculated using get_electricity_price function.

Args:

model: Solved Pyomo optimization model. agent_ids: Set of agent (generators and prosumers) IDs.

Returns:

market_schedule: DataFrame containing generator and prosumer dispatch.

cronian.results.build_market_schedule(model: pyomo.environ.ConcreteModel, agent_ids: Iterable[str], price: list[float]) pandas.DataFrame

Build market schedule dataframe from the solved optimization model.

Args:

model: Solved Pyomo optimization model. agent_ids: Set of agent (generators and prosumers) IDs. price: market price.

Returns:

market_schedule: DataFrame containing market_price, generator, and prosumer dispatch.

cronian.results.get_electricity_price(model: pyomo.environ.ConcreteModel) numpy.ndarray

Get electricity price as the cost of the most expensive dispatched generator.

Args:

model: Solved pyomo instance of the optimization model.

Returns:

np.ndarray representing the electricity price at each timestep.

cronian.results.marginal_cost(linear_cost: float, quadratic_cost: float, power_output: float) float

Calculate generator marginal cost as the derivative of the cost function w.r.t. power output.

Args:

linear_cost: linear cost coefficient of the generator. quadratic_cost: quadratic cost coefficient of the generator. power_output: power output (dispatch) of the generator.

Returns:

marginal_cost: marginal cost of the generator.

cronian.results.extract_prosumer_dispatch(model: pyomo.environ.ConcreteModel, prosumer: dict) pandas.DataFrame

Extract the dispatch of a prosumer from the solved optimization model.

Args:

model: Solved Pyomo optimization model. prosumer: Dictionary containing the prosumer configuration.

Returns:
prosumer_dispatch: DataFrame containing the prosumer’s flexible demand

power and store (energy) levels, and the schedule of all its assets.

cronian.results.get_flexible_demand_schedule(model: pyomo.environ.ConcreteModel, prosumer: dict) dict

Get the schedule (power & store level) of the prosumer’s flexible demand.

Args:

model: Solved Pyomo optimization model. prosumer: Dictionary containing the prosumer configuration.

Returns:
flex_demand_schedule: Dictionary containing the prosumer’s flexible

demand power and store (energy) levels.

cronian.results.get_schedule_of_all_assets(model: pyomo.environ.ConcreteModel, prosumer: dict) dict

Get the schedule of all assets of a prosumer.

Args:

model: Solved Pyomo optimization model. prosumer: Dictionary containing the prosumer configuration.

Returns:

all_assets_schedule: Dictionary containing the schedule of all assets.