## 2 Method
### Determining Availability, Reliability and NA-fines  
To calculate the NA-fines for every bid size, upper and lower boundaries were determined. The upper boundary was calculated by subtracting the bid size from the maximum possible power consumption, whereas the lower boundary is calculated by adding the bid size to the minimum possible power consumption. When the power consumption exceeds those boundaries, the portfolio is not able to deliver 100% flexibility in that direction, resulting in a fine that follows the fine regime (Section 2.1) used in this study. The availability is then calculated as the number of NA-events divided by the amount of data points per week, which is 2016 5-min timestamps. To determine reliability at a given bid size, an assessment of whether the portfolio was able to respond correctly needs to be made for every timestamp in the model. In this study, the required portfolio response is expressed in terms of Required Flexible Power (RFP). This describes the power that the portfolio should shift at each moment. A negative RFP represents a downward shift and a positive RFP represents an upwards shift to the baseline. When the portfolio is not able to deliver the RFP, a so called 'IR-event' occurs. The reliability can then be calculated as the percentage of timestamps in which no IR-event occurred. Determining whether an IR-event occurs is a repetitive process performed in multiple steps. First, a list of available households is generated, and a household is selected from that list. Then, a household is taken from that list and the Available Flexible Power (AFP) of that household is added to the Total Available Flexible Power (TAFP), after which the household is removed from the list and the availability is updated. This process is repeated until either the list of available households is empty, or the TAFP exceeds the RFP. If the list of available households is empty before the TAFP exceeds the RFP, then an IR-event occurs. If not, then no IR-event occurs. In both cases, the model breaks out of the loop and continues to the next 5-min interval. In Figure 1, this process is illustrated. The RFP can be calculated by dividing the frequency deviation (\(F_{actual}-F_{target}\)) by the Full Activation Deviation (FAD) and multiplying it with the bid size:  
\[RFP(t)=Bidsize*\frac{F_{actual}-F_{target}}{FAD} \tag{1}\]  
Figure 1: Switching process, aiming to determine whether an IR-event occurs in a 5-min interval. Since no more than 100% flexibility is required, the RFP cannot exceed (positively or negative) the bid size. The upper and lower boundaries of the RFP can be calculated by adding or subtracting the insensitivity range to the actual frequency (\(F_{actual}\)). In Figure 2, the portfolio activation fraction is displayed, representing the percentage of the portfolio that should be activated at any given frequency. This method is applied for every frequency measurement in the model to calculate the RFP. The main drawback of using heat pumps for DR-purposes lies in the constraints of the end-users that require a room temperature that is comfortable to live in [27]. In the model, this constraint is implemented in a simplified way by implementing a maximum switch time, thereby limiting the time that the heat pumps can be switched for. To enforce this principle, an availability-module is implemented into the model that limits the heat pump's availability for switching to a maximum of 15 min at a time. In this module, the availability status of every heat pump is stored. Heat pump availability in both directions will be stored in a data frame. The availability module works with a value for availability that is checked and updated for every 5-min interval in the model. When the heat pump is switched, 5 min are added to the (positive) value of heat pump availability for that household at that moment. When the heat pump is not switched while it is non-active (availability \(<\) 0), 5 min are added to the availability, making it less negative.