modified_resilience_index#

module wntr.metrics.hydraulic

modified_resilience_index(pressure, elevation, Pstar, demand=None, per_junction=True)[source]#

Compute the modified resilience index, equations from [12].

The modified resilience index is the total surplus power available at demand junctions as a percentage of the total minimum required power at demand junctions. The metric can be computed as a timeseries for each junction or as a system average timeseries.

Parameters:
  • pressure (pandas DataFrame) – A pandas DataFrame containing junction pressure (index = times, columns = junction names).

  • elevation (pandas Series) – Junction elevation (which can be obtained using wn.query_node_attribute(‘elevation’)) (index = junction names)

  • Pstar (float) – Pressure threshold.

  • demand (pandas DataFrame) – A pandas DataFrame containing junction demand (only needed if per_junction=False) (index = times, columns = junction names).

  • per_junction (bool (optional)) – If True, compute the modified resilience index per junction. If False, compute the modified resilience index over all junctions.

Returns:

Modified resilience index time-series. If per_junction=True, columns=junction names.

Return type:

pandas Series or DataFrame