dispaset.postprocessing package

Submodules

dispaset.postprocessing.postprocessing module

Set of functions useful to analyse to DispaSET output data.

@author: Sylvain Quoilin, JRC

dispaset.postprocessing.postprocessing.Cashflows(inputs, results, unit)[source]

This function calculates the different cashflows (DA,2U,2D,3U,Heat,costs) for one specific unit returns: hourly cashflow

dispaset.postprocessing.postprocessing.CostExPost(inputs, results)[source]

Ex post computation of the operational costs with plotting. This allows breaking down the cost into its different components and check that it matches with the objective function from the optimization.

The cost objective function is the following:

SystemCost(i) =E= sum(u,CostFixed(u)*Committed(u,i)) +sum(u,CostStartUpH(u,i) + CostShutDownH(u,i)) +sum(u,CostRampUpH(u,i) + CostRampDownH(u,i)) +sum(u,CostVariable(u,i) * Power(u,i)) +sum(l,PriceTransmission(l,i)*Flow(l,i)) +sum(n,CostLoadShedding(n,i)*ShedLoad(n,i)) +sum(chp, CostHeatSlack(chp,i) * HeatSlack(chp,i)) +sum(p2h2, CostH2Slack(p2h2,i) * StorageSlack(p2h2,i)) +sum(chp, CostVariable(chp,i) * CHPPowerLossFactor(chp) * Heat(chp,i)) +Config(“ValueOfLostLoad”,”val”)*(sum(n,LL_MaxPower(n,i)+LL_MinPower(n,i))) +0.8*Config(“ValueOfLostLoad”,”val”)*(sum(n,LL_2U(n,i)+LL_2D(n,i)+LL_3U(n,i))) +0.7*Config(“ValueOfLostLoad”,”val”)*sum(u,LL_RampUp(u,i)+LL_RampDown(u,i)) +Config(“CostOfSpillage”,”val”)*sum(s,spillage(s,i));

Returns

tuple with the cost components and their cumulative sums in two dataframes.

dispaset.postprocessing.postprocessing.aggregate_by_fuel(PowerOutput, Inputs, SpecifyFuels=None)[source]

This function sorts the power generation curves of the different units by technology

Parameters
  • PowerOutput – Dataframe of power generationwith units as columns and time as index

  • Inputs – Dispaset inputs version 2.1.1

  • SpecifyFuels – If not all fuels should be considered, list containing the relevant ones

Returns PowerByFuel

Dataframe with power generation by fuel

dispaset.postprocessing.postprocessing.curtailment(inputs, results)[source]
dispaset.postprocessing.postprocessing.emissions(inputs, results)[source]

function calculates emissions for each zone returns: emissions : dataframe with summed up emissions for each zone

dispaset.postprocessing.postprocessing.filter_by_heating_zone(HeatOutput, inputs, z_th)[source]

This function filters the dispaset Output Power dataframe by zone

Parameters
  • HeatOutput – Dataframe of power generationwith units as columns and time as index

  • inputs – Dispaset inputs version 2.1.1

  • z – Selected zone (e.g. ‘BE’)

Returns Heat

Dataframe with power generation by zone

dispaset.postprocessing.postprocessing.filter_by_storage(PowerOutput, Inputs, StorageSubset=None)[source]

This function filters the power generation curves of the different storage units by storage type

Parameters
  • PowerOutput – Dataframe of power generationwith units as columns and time as index

  • Inputs – Dispaset inputs version 2.1.1

  • SpecifySubset – If not all EES storages should be considered, list containing the relevant ones

Returns PowerByFuel

Dataframe with power generation by fuel

dispaset.postprocessing.postprocessing.filter_by_tech(PowerOutput, inputs, t)[source]

This function filters the dispaset power output dataframe by technology

Parameters
  • PowerOutput – Dataframe of power generation with units as columns and time as index

  • inputs – Dispaset inputs version 2.1.1

  • t – Selected tech (e.g. ‘HDAM’)

Returns Power

dispaset.postprocessing.postprocessing.filter_by_tech_list(PowerOutput, inputs, tech)[source]

This function filters the dispaset power output dataframe by technology

Parameters
  • PowerOutput – Dataframe of power generation with units as columns and time as index

  • inputs – Dispaset inputs version 2.1.1

  • t – Selected tech (e.g. ‘HDAM’)

Returns Power

dispaset.postprocessing.postprocessing.filter_by_zone(PowerOutput, inputs, z, thermal=None)[source]

This function filters the dispaset Output dataframes by zone

This function filters the dispaset Output Power dataframe by zone

Parameters
  • PowerOutput – Dataframe of power generation with units as columns and time as index

  • inputs – Dispaset inputs version 2.1.1

  • z – Selected zone (e.g. ‘BE’)

Returns Power

Dataframe with power generation by zone

dispaset.postprocessing.postprocessing.get_EFOH(inputs, results)[source]

Function that computes the “Equivalent Full Load Operating Hours” of the Elyzers :param inputs: DispaSET inputs :param results: DispaSET results :returns EFOH: Dataframe with the EFOH of each country

dispaset.postprocessing.postprocessing.get_from_to_flows(inputs, flows, zones, idx=None)[source]

Helper function for braking down flows into networkx readable format

Parameters
  • inputs – Dispa-SET inputs

  • flows – Flows from Dispa-SET results

  • zones – List of selected zones

  • idx – datetime index (can be a single hour or a range of hours)

Returns

dispaset.postprocessing.postprocessing.get_heat_plot_data(inputs, results, z_th)[source]

Function that reads the results dataframe of a DispaSET simulation and extract the dispatch data specific to one zone

Parameters
  • results – Pandas dataframe with the results (output of the GdxToDataframe function)

  • z_th – Heating zone to be considered (e.g. ‘BE_th’)

Returns plotdata

Dataframe with the dispatch data storage and outflows are negative

dispaset.postprocessing.postprocessing.get_imports(flows, z)[source]

Function that computes the balance of the imports/exports of a given zone

Parameters
  • flows – Pandas dataframe with the timeseries of the exchanges

  • z – Zone to consider

Returns NetImports

Scalar with the net balance over the whole time period

dispaset.postprocessing.postprocessing.get_indicators_powerplant(inputs, results)[source]

Function that analyses the dispa-set results at the power plant level Computes the number of startups, the capacity factor, etc

Parameters
  • inputs – DispaSET inputs

  • results – DispaSET results

Returns out

Dataframe with the main power plants characteristics and the computed indicators

dispaset.postprocessing.postprocessing.get_load_data(inputs, z)[source]

Get the load curve, the residual load curve, and the net residual load curve of a specific zone

Parameters
  • inputs – DispaSET inputs (output of the get_sim_results function)

  • z – Zone to consider (e.g. ‘BE’)

Return out

Dataframe with the following columns: Load: Load curve of the specified zone ResidualLoad: Load minus the production of variable renewable sources NetResidualLoad: Residual netted from the interconnections with neightbouring zones

dispaset.postprocessing.postprocessing.get_net_positions(inputs, results, zones, idx)[source]

Helper function for calculating net positions in individual zones

Parameters
  • inputs – Dispa-SET inputs

  • results – Dispa-SET results

  • zones – List of selected zones

  • idx – datetime index (can be a single hour or a range of hours)

Returns

NetImports and Net position

dispaset.postprocessing.postprocessing.get_plot_data(inputs, results, z)[source]

Function that reads the results dataframe of a DispaSET simulation and extract the dispatch data specific to one zone

Parameters
  • results – Pandas dataframe with the results (output of the GdxToDataframe function)

  • z – Zone to be considered (e.g. ‘BE’)

Returns plotdata

Dataframe with the dispatch data storage and outflows are negative

dispaset.postprocessing.postprocessing.get_power_flow_tracing(inputs, results, idx=None, type=None)[source]

Up-stream and down-stream (not yet implemented) looking algorithms using Bialek’s power flow tracing method (Bialek at al. DOI: 10.1049/ip-gtd:19960461)

Parameters
  • inputs – Dispa-SET inputs

  • results – Dispa-SET results

  • idx – pandas datetime index (can be both a single and multiple time intervals)

Returns

NxN matrix of zones (Row -> Excess generation zones, Col -> Lack of generation)

dispaset.postprocessing.postprocessing.get_result_analysis(inputs, results)[source]

Reads the DispaSET results and provides useful general information to stdout

Parameters
  • inputs – DispaSET inputs

  • results – DispaSET results

dispaset.postprocessing.postprocessing.get_units_operation_cost(inputs, results)[source]

Function that computes the operation cost for each power unit at each instant of time from the DispaSET results Operation cost includes: CostFixed + CostStartUp + CostShutDown + CostRampUp + CostRampDown + CostVariable

Parameters
  • inputs – DispaSET inputs

  • results – DispaSET results

Returns out

Dataframe with the the power units in columns and the operation cost at each instant in rows

Main Author: @AbdullahAlawad

dispaset.postprocessing.postprocessing.load_shedding(inputs, results)[source]
dispaset.postprocessing.postprocessing.reserve_availability_demand(inputs, results)[source]

this function evaluates the reserve demand and availability of all units returns: hourly_availability : hourly availability over the corresponding hourly reserve demand in [%] returns: availability : the mean of hourly availability,

total hourly availability over total corresponding hourly reserve demand in [%]

returns: reserve_demand mean demand over peak load

dispaset.postprocessing.postprocessing.shadowprices(results, zone)[source]

this function retrieves the schadowprices of DA, 2U, 2D, 3U for 1 zone

Module contents