Water heating contributes up to 40% of a household's total electricity usage and places a substantial burden on the electricity grid due to high power ratings and users' largely simultaneous hot water usage. The main determinants of its electricity draw are physical properties such as set temperature, insulation, and plumbing con guration; environmental conditions such as ambient temperature and inlet temperature; and the hot water usage pro les. These pro les include the usage volumes, the times of usage and the outlet temperatures. The ecacy of energy management techniques that model water heaters and the accuracy of their simulation results therefore rely on representative hot water usage pro les. Existing models for household hot water usage neglect di erences between users, and temporal variations such as the season and the day of the week, and are not fully autonomous. We propose a probabilistic data-driven model for modelling individualised hot water pro les and an accompanying hot water usage simulator that includes all these factors. We gathered data from 77 residential households over a period of one year to train and evaluate the model for all four seasons. The results show that the simulated hot water usage pro les match the statistical properties of the measured data. Moreover, the individual hot water usage modelling and the resulting aggregated energy load on the grid closely match the measured data, improving on the existing hot water usage by halving the modelling error. Keywords: Residential electricity demand modelling; Domestic hot water; Hot water usage modelling; Water heater simulation; Demand-side management; Hot water usage model; Probabalistic modelling 1. Introduction Electric water heaters contribute up to 40 % of a household's total energy usage (Hohne et al., 2019). In South Africa, which relies almost exclusively on electricity for energy, the approximately ve million water heaters contribute an estimated 30 % to 50 % of the grid load at peak times, and 7 % of the country's daily energy requirements (Hohne et al., 2019; Skinner et al., 2012). Moreover, since 88 % of the country's electricity is generated from burning coal, the environmental water heating footprint is substantial (Mathu, 2017). Fortunately water heaters with tanks are reasonably good at storing thermal energy, which makes them well-suited to demand-side management { an approach that reduces the impact of heavy loads on a constrained grid. However, besides managing demand from water heaters, e ective demand-side management strategies should balance two additional, competing requirements: managing the total energy used and ensuring user satisfaction (Roux et al., 2018). To achieve this balance requires large-scale simulation of water heaters using accurate thermal models. The main determinants of such a model are environmental (e.g. inlet water temperature and ambient temperature), the physical properties of the water heater (e.g. thermal losses speci cation, element rating, volume), installation and con guration parameters (e.g. plumbing setup, retro tted insulation blankets, orientation), and the hot water usage pro le (also called the `draw pro le' or simply the `water pro le') (Matos et al., 2019; Nel et al., 2017; Kepplinger et al., 2015; Diao et al., 2012). After a demand-side-management-ready smart water heater is installed, the main determinant of variable use is the user's water pro le, which directly a ects the energy pro le (Nel et al., 2017). The accuracy of Corresponding author Email address: mjbooysen@sun.ac.za (M.J. Booysen ) Preprint submitted to Applied Energy April 30, 2020 a water usage pro le has a substantial and direct in uence on the accuracy of modelling a tanked water heater (Dongellini et al., 2015; Spur et al., 2006). For example, Wang et al. (2007) modelled and simulated a gas-powered water storage tank and found deviations of between 8 % and 15 % for di erent water pro les. Domestic hot water and the resulting energy pro les typically have two peaks daily, one in the morning and one in the afternoon (Jack et al., 2018; Roux and Booysen, 2017; Forlee, 1998; ASHRAE, HVAC, 2003). The hot water draw model that is possibly the most frequently used, the ASHRAE (American Society of Heating, Refrigerating and Air-Conditioning Engineers) standard, has two versions. The rst, and also the older and more widely used of the two, comes from the ASHRAE Standard 90.2 (ASHRAE, 1993) which does not specify the source of data. The second, from the HVAC Applications Handbook, 2003, has data collected from Canadian residences and provides a pro le for a typical household with two adults, two children, a clothes washer and a dishwasher (Fairey and Parker, 2004). The ASHRAE standard has been used to perform large simulations of grids comprising water heaters, but it does not di erentiate between users. Moreover, it uses a coarse time segmentation of one hour and does not consider weekly and seasonal variations. Individual di erentiation and characterisation of water pro les reduces the uncertainties for predictive analyses and removes assumptions based on over-sizing and generalisation (Iglesias and Palensky, 2013). Forecasting household water usage patterns for individual heaters in demand-side management strategies could improve the reliability of the response to energy surpluses and shortages (Gela zanskas and Gamage, 2015). Almost all of the existing research uses individual measurements of point-of-use devices in a household to determine the end-use cases, which are used to develop the household's total water pro le. Such models are generally complex and expensive; a cheaper alternative is load modelling (Wid en et al., 2009). These models provide individual di erentiation for all water used, but a household's usage varies over time: weekly patterns vary for days of the week and annual patterns vary for seasons, regions and climate (Booysen et al., 2019; Roux and Booysen, 2017). The day of the week and the season have distinct e ects on the water demand, the signi cant factors being temperature and precipitation (Gerin et al., 2014; Gato et al., 2007; Zhou et al., 2002). Other factors to consider are holidays and once-o special events (Zhou et al., 2002). Accordingly, when assessing energy-saving initiatives it is important to characterise heater pro les accurately (Bertrand et al., 2017). 1.1. Modelling water pro les Given the importance of getting accurate usage pro les, various models have been proposed in the liter- ature. The characteristics of the main models are discussed here and summarised in Table 1. Table 1: Work and models for simulated water usage pro les. An S in the Day column indicates that days were di erentiated only by workdays and weekends and a tick indicates that the di erentiation extended to the day of the week. A dash indicates that the source didn't specify the information. The Unique column indicates if the model accounted for household individuality. Ref Category Hot water Season Day Unique Res. ASHRAE (1993) Technical standards 3 - - 7 1 hr ASHRAE, HVAC (2003) Technical standards 3 - - 7 1 hr Edwards et al. (2015) Data collected 3 - - 3 5 min Wid en et al. (2009) Stochastic 3 - S 3 5 min Hendron et al. (2010) Stochastic 3 3 S 7<1 min Jordan and Vajen (2001) Stochastic 3 3 3 7 1 min Buchberger and Wells (1996) Stochastic 3 3 S 3 1 min Blokker et al. (2009) Stochastic 3 - S - 1 sec Scheepers and Jacobs (2014) Stochastic 3 7 - - - Richard (2016) Stochastic 3 3 7 - 1 min Yao and Steemers (2005) Stochastic 7 3 - - 1 min Negnevitsky and Wong (2014) Stochastic 3 7 7 7 5 min Aki et al. (2016) Stochastic 3 7 7 3 10 min Bakker et al. (2008) Data-learning 7 7 3 3 1 hr P ugradt (2016) Behavioral 7 3 3 3 - Popescu and Serban (2008) Time-series forecasting 3 - 3 3 - Gela zanskas and Gamage (2015) Time-series forecasting 3 - 3 3 1 hr Roux (2018) Time-series forecasting 3 - 3 3 1 min Jack et al. (2018) Data-driven 7 7 7 3 1 min This paper Data-driven 3 3 3 3 1 min 2 Technical standards Existing standards provide typical daily hot water usage pro les that are available for design purposes. Marini et al. (2015) evaluated simulation tools based on various standards to compare simulated results with monitored results for modelling hot water usage in buildings. They found that the simulated total hot water demand was underestimated by up to 30 % and overestimated by up to 40 %. The energy eciency of the simulated model was also overestimated by between 14 % and 22 % compared to the actual hot water heater. Gholizadeh and Aravinthan (2016) proposed a model to reduce the electricity costs of energy usage by adjusting the heaters' set-point temperatures and simulating water pro les based on the ASHRAE Standard 90.2. However, like other technical standards, the ASHRAE standard does not take into account seasonal or individual variation, so water pro les based on technical standards are typically generalised. Data-collected models Data-collected models stray from using probabilistic models and advance towards a technique that focuses on numerous participants and large amounts of data. The technique uses long-term databases of water measurements and simulations to produce a water pro le based on the average. Edwards et al. (2015) used data measurements from 73 Canadian households to produce annual water draw pro les. Of the total households, 12 were selected to produce ve minute resolution pro les based on four usage levels and three discrete temporal usage patterns for each level. These usage levels corresponded to the mean, median, 20 % and 80 % percentiles of usage for the sample of households, and the temporal usage patterns were made up of predominantly morning usage, predominantly evening usage, and usage constant throughout the day. The research revealed that di erent water usage patterns can lead to signi cant changes when it comes to predicting water usage pro les. Stochastic models Stochastic methods model the probability distribution of household water usage using time-of-use data. Wid en et al. (2009) used time-of-use data to generate electricity and hot water pro les. Individuals in Sweden used diaries to track the sequence and time of electrical or hot water activities during one weekday and one weekend day. They then tried to match the activities to end-use categories and used information from surveys and product tests to estimate appliance parameters. The results showed a promising correlation between simulated and measured data. Hendron et al. (2010) determined hot water events for di erent activities using clustering and probability distributions. The event characteristics were approximated by tting normal and exponential functions. Jordan and Vajen (2001) used a similar approach with the exclusion of clustering. Yao and Steemers (2005) produced domestic energy demand pro les from aggregated random appliance pro les. They clustered the energy pro les according to the factors that in uence a household's pro le, such as the number of occupants, the times of the rst and last appliance usage of each day, and the occupancy patterns, determined by the periods of the day when the house was unoccupied (Negnevitsky and Wong, 2014; Aki et al., 2016). Buchberger and Wells (1996) based their event probability distributions on the assumption that water demand follows a homogeneous Poisson rectangular pulse process, which means that events can be approxi- mated by rectangular shapes with the rate of occurrences being time dependent. However, the results showed that this process cannot model the variance in occurrence well enough and the data came from a total of only four households. Scheepers and Jacobs (2014) devised a method for generating a residential indoor cold water pro le based on probabilistic end-use models. The pro les consisted of high resolutions with the tem- poral sample di erence being as small as one second. Residential water demand pro les were simulated using SIMDEUM, which was developed by Blokker et al. (2009). As in the model by Buchberger and Wells (1996), water events were approximated by rectangular pulses for six end-use cases and aggregated water demands were obtained using a Monte Carlo method. However, they used information on total water usage and could not distinguish between hot and cold water. Richard (2016) improved on this by using volume balancing techniques to approximate the portion of hot water from the total. The resulting daily water demand pro les were similar to popular existing patterns such as the ASHRAE Standard 90.2. Behavioural models Behavioural models are based on factors that in uence load pro les such as work days and holidays. P ugradt (2016) produced a psychological desire model to avoid calculating probability distributions. He 3 used a program called a behaviour-based load pro le generator which makes it possible to simulate an individual's behaviour, to obtain energy and water usage data. He concluded that it works well for individual households; however, the quality of the results is strongly determined by the input. It is dicult to gather information about residents and more assumptions have to be made for larger areas of households. Data-learning models Neural networks are computational models consisting of neurons that can learn, generalise and categorise data. Bakker et al. (2008) obtained the heat demand of a household to calculate the electricity demand and used them in a multi-layer feed-forward neural network. The heat demand for each following day was predicted with knowledge of the expected temperature and the previous day's heat pro le. The output data was generated with an hourly resolution, as not enough training data was available to make more accurate predictions. The results were good, despite an hourly mean absolute deviation of approximately 36 kWm. The authors suggested that the results could be improved if more factors were considered in the model. Time series models Time series models forecast a system's future behaviour by analysing historical data to make statistical conclusions based on time correlation. The original data is decomposed into trend, seasonality and residual components. Autocorrelation functions and partial autocorrelation functions are used to compare a time series with a time-displaced version of itself. A residual component showing zero correlation means that the components were successfully separated. A strict requirement for time series modelling is that the data must be stationary, meaning that it has a time-invariant mean, variance and autocorrelation. Many tests are available to check if time series data is stationary. A variety of forecasting models can then use this information to predict future data. More information on time series forecasting can be found in Shumway and Sto er (2000). To forecast the hot water demand for residential households, Gela zanskas and Gamage (2015) tested vari- ous time series forecasting techniques and used di erent forecasting models. As the data showed strong daily and weekly correlation, the best results were obtained using a Loess (locally estimated scatterplot smoothing) seasonal decomposition of a time series with an ARIMA (autoregressive integrated moving average) model and an STL (seasonal and trend decomposition) exponential smoothing model. The study did not, however, account for the time of year, which contributes to both seasonality and holidays. Popescu and Serban (2008) explored a similar approach using an ARMA (autoregressive moving average) model to simulate the water demand for a block of apartments. The existing time series forecasting models are suitable for forecasting the pro le for an individual house- hold, but they fail to capture seasonal e ects. Time series is closely related to machine learning, where a great deal of data is required. Data-driven models These models forecast water usage by analysing the relationships and pattern of measured data without matching water usages to speci c household devices. Jack et al. (2018) proposed a minimal simulation model (MSM) that simulates smart control of a water heater to assess its impact on service. This model used the monitored electricity demand of a domestic water heater to generate water pro les that are simulated from a hot water tank model. The parameters for generating water pro les were adjusted manually until the simulated and monitored electricity demand pro les matched { a process that had to be repeated for each individual heater. 1.2. Contributions We present a novel data-driven probabilistic model that statistically models hot water pro les and a simulator that uses the model to generate hot water usage pro les, which can be used to support demand- side energy management of domestic water heaters. To deal with the limitations we identi ed in the studies reviewed above, our model features ne time resolution, di erentiation according to the season of the year and the day of the week, individual household di erences, and unsupervised automation. Our proposed model uses clustering and statistical analysis to model domestic hot water usage behaviour from historically measured usage pro les. Hot water usage data from 77 South African households was used. The measured hot water usage data from the households, the source code that ts the probabilistic model to the measured 4 data, the source code for the hot water usage simulator, and the simulated hot water usage pro les that were generated by the simulator for this paper can all be found in the supplementary material. 2. Hot water usage model and simulator The probabilistic model presented here statistically models the daily hot water usage pro le for individual electric water heaters (EWHs) based on historically measured ow rate data. This model can be used to model hot water demand and the resulting residential energy demand. We also created a hot water usage simulator that implements the probabilistic model. This simulator generates simulated hot water usage pro les ( ow rate versus time) based on the probabilistic model that was tted to the historically measured usage data. The hot water usage simulator can be used as a component of a larger EWH simulator. We rst describe the probabilistic model in Section 2.1 and then the usage simulator in Section 2.2. We used the data set gathered from 77 domestic water heaters in South Africa. Each heater was equipped with a smart controller that captured the ow rate every minute with a resolution of 0 :5 L using an in-line ow meter attached to the inlet pipe. After cleaning the data, each heater provided four months of data, one month for each season, with the starting dates being 5 February 2018, 9 April 2018, 21 August 2018 and 2 October 2018. The chosen periods do not include major holiday periods, but the model does make provision for their inclusion. The full data set is available with the model and the simulator code in the supplementary material. (a) (b) (c) (d) Figure 1: (a) The ow rate data points are clustered according to the time of day to produce time clusters CT;1andCT;2. (b) Water event parameters recorded for each time cluster are clustered according to volume. (c) Volume clusters are tted with 2D Gaussian distributions (red ovals) with correlation of volume and ow rate shown with a red arrow. Each cluster is associated with its own probability of occurrence, Pn,m. (d) Start times measured for a time cluster (green) are tted with a Gaussian distribution where t0represents the mean middle time of the time cluster. 5 2.1. Probabilistic hot water usage model The hot water usage model statistically models the hot water usage behaviour for a given EWH by identifying repeating daily hot water usage events, and determining the statistical distributions of each usage event's time of day, volume of water used, and average ow rate. To do this, the model groups the measured ow rate data into clusters of time, volume and ow rates, to which it ts distributions and determines their probabilities of occurrence, as shown in Figure 1. The model handles hot water usage variations due to seasonality by separating the measured data for a given EWH into four seasonal sets, and determining di erent model parameters for each season (summer, autumn, winter, spring). The model handles variations in the usage pattern due to the day of the week by further separating the seasonal data set into three subsets: the undi erentiated data set, the semi- di erentiated set, and the di erentiated set. The undi erentiated set assumes that the usage behaviour does not di er based on the day of the week, and that there is only one usage pattern which is the same for all seven days of the week. The semi-di erentiated set assumes that the usage behaviour di ers between weekdays and weekends, and that there are two di erent usage patterns, one for weekdays and one for weekends. The di erentiated set assumes that the usage behaviour di ers based on the day of the week, and that there are seven di erent usage patterns, one for each day of the week (Mondays, Tuesdays, ..., Sundays). For each season, we therefore derive three variations of our probabilistic hot water usage model, by applying the model to each of the three di erent data subsets: undi erentiated, semi-di erentiated, and di erentiated. We now present the procedure for deriving the model from the measured ow rate data. The same procedure is followed to derive the model parameters for the four seasons, and for the three model variations; the only di erence is the data set that is used to derive the model parameters. To identify repeating usage events, the daily measured ow rate data for all the days in a given data set are superimposed on a single day cycle, and the ow rate data are grouped into time clusters according to time of the day using k-means clustering (Jain et al., 1999), as shown in Figure 1a. We determine the optimal number of time clusters using the elbow method (Kodinariya and Makwana, 2013). Time clusters are represented by CT;p, where the subscript pis the index of the time cluster. Each time cluster now represents a repeating usage event, and the ow rate data points in the same time cluster on the same day are considered to represent a single usage event. We determine the probabilistic distribution of the time-of-day of each repeating event by tting a Gaussian probability density function to the time-of-day component of all the ow rate data points that belong to each time cluster, as shown in Figure 1b. The Gaussian probability density function is determined for time cluster pby calculating the time-of-day mean tpand variance 2 tpfor the ow rate data points within the time cluster. Next, we analyse the distribution of the volume and the average ow rate of the daily usage events within each time cluster. For a given time cluster, the volume and the average ow rate of the usage event on each day are calculated and plotted on a scatter plot, as shown in Figure 1b. To identify di erent types of usage events that may occur within the same time slot, the (volume, ow rate) data points are subclustered according to volume, as shown in Figure 1c. The volume subclustering within each time cluster is again performed using k-means clustering and the elbow method. Volume subclusters are represented by Cp;q, where subscript qis the index of the volume subcluster within time cluster p. Each event volume is captured with its associated average ow rate to retain correlation between the two variables. The volume subclusters within a time cluster represent di erent hot water usage events that may occur in the same time slot. However, on a given day, only one hot water usage event can occur in each time slot. The volume subclusters within the same time cluster therefore represent di erent possible realisations of a single hot water usage event within the given time slot. Every day, each possible realisation of the hot water usage event has a certain probability of occurring. For each time cluster, we therefore need to calculate the probability of each volume subcluster being realised. The probability Pp;qof volume subcluster qbeing realised in time cluster p, is calculated by dividing the number of days that the given subcluster occurs by the total number of days in the data set. (Note that this approach also accommodates the probability that no usage event occurs in the time slot on certain days, since there will also be a volume cluster for zero volume events). Finally, we characterise the probabilistic distribution of the volume and average ow rate for each volume subcluster. Since the volume and the average ow rate of a usage event may be statistically dependent, we t a Gaussian joint probability density function to the (volume, ow rate) data points in each volume subcluster, 6 as shown in Figure 1d. Each volume subcluster is therefore characterised by a joint (volume, average ow rate) mean represented by ( Vp;q,fp;q) and a joint (volume, average ow rate) variance represented by the volume variance 2 vp;q, the average ow rate variance 2 fp;q, and the correlation coecient p;q. To summarise, the probabilistic hot water usage model models the number of expected hot water usage events each day (time clusters), the probabilistic distribution of the time of day for each usage event (Gaus- sian probability density function), a number of di erent types of usage events that may occur in the same time slot (volume subclusters), the probability of each type of usage event occurring, and the probabilis- tic distribution of the volume and average ow rate of each type of usage event (using the Gaussian joint probability distribution function for each volume subcluster). 2.2. Hot water usage simulator Algorithm 1 shows the procedure used to generate simulated usage pro les from a water heater's prob- abilistic usage model. Assume that we wish to generate the hot water usage pro le for a number of days. To do this, we iterate through all the days, and for each day, we iterate through all the time clusters and generate a random hot water usage event for each time cluster. To generate the hot water usage event for a speci c time cluster, we rst determine the time of the event by drawing a random sample from its Gaussian time of day distribution, as shown in Figure 1b. Next, we determine which volume subcluster is realised within the time cluster by randomly sampling the subcluster index qbased on the probability distribution of all the volume subclusters within time cluster p. Once the volume subcluster has been determined, we determine the volume and the average ow rate of the hot water usage event by drawing a random sample from the Gaussian joint (volume, ow rate) distribution for the given volume subcluster, as shown in Figure 1d. Given the randomly sampled time, volume, and average ow rate of the event, the simulated ow rate versus time is constructed. First, the duration of the usage event is calculated by dividing the volume by the average ow rate, using Tdur=V f(1) whereTduris the duration of the event, and Vand fare the randomly sampled volume and average ow Algorithm 1 Hot water usage algorithm 1:procedure Generate simulated usage data 2: foreach day do 3: foreach time cluster p do 4: x Roll number between 0 and 1 // wherexis a random variable 5: q;i 0 6: whilei<Q pandq= 0do // whereQpis the optimal number of volume subclusters 7: i i+ 1 8: ifx<Pi n=1Pp;ithen // wherePis the volume subcluster occurrence probability 9: q i// assign picked volume subcluster to q 10: end if 11: end while 12: ifq>0then // event occurred 13: Vp;q;fp;q N (Vp;q;fp;q;2 vp;q;2 fp;q;p;q) // generate one sample 14: Tdurp; q Vp;q fp;q 15: tmp;q N (tp;2 tp) // generate one sample 16: tstartp; q tmp;q1 2Tdurp; q 17: end if 18: end for 19: foreach water usage event do// construct events 20: ow rate (t) f t startttstart+Tdur 21: 0t<t start andt>t start+Tdur 22: end for 23: Superimpose all water usage events to obtain simulated hot water usage pro le for day 24: end for 25:end procedure 7 (a) (b) Figure 2: Simulated hot water pro les generated in the identi ed time clusters (shaded red region) for (a) a light usage EWH and (b) a heavy usage EWH. The undi erentiated model was used. rate. The start time of the event is then calculated using tstart=tmTdur 2(2) wheretstart is the start time of the event, tmis the randomly sampled time of the event, and Tduris the duration of the event. (The time tmis the time in the middle of the event, and therefore half of the duration Tdurmust subtracted to obtain the start time of the event tstart. The simulated usage event is then constructed using the following equation f(t) =nf,tstartttstart+Tdur 0, otherwise(3) wheref(t) is the instantaneous hot water ow rate as a function of time. A hot water usage event is therefore simulated as a constant hot water ow rate between the start time and the end time of the event, and has a zero ow rate otherwise. The constant ow rate equals the randomly sampled average ow rate of the event, and the end time equals the randomly sampled start time plus the duration of the event. The simulated hot water usage pro le for the entire day is constructed by superimposing the simulated hot water usage events of all the time clusters. This hot water usage model can generate simulated pro les for a speci c day (e.g. Monday, Tuesday, etc.) over a desired period of time. Using the di erentiated model, we generated a week's pro le by producing a one-day water pro le from each of seven hot water usage models, each representing a day of the week. Figure 2 shows the simulated pro les generated by the undi erentiated model for seven days against the backdrop of the identi ed time clusters in red. It shows the pro le for one week on a 24 hour cycle, for a heater with light usage and one with heavy usage. 3. Model and simulator veri cation The simulator was veri ed by comparing the statistical distribution of the hot water usage events generated by the simulator with the statistical distribution of the measured usage events identi ed from the measured data. The veri cation consisted of four evaluations: 1. The statistical distributions of the simulated hot water usage events were compared with the statistical distributions of the real hot water usage events that were identi ed in the measured ow rate data. The comparison was done for two example EWHs, one with a light usage pro le, and one with a heavy usage pro le, and with their probabilistic models derived using the undi erentiated data set. 8 2. A large number of simulated usage pro les were generated for an EWH with an average usage pro- le. Histograms of the time of day of usage events were plotted and compared against the Gaussian probability density functions for the time of day identi ed from the measured ow rate data. 3. The frequency of the simulated usage events that belong to each volume subcluster within the same time cluster was calculated and compared with the probability of the volume subcluster occurring, as identi ed from the measured ow rate data. 4. Scatter plots of the volume and average ow rates of the daily usage event were plotted and compared with the con dence ellipses of the Gaussian joint probability functions for the volume and ow rate identi ed from the measured ow rate data. The generation of volume clusters for a pro le consisting of ve time clusters for the undi erentiated model is shown in Figure 3a. The water events were obtained for 200 weeks worth of Monte Carlo realisations of a simulated hot water pro le and were plotted against the volumes of each water event. The time clusters are colour-coded and the volume clusters are di erentiated by symbols to make it clear to which clusters the water events belong. This pro le speci cally shows that the user has larger water events occurring in the morning and evening hours and smaller water events occurring in-between. Table 2 shows the expected probabilities for each volume cluster and the percentage of volume clusters that actually occurred in the following columns. The smallness of the di erences between the two columns shows that the model generates water events very close to the expected probabilities. Table 2: Table of event occurrences of each volume cluster within each time cluster for the 200 weeks of measured and simulated water events taken from Figure 3a. Volume cluster 1 Volume cluster 2 Time cluster Measured Simulated Measured Simulated 1 50 % 49 % 18 % 15 % 2 25 % 24 % 36 % 34 % 3 25 % 22 % 11 % 7 % 4 61 % 57 % 18 % 16 % 5 57 % 54 % 11 % 12 % The rest of Figure 3 shows the modelled distributions (based on measured data) and the simulated statistical distributions for an EWH that has three di erent time clusters. Approximately 2000 water events were generated for each time cluster to produce these distributions of the data that accurately re ect the cluster's statistical properties. Figures 3b, 3c and 3d show the modelled normal distribution (orange) of the time of day based on the measured data and a histogram of the simulated even times (green) generated by the usage simulator. The legend of each gure shows the mean and standard deviations of the measured data and the simulated events. The statistical properties of the simulated start times agree with those of the statistical properties of the measured data. Figures 3e, 3f and 3g show scatter plots of the volume and ow rate parameters for simulated water events for the same three time clusters as the start times. From each time cluster three volume clusters were identi ed and colour-coded accordingly. A con dence ellipse is also shown for the measured data that was used to identify each volume cluster. Each ellipse has a con dence interval of 95% to show that 95% of the simulated pro le's water events fall within these regions. These gures show that the simulated pro les retain the mean and standard deviation for both volume and ow rate as well as the correlation between them. 4. Comparison with existing models We rstly compared the ability of the three variations of our model to model hot water demand against that of two popular models from the literature. We also used a validated heater model to compare the heaters' simulated energy pro les with their modelled pro les. Finally, we compared the results with the \notch test", an experiment that was done on the South African national electricity grid using an estimated 120 000 heaters, to determine the aggregate electrical pro les of residential households' water heaters (Forlee, 1998). For comparison, hot water usage pro les were generated from the minimal simulation model (MSM) devised by Jack et al. (2018) and the ASHRAE 90.2 implementation by Gholizadeh and Aravinthan (2016). 9 (a) (b) (c) (d) (e) (f) (g) Figure 3: a) Scatter plot of water events generated for many realisations of a single EWH's simulated hot water pro le for the undi erentiated model. The occurrence frequencies are shown in Table 2. b-d) Start times of measured data distributions (orange) and generated simulated water events (green) for three time clusters. Statistical properties of each are shown in the legend. e-g) Volume and ow rate scatter plots of the simulated water events generated for each time cluster. Also shown are 95% con dence ellipses produced by the measured data for each volume cluster. 10 (a) (b) (c) (d) (e) (f) Figure 4: a-d) Comparison of the water volume modelling errors for the nominal simulated hot water pro les of our model for all data sets and other existing models. Results are shown for hourly volume modelling errors (Equation 7) for a) a light water usage household and b) a heavy water usage household, and results are also shown for weekly volume modelling errors (Equation 10) for c) a light water usage EWH and d) a heavy water usage EWH. A negative value indicates that our model had a smaller modelling error, compared to the measured data, than the model against which it is compared. e-f) Comparison of the EWH-speci c e) hourly and f) weekly water volume modelling errors (Equations 11 and 12) for the nominal simulated hot water pro les of our model for all data sets and other existing models for 77 households. 11 The original MSM model was inconvenient for a large number of pro les because the parameters would have to be manually adjusted to t each unique pro le, which would take many hours to do. We therefore adapted this model to t the data by autonomously iterating the parameters to allow the model to work with larger data-sets. Setting up the model requires manual intervention to assess the quality of the match between the measured and modelled pro les. We automated this assessment using a normalised coecient of determination, R2di . The ASHRAE model is a deterministic pro le with no random variations. To implement the model we added random noise to the ASHRAE 90.2 pro le, similar to Gholizadeh and Aravinthan (2016). We used a normal Gaussian distribution with mean = 0 and variance 2= 0:06. To ensure a fair comparison, the ASHRAE pro les were scaled to match the aggregated median weekly water usage volume of the measured data. Each water usage event was spread to occur over the hour with a per-minute water ow rate, so that it tted a normal distribution with deviations at the hour boundaries of Thour= Average Usage + U(500 sec;500 sec) (4) 4.1. Evaluation of water usage modelling performance and comparison with other models We compared the ability of our hot water usage model to model hot water usage demand (di erentiated, semi-di erentiated and undi erentiated versions) against two prominent existing models for all 77 household water heaters. We evaluated the models' hourly and weekly volume modelling and then compared the error levels of the modelled pro les and the measured pro les. The hourly modelling error is the di erence between the modelled volume of water usage over the next hour and the measured volume of water usage over the same hour and is calculated as follows: emodeljh[n] =jVmeas[n]Vmodel [n]j (5) wherenrefers to the minute time sample and Vmeas[n] =n+60X nf[n] (6) The hourly modelling error was calculated using a moving window that calculates the hourly volume modelling error for each minute of the day. For a given EWH, we can compare the hourly modelling error of our model with the hourly modelling errors of the other models (MSM and ASHRAE) by comparing their box and whisker plots. The di erences between the resulting hourly modelling errors of one of our models, such as the di erentiated model, and other model, in this case ASHRAE, are calculated as follows: eresjh[n] =edi jh[n]eASHjh[n] (7) The weekly volume modelling is calculated by nding the di erence between the volumes of water used for each week between the measured and the other model's generated pro les, as follows: emodeljw[m] =jVmeas[m]Vmodel [m]j (8) wheremrefers to the week of a pro le and Vmeas[m] =(m+1)60247X m60247f[m] (9) The resulting weekly modelling error is calculated as follows: eresjw[m] =edi jw[m]eASHjw[m] (10) The EWH-speci c relative volume modelling error is the average volume modelling error of our model for a speci c EWH minus the average volume modelling error of the other model for the same heater. To compare the general modelling performance of our model (di erentiated, semi-di erentiated and undi erentiated data sets) against the general modelling performance of the other model for all 77 heaters, we plot the distribution 12 Table 3: Table showing the mean hourly volume modelling error (measured in liters) for each model and are di erentiated by day of the week. The last column shows the mean error of a full week. Model Mon Tue Wed Thu Fri Sat Sun Mean ASHRAE 5.9 6.0 6.1 5.9 5.8 5.7 5.9 5.9 MSM 6.2 5.8 6.2 5.8 5.7 6.0 6.2 6.0 undi 5.4 5.1 5.4 5.2 5.4 6.4 6.4 5.6 semidi 5.3 4.9 5.2 5.0 5.2 5.8 5.7 5.3 di 4.7 4.1 4.6 4.3 4.5 5.3 5.0 4.7 of the relative heater-speci c modelling error for all the heaters. The hourly and weekly heater-speci c relative modelling error for EWH ifor our model, such as the di erentiated model, and other models, such as ASHRAE, is calculated as follows: ereljh[i] = edi jh[i]eASHjh[i] (11) ereljw[i] = edi jw[i]eASHjw[i] (12) The results also compare the three versions of our model for the three di erent data sets used. The following notations are given for our model: di , the di erentiated data set; semidi , the semi-di erentiated data set; and undi , the undi erentiated data set. Nominal water pro les were generated for a heater with a light usage (EWH A) and one with a heavy usage (EWH B). Figures 4a and 4b show box and whisker plots of the hourly volume modelling errors (calculated using Equation 7) of the di erent models for EWH A and B respectively. Looking at the subtraction order of this equation, we see that a negative value indicates that our model had a smaller modelling error when compared to the measured data than the two other models did, and a positive value indicates that our models modelling error was larger. Figure 4a shows that our model's hourly modelling errors were mostly smaller than those of the ASHRAE model for the light pro le. Comparing our model to the MSM model, we see the that performance of our model improves as we move from the undi erentiated to the di erentiated version. The absence of a box for the MSM plots is because the ow is mostly zero during the day, a phenomenon captured in the measured data and both our and the MSM models, whereas the ASHRAE model has a water event for every hour. The outcome of this is that most hourly volume errors remain zero for both our and the MSM models. For the heavy pro le of EWH B in Figure 4b our model does not perform as well as the ASHRAE model. However, its performance improves as we move from the undi erentiated to the di erentiated version. Figures 4c and 4d show box and whisker plots of the weekly volume modelling errors (calculated using Equation 10) of the various models for EWH A and EWH B respectively. These gures also show that all three versions of our model have a smaller modelling errors than the other models in the majority of cases. We generated a weekly nominal simulated water pro le of 77 households to produce the results in this section. Table 3 shows the mean of the hourly volume modelling errors in litres for each model compared with those of the measured data for the seven days of the week and the mean of all the days. The mean errors for the ASHRAE and MSM models are 5 :9 and 6:0 L. Our model dramatically improves on these gures, from the undi erentiated version's 5 :6 L error, to the semi-di erentiated version's 5 :3 L error, to the di erentiated version's modest 4 :7 L error. The table not only shows that our model performs better; it also highlights the importance of di erenti- ating between days of the week to forecast water usages with only small errors. Figures 4e and 4f show box and whisker plots similar to those in Figure 4, but instead show the heater- speci c hourly and weekly volume modelling errors calculated according to Equations 11 and 12 respectively. The negative bias of each plot in both gures shows that our model will on average produce smaller modelling errors than the ASHRAE and MSM models. In Figure 4e, it is clear that the modelling errors of our model become even smaller than those of the ASHRAE and MSM models when we use the more di erentiated data sets. Figure 4f does not show any signi cant changes when we use a di erent data set for our model, showing that the weekly volume variations average out over the week. 13 Figure 5: Comparison of EWH-speci c mean daily energy modelling errors (Equation 14) for the nominal simulated hot water pro les of our model for all data sets and other existing models for 77 households. 4.2. Individual EWH energy usage modelling performance The energy pro les for all heaters were simulated using a validated thermal model of an EWH, and using both the measured hot water usage data and the simulated hot water usage events. The heater-speci c energy usage modelling error was determined by comparing the simulated energy usage when using the simulated hot water usage events to the simulated energy usage when using the measured hot water usage data. The daily energy usage modelling error (in kWh) for an individual EWH is calculated as follows: emodeljkWh[d] =jEmeas[d]Emodel [d]j (13) wheredrefers to the day in the pro le and Erefers to the total daily energy usage in kWh. We compared the energy modelling performance of our probabilistic model against the energy modelling performance of the other two models by comparing our average daily energy modelling error against their average daily energy modelling error for each individual EHW, and then plotting the distribution of the EWH-speci c relative daily energy modelling error over all 77 EWHs. The relative daily energy modelling error of your model relative to another model, e.g. the ASHRAE model, is calculated by taking the di erence between our average daily energy modelling error and their modelling average daily energy modelling error, as follows: eresjkWh[i] = edi jkWh[i]eASHjkWh[i] (14) whereiis the EWH index,  ereljkWh is our relative daily energy modelling error,  edi jkWh is the average daily energy modelling error of our probabilistic model using the di erentiated data set, and  eASHjkWhis the average daily energy modelling error of the ASHRAE model. The measured and simulated water pro les for all the heaters in autumn were simulated on an EWH model (Nel et al., 2016) to produce the energy pro le for each household. Figure 5 shows box and whisker plots comparing the daily modelling errors of the ASHRAE and MSM models with all three versions of our model model (calculated using Equation 14). The gure shows that our model will on average model the daily energy load 1kWh/day better than the other models, as shown by the negative median of each box and whisker plot, which is 17% of the median heater's 5.9 kWh/day. 4.3. Aggregated EWH energy usage modelling performance compared to Eskom load data Finally, we compared a normalised 24-hour energy pro le of our 77-household grid, using each heater's simulated water pro le, with the \notch test" from Eskom (the South African national electricity grid) (Forlee, 1998). The test considered only workdays in autumn, to match the data from Eskom. Figure 6 shows the normalised electricity demand over a 24-hour cycle for the measured data, comparing all the models as well as the results obtained from \notch test" for all 77 heaters. The ASHRAE model deviates the most from the measured pro le, performing worst at the morning peak, and has early morning 14 Figure 6: Normalised electrical demand plot over 24 hours for 77 EWH's for weekdays in autumn. The Eskom \notch test" electrical demand is represented by a bar plot (Forlee, 1998). demand spikes misaligned with the measured pro le. The MSM model and our model both model the early morning spike, but the MSM model overestimates it substantially. The MSM models' pro le generally follows the trend of the measured pro le, but again overestimates the demand in the period between the morning and evening peaks. Our model's pro le accurately follows the measured pro le, except for the evening peak where the load is slightly lower than the measured one. This could be because our sample has regional and external variations from the Eskom sample. The root mean squared (RMS) errors of the models' demand pro les are 0.10 for the ASHRAE model, 0.08 for the MSM model, and 0.04 for the di erentiated version of our model. Expressed as a percentage of the median heater, these are 16.9% for the ASHRAE model, 13.6% for the MSM model, and 6.8% for our di erentiated model. 5. Conclusion The probabilistic model we present in this paper statistically models the daily hot water usage pro le for individual electric water heaters (EWHs) based on historically measured ow rate data. This model can be used to model hot water demand and the resulting residential energy demand. We also present a hot water usage simulator that uses the probabilistic model to generate simulated hot water usage pro les ( ow rate versus time). Our model can generate high-resolution water pro les for speci c applications and is fully automated. It excels in its ability to characterise a household's water pro le, taking into consideration di erences between users and temporal variations such as the season of the year and the day of week. Our results con rm that the model produces simulated hot water pro les that closely match the measured data and are representative enough to be used in energy management strategies for modelling electric water heaters. Furthermore, the model's results improve on those of existing hot water usage models for representing the energy drawn from the grid. The hot water usage simulator can be used as a component of a larger EWH simulator to improve the eciency of energy systems such as water heaters and strategies such as demand-side management. The eciencies can be further improved if more measured water ow data is available to increase the accuracy of forecasting. The availability of more measured data could also provide enough information to t more 15 accurate probability density functions to the clustered water usages. The model's unique visualisation of the data o ers ideas that could be productive for further research in the eld. Acknowledgements The authors thank MTN South Africa for funding through grant S003061; the Water Research Commission (South Africa) for funding the water heater project through grant K1-7163, and Eskom for funding through the tertiary educational support programme.