cronian.results =============== .. py:module:: cronian.results Functions --------- .. autoapisummary:: cronian.results.extract_market_schedule cronian.results.extract_market_schedule_milp cronian.results.build_market_schedule cronian.results.get_electricity_price cronian.results.marginal_cost cronian.results.extract_prosumer_dispatch cronian.results.get_flexible_demand_schedule cronian.results.get_schedule_of_all_assets Module Contents --------------- .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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.