Design Models for Power Flow Management of a Grid-Connected Solar Photovoltaic System with Energy Storage System

This paper provides models for managing and investigating the power flow of a grid-connected solar photovoltaic (PV) system with an energy storage system (ESS) supplying the residential load. This paper presents a combination of models in forecasting solar PV power, forecasting load power, and determining battery capacity of the ESS, to improve the overall quality of the power flow management of a grid-connected solar PV system. Big data tools were used to formulate the solar PV power forecasting model and load power forecasting model, in which real historical solar electricity data of actual solar homes in Australia were used to improve the quality of the forecasting models. In addition, the time-of-use electricity pricing was also considered in managing the power flow, to provide the minimum cost of electricity from the grid to the residential load. The output of this model presents the power flow profiles, including the solar PV power, battery power, grid power, and load power of weekend and weekday in a summer season. The battery state-of-charge of the ESS was also presented. Therefore, this model may help power system engineers to investigate the power flow of each system of a grid-connected solar PV system and help in the management decision for the improvement of the overall quality of the power management of the system.


Introduction
Renewable energy sources have been rapidly growing globally because of their advantages that minimized dependency on fossil fuels and reduced pollution and therefore provide a cost-effective, reliable, and secured system [1]. Among the renewable energy sources, the fastest-growing renewable energy sources globally are wind and solar energy as they are the most efficient sources [2]. According to Australian Renewable Energy Agency (ARENA), Australia, which has been considered to have the best solar energy sources in the world [3], has the highest average solar radiation. Therefore, more than two million Australian households have a solar photovoltaic (PV) system on their rooftop [3]. However, as solar energy depends on the amount of sunlight at a given time in a particular place, solar energy sources should be accurately be predicted to balance the fluctuating solar PV power generation to the load.
Different solar PV power forecasting models have been developed. Time series methods have been used which are highly dependent on historical data [4][5][6][7][8][9][10]. These include an autoregressive [4][5][6], artificial neural network (ANN) [7][8][9], support vector machine (SVM) [10], and Markov chain [11]. Different methods, which include learning machines, were also developed to improve solar PV power developed based on big data tools using real historical solar electricity data. These data were collected from actual solar homes in Australia for three years, and collected every 30 minutes to efficiently handle and manage the large amount of historical data in formulating these forecasting models. The battery capacity of the ESS was also determined based on these historical solar PV power data and load power data, considering the power supply availability. Considering the benefits of solar PV power and the electricity price, this paper considers that the residential load is first supplied by the solar PV system, then by the battery, and lastly by the grid. Using the models of each system of the grid-connected solar PV system, the power flow profiles of the solar PV system, grid, battery, and load of weekend and weekday of summer season in Australia were presented.
The remainder of the paper is organized as follows: the design models for forecasting solar PV power, forecasting load power, and determining battery capacity and managing the power flow of the grid-connected solar PV system are described in Section 2. A case study is presented in Section 3, to illustrate the effectiveness of the design models and to present the power flow profiles of each system of the grid-connected solar PV system. Finally, Section 4 concludes the paper with a summary of the findings.

Model Formulation
This paper develops a model in managing the power flow of a grid-connected solar PV system with ESS supplying residential load, considering time-of-use electricity pricing. In order to improve the power flow quality of the grid-connected solar PV system, this paper also presents three design models, which include forecasting solar PV power, forecasting load power, and determining battery capacity of the ESS. In addition, these forecasting models (i.e., solar PV power forecasting model and load power forecasting model) are formulated based on big data tools using real historical solar electricity data. The flowchart of the model formulation presented in this paper is illustrated in Figure  1. The historical solar electricity data collected from 300 solar homes from Ausgrid's electricity network area were used in this paper [33]. These solar electricity data were used in this paper to utilize actual data in formulating the forecasting models (i.e., solar PV power forecasting model and load power forecasting model), to improve the quality and the accuracy of the forecasting models. The solar electricity data includes half-hour data of the solar PV power generation, residential load consumption, and controlled residential load consumption, collected for three years from 1 July 2010 to 30 June 2013. The solar homes are in different locations in Australia and have different solar PV panel capacities, ranging from 1 kW to 9.99 kW. There are 808,590 solar electricity data, which include The historical solar electricity data collected from 300 solar homes from Ausgrid's electricity network area were used in this paper [33]. These solar electricity data were used in this paper to utilize actual data in formulating the forecasting models (i.e., solar PV power forecasting model and load power forecasting model), to improve the quality and the accuracy of the forecasting models. The solar electricity data includes half-hour data of the solar PV power generation, residential load consumption, and controlled residential load consumption, collected for three years from 1 July 2010 to Energies 2020, 13, 2137 4 of 14 30 June 2013. The solar homes are in different locations in Australia and have different solar PV panel capacities, ranging from 1 kW to 9.99 kW. There are 808,590 solar electricity data, which include 328,716 solar PV power generation data, 328,716 residential load consumption data, and 151,158 controlled residential load consumption data from 300 selected solar homes in Australia. Therefore, this paper used big data tools to efficiently handle and manage the necessary data from this large amount of solar electricity data.

Forecasting Solar PV Power
An accurate forecasting of solar PV power is important to improve the overall quality of the power flow of the grid-connected solar PV system. In order to provide an accurate solar PV power forecasting model, this paper used the historical solar PV power generation data collected from solar homes in Australia stated above. In this paper, one solar home in New South Wales, Australia with a solar PV panel capacity of 1.5 kW was chosen among the 300 solar homes. In order to efficiently handle and manage this large amount of solar electricity data, big data tools were used in formulating the solar PV power forecasting model.
In this paper, the formulation of the solar PV power forecasting model was developed using three steps (i.e., store, manage, and calculate), as shown in Figure 1. These steps were developed based on big data tools (i.e., Datastore and MapReduce), using MATLAB functions [34]. The first step is to store the necessary historical data (i.e., postal code, solar PV panel capacity, and solar PV power generation), which are collected from the historical data using the Datastore function of MATLAB to store these necessary data in an efficient manner. The second step is to manage the stored data using the MapReduce function of MATLAB. The solar home with a postal code of 2087 and solar PV panel capacity of 1.5 kW was collected from 300 solar homes, using the MapReduce function to access these specific data from a large amount of data. In addition, the solar PV power generation data were also grouped according to season (i.e., winter, spring, summer, and fall). This paper considered the solar PV power generation data of the month of January, February, and December, which are the months of the summer season in Australia. In this paper, the training data used in formulating the solar PV power forecasting model are the solar PV power generation data of the summer months from 2010 to 2013, except for the data of the month of February 2013, which are considered as the testing data. The last step in the formulation of the solar PV power forecasting model is to calculate the solar PV power using the historical solar PV power generation data shown in Figure 2. As depicted in Figure 2, the solar PV power was observed from 06:30 to 19:30. Therefore, the solar PV power was determined in this period for each 30 minutes. The solar PV power for each 30 minutes was assumed to be a random variable with an exponential probability distribution function (pdf) given [24,34]: where P PV is the solar PV power and λ is the exponential distribution parameter, which was determined based on the historical solar PV power generation for every 30 min from 06:30 to 19:30 shown in Figure 2. In order to determine the effectiveness of the solar PV power forecasting model in this paper, the mean relative error (MRE) was calculated. The MRE was used to show its practical impact as we divide the difference of the actual and forecast solar PV power by the total solar PV capacity of the solar home as: where P PVa is the actual solar PV power, P PVf is the forecast solar PV power determined using (1), n is the number of 30 min to be forecast from 06:30 to 19:30 (i.e., 27), and P t is the total solar PV panel capacity of the solar home (i.e., 1.5 kW).

Forecasting Load Power
Generating realistic load power is also important in managing the power flow of the gridconnected solar PV system. In order to provide a realistic load power, this paper also used the historical residential load consumption data collected from Ausgrid's electricity network [33]. The residential load consumption data from the chosen solar home with 1.5 kW solar PV panel capacity in formulating the solar PV power forecasting model was used in formulating the load power forecasting model. In order to efficiently handle the necessary residential load consumption data from the solar electricity data, big data tools were also used in this paper.
As depicted in Figure 1, the formulation of the load power forecasting model was developed using four steps (i.e., store, manage, process, and calculate). Big data tools using MATLAB functions [34], such as Datastore and MapReduce functions were also used in storing and managing the historical data in formulating the load power forecasting model. Similar to the first two steps in formulating solar PV power forecasting model, the first two steps in formulating load power forecasting model use big data tools (i.e., Datastore and MapReduce). The first step is to store the necessary historical data, which include postal code, solar PV panel capacity, and residential load consumption using the Datastore function of MATLAB. The second step is to manage the stored data using the MapReduce function of MATLAB, which also collects the historical data of the solar home with a postal code of 2087 and a solar PV panel capacity of 1.5 kW from the 300 solar homes. The second step also includes grouping the data according to season similar to that in the solar PV power forecasting model. The Australian residential load consumption data of the summer months from 2010 to 2013 were used as training data, except for February 2013, although February 2013 data were used as the testing data. The training data used in formulating the load power forecasting model in this paper is shown in Figure 3. The third step is to process these grouped data. These grouped data were further divided into weekend and weekday data, to determine the mean load power curve that would represent the residential load consumption of weekend and weekday. The mean load power that represents the residential load consumptions of weekend and weekday is shown in Figure 4. To represent the load power values around the mean load power curve, these values were also assumed to be random variables with an extreme value probability distribution function (pdf) given as where VL is the load power values, μ is the extreme value location parameter, and β is the extreme value scale parameter. These extreme value locations and scale parameters were determined based on the difference between the historical residential load consumption data and the mean load power curve for every 30 min of weekends and weekdays shown in Figures 3 and 4, respectively. The last step in

Forecasting Load Power
Generating realistic load power is also important in managing the power flow of the grid-connected solar PV system. In order to provide a realistic load power, this paper also used the historical residential load consumption data collected from Ausgrid's electricity network [33]. The residential load consumption data from the chosen solar home with 1.5 kW solar PV panel capacity in formulating the solar PV power forecasting model was used in formulating the load power forecasting model. In order to efficiently handle the necessary residential load consumption data from the solar electricity data, big data tools were also used in this paper.
As depicted in Figure 1, the formulation of the load power forecasting model was developed using four steps (i.e., store, manage, process, and calculate). Big data tools using MATLAB functions [34], such as Datastore and MapReduce functions were also used in storing and managing the historical data in formulating the load power forecasting model. Similar to the first two steps in formulating solar PV power forecasting model, the first two steps in formulating load power forecasting model use big data tools (i.e., Datastore and MapReduce). The first step is to store the necessary historical data, which include postal code, solar PV panel capacity, and residential load consumption using the Datastore function of MATLAB. The second step is to manage the stored data using the MapReduce function of MATLAB, which also collects the historical data of the solar home with a postal code of 2087 and a solar PV panel capacity of 1.5 kW from the 300 solar homes. The second step also includes grouping the data according to season similar to that in the solar PV power forecasting model. The Australian residential load consumption data of the summer months from 2010 to 2013 were used as training data, except for February 2013, although February 2013 data were used as the testing data. The training data used in formulating the load power forecasting model in this paper is shown in Figure 3. The third step is to process these grouped data. These grouped data were further divided into weekend and weekday data, to determine the mean load power curve that would represent the residential load consumption of weekend and weekday. The mean load power that represents the residential load consumptions of weekend and weekday is shown in Figure 4. To represent the load power values around the mean load power curve, these values were also assumed to be random variables with an extreme value probability distribution function (pdf) given as where V L is the load power values, µ is the extreme value location parameter, and β is the extreme value scale parameter. These extreme value locations and scale parameters were determined based on the difference between the historical residential load consumption data and the mean load power Energies 2020, 13, 2137 6 of 14 curve for every 30 min of weekends and weekdays shown in Figures 3 and 4, respectively. The last step in formulating the load power forecasting model is to calculate the load power using the mean load power and the load power values. The load power is calculated every 30 min from 00:30 to 24:00 as: where P L (t) is the load power at time t, M L (t) is the mean load power at time t shown in Figure 4, and V L (t) is the load power values at time t, which was randomly generated using (3). In order to verify the performance of the load power forecasting model, the mean absolute percentage error (MAPE) was calculated. The MAPE measures the size of the error in percentage term as: where P La is the actual load power, P Lf is the forecast load power determined using (4), and N is the number of 30 min to be forecast from 00:30 to 24:00 (i.e., 48).
Energies 2020, 13, x FOR PEER REVIEW 6 of 14 formulating the load power forecasting model is to calculate the load power using the mean load power and the load power values. The load power is calculated every 30 min from 00:30 to 24:00 as: where PL(t) is the load power at time t, ML(t) is the mean load power at time t shown in Figure 4, and VL(t) is the load power values at time t, which was randomly generated using (3). In order to verify the performance of the load power forecasting model, the mean absolute percentage error (MAPE) was calculated. The MAPE measures the size of the error in percentage term as: where PLa is the actual load power, PLf is the forecast load power determined using (4), and N is the number of 30 min to be forecast from 00:30 to 24:00 (i.e., 48).

Determining Battery Capacity
The battery capacity of the ESS of the grid-connected solar PV system was also determined in this paper, to avoid over-sizing or under-sizing of the battery capacity. In this paper, the battery capacity was determined based on the ESS availability assessment used in the previous study [24]. In this previous study [24], the availability of the solar PV system with ESS was considered in determining the battery capacity. In addition, this previous paper [24] considered generated random values for both solar PV power and load power using the Monte Carlo method. However, this paper used the historical solar PV power generation data and residential load consumption data of the formulating the load power forecasting model is to calculate the load power using the mean load power and the load power values. The load power is calculated every 30 min from 00:30 to 24:00 as: where PL(t) is the load power at time t, ML(t) is the mean load power at time t shown in Figure 4, and VL(t) is the load power values at time t, which was randomly generated using (3). In order to verify the performance of the load power forecasting model, the mean absolute percentage error (MAPE) was calculated. The MAPE measures the size of the error in percentage term as: where PLa is the actual load power, PLf is the forecast load power determined using (4), and N is the number of 30 min to be forecast from 00:30 to 24:00 (i.e., 48).

Determining Battery Capacity
The battery capacity of the ESS of the grid-connected solar PV system was also determined in this paper, to avoid over-sizing or under-sizing of the battery capacity. In this paper, the battery capacity was determined based on the ESS availability assessment used in the previous study [24]. In this previous study [24], the availability of the solar PV system with ESS was considered in determining the battery capacity. In addition, this previous paper [24] considered generated random values for both solar PV power and load power using the Monte Carlo method. However, this paper used the historical solar PV power generation data and residential load consumption data of the

Determining Battery Capacity
The battery capacity of the ESS of the grid-connected solar PV system was also determined in this paper, to avoid over-sizing or under-sizing of the battery capacity. In this paper, the battery capacity was determined based on the ESS availability assessment used in the previous study [24]. In this previous study [24], the availability of the solar PV system with ESS was considered in determining Energies 2020, 13, 2137 7 of 14 the battery capacity. In addition, this previous paper [24] considered generated random values for both solar PV power and load power using the Monte Carlo method. However, this paper used the historical solar PV power generation data and residential load consumption data of the actual solar home with 1.5 kW solar PV panel capacity. In this paper, the historical solar PV power generation data shown in Figure 2 and the residential load consumption data shown in Figure 3 were used to determine the battery capacity of the ESS. Using the methodology used in the previous study [24], this paper was assumed to have the power availability of two nines, which is the probability of the solar PV generation system to the load and to charge the ESS. In order to obtain two nines of availability, the power transfer at each time step and the number of energy states were varied, as stated in a previous study [24]. The battery capacity of the ESS is calculated as [24]: where N is the number of energy states, T is the time step, and ∆ is the power transfer at each time step. These parameters and the steps in determining (6) were further explained in [24]. The battery capacity of the ESS was determined by using (6), based on the Markov-chain-based energy storage model described in [24]. The transition probability of the Markov-chain-based battery state transition diagram was determined by using the difference of the historical solar PV power generation data and the residential load consumption data in this paper. For the calculation of the transition probability matrix, the power transfer at each time step which is power involved in each transition and the number of energy states in the Markov-chain-based battery state transition diagram were varied to determine the required power availability. The power availability, of which the target values are two nines in this paper, can be calculated by using the transition probability matrix shown in (7). After varying the power transfer at each time step and the number of energy states, 500 W power transfer and eight energy states were obtained to have the target two nines power availability (i.e., 0.9907). Then, the battery capacity of the ESS was determined by using these parameters (i.e., power transfer at each time step and number of states) in (6). Therefore, this paper used a 1.75-kWh battery capacity using a 0.5-time step (i.e., 30-minute interval), supplying the solar home with the maximum battery charged and discharged power of 500 W. In addition, the battery charging and discharging power profile of the ESS was also considered in this paper. The battery charging and discharging power profile, based on the state-of-charge (SOC) used in this paper, is depicted in Figure 5.

Managing Power Flow
The objective of this paper is to determine the power flow of the grid-connected solar PV system, with ESS supplying a residential load. It is important to manage the power flow of a grid-connected solar PV system, to maximize the usage of the solar PV power and to provide the minimum cost of electricity from the grid to the residential load.
In this paper, the power flow is determined for weekends and weekdays of the summer season in Australia. The methods in determining the power flow of the grid-connected solar PV system are divided into periods for weekend and weekday, based on the residential time-of-use electricity pricing in Australia [33]. In addition, the following parameters were assumed in this paper:  The method in determining the power flow of the grid-connected solar PV system during weekend is divided into three different periods (i.e., without solar PV power-off-peak (00:30 to 06:00 and 22:00 to 24:00), without solar PV power-shoulder (20:00 to 21:30), and with solar PV power (06:30 to 19:30)). For weekday, the method in determining the power flow of the grid-connected solar PV system is divided into four periods, since there is a peak period during weekday. These periods include without solar PV power-off-peak (i.e., 00:30 to 06:00 and 22:00 to 24:00), without solar PV power-shoulder (i.e., 20:00 to 21:30), with solar PV power-shoulder (i.e., 06:30 to 13:30), and with solar PV power-peak (i.e., 14:00 to 19:30).
In the period when there is no available solar PV power during the off-peak period (i.e., 00:30 to 06:00 and 22:00 to 24:00) for weekend and weekday, it was assumed that only the grid supplies the residential load, since the electricity price in this period is low. In addition, since the electricity price is low, the grid is also used to charge the battery when its SOC is less than its maximum battery capacity (i.e., 0.9). Therefore, when the battery SOC is less than 0.9, the grid power is the sum of the load power and battery power. Moreover, the grid charges the battery using the discretized power of the battery charging and discharging power profile provided in Figure 5.
For the period when there is no available solar PV power during the shoulder period (i.e., 20:00 to 21:30) for weekend and weekday, the battery and the grid were used to supply the residential load. When the battery SOC is greater than its minimum battery capacity (i.e., 0.2), the battery supplies the residential load. When the available battery is not enough to supply the residential load, the grid also supplies the residential load. In addition, when the load power is greater than the maximum battery charging and discharging power (i.e., 500 W), the battery discharges using the discretized power of the battery charging and discharging power profile in Figure 5 and the grid supplies the shortage power to the load. Furthermore, the battery is not charged in this period since there is a higher electricity price in this period.
In the period when there is available solar PV power during the shoulder period (i.e., 06:30 to 19:30) at the weekend and during the peak period (i.e., 14:00 to 19:30) on weekdays, two scenarios (i.e., with excess solar PV power and with shortage solar PV power) were assumed. In the first scenario (i.e., with excess solar PV power), there is an excess solar PV power after the solar PV system supply power to the load. Therefore, the solar PV power can be used to charge the battery and can be delivered to the grid. When the battery SOC is less than its maximum (i.e., 0.9), the excess solar PV power is used to charge the battery. In addition, when the excess solar PV power is greater than Energies 2020, 13, 2137 9 of 14 the maximum charging and discharging power of the battery, the excess solar PV power is used to charge the battery using the discretized battery charging and discharging profile provided in Figure 5. Moreover, when there is still excess solar PV power after charging the battery, the excess solar PV power is delivered to the grid. Furthermore, in the case that the battery SOC is 0.9, all the excess solar PV power after supplying to the load will be delivered to the grid. While, in the second scenario (i.e., with shortage solar PV power), the solar PV power is not enough to supply the needed load power. In this case, the battery and the grid supply the shortage power. When the battery SOC is greater than its minimum (i.e., 0.2), the battery is discharged to supply the shortage power. When the shortage power is greater than the maximum battery charging and discharging power (i.e., 500 W), the battery discharges using the discretized power of the battery charging and discharging power profile shown in Figure 5. When the available battery capacity is not enough to supply for the shortage power, the grid is used to supply the shortage power. Furthermore, when the battery SOC is 0.2, only the grid supply for the shortage power.
Meanwhile, in determining the power flow when there is available solar PV power during the shoulder period (i.e., 06:30 to 13:30) in weekdays, two scenarios (i.e., with excess solar PV power and with shortage solar PV power) were also assumed. In the first scenario (i.e., with excess solar PV power), the power flow is determined to be the same as in the scenario with excess solar PV power when there is available solar PV power during the shoulder period (i.e., 06:30 to 19:30) in weekend and during peak period (i.e., 14:00 to 19:30) in the weekday stated above. However, in the second scenario when there is a shortage of solar PV power, only the grid supplies the shortage power even if the battery SOC is greater than its minimum (i.e., 0.2). In this second scenario, the battery is not used to supply the shortage power in order to maintain its capacity, which will be used to supply the residential load during the peak period in weekday (i.e., 14:00 to 19:30), in order for the amount of power needed from the grid to be reduced and therefore to minimize the electricity cost.
In addition, this paper assumed that the battery power is positive when it is discharged and is negative when it is charged for weekend and weekday, since the main function of the battery is to supply energy. Moreover, the grid power is also assumed to be positive when it supplies power and assumed as negative when it accepts power from the solar PV system. As the result, the solar PV power profile, battery power profile, grid power profile, and load power profile of a forecast day are the outputs of this model. Additionally, the SOC profile of the battery is also presented to show the charging and discharging performance of the battery throughout the forecast day.

Numerical Examples
This section provides numerical examples to present the solar PV power profiles and load power profiles using the proposed forecasting models and to present the power flow profiles of each system of the grid-connected solar PV system using the proposed approach as described in Section 2. In order to show the effectiveness of these models, a particular weekend and weekday in February 2013 were forecast. In this paper, 24 February 2013 (i.e., weekend) and 25 February 2013 (i.e., weekday) were chosen as the forecast days, to show the power flow profiles of each system in weekend and weekday of summer season in Australia.
The solar PV power profiles of the forecast days were shown in Figure 6. These solar PV power profiles show the actual and forecast solar PV power profiles of the forecast days to show the comparison of these profiles and prove the effectiveness of the proposed solar PV power forecasting model. As depicted in Figure 6, the solar PV power is only available from 06:30 to 19:30, which is same as the historical solar PV generation data shown in Figure 2. The solar PV power profile of 24 February 2013 (i.e., weekend) is shown in Figure 6a, while the solar PV power profile of 25 February 2013 (i.e., weekday) is shown in Figure 6b. The maximum solar PV power of 1.28 kW at 12:30 and 1.24 kW at 13:30 were observed for weekend and weekday, respectively. To verify the performance of solar PV power forecasting model, the MREs for each forecast day were calculated as listed in Table 1. Based on the MRE result as shown in Table 1, relatively accurate forecast results of the solar  The load power profiles were also determined to accurately represent the load power of a residential house during weekend and weekday in this paper. The load power profiles of the forecast days were shown in Figure 7, which depicts the actual and forecast load power profiles of the forecast days to compare these profiles and illustrate the effectiveness of the proposed load power forecasting model. The load power is forecast from 00:30 to 24:00 for each forecast day. The load power profile of the weekend (i.e., 24 February 2013) is shown in Figure 7a, while the load power profile of weekday (i.e., 25 February 2013) is shown in Figure 7b. As observed in Figure 7, the load power of the weekend is higher than that of the weekday, which was also observed from the mean load power shown in Figure 4. In addition, the load power profiles vary every 30 minutes for weekend and weekday, as shown in Figure 7. The MAPE results for each forecast day were calculated as listed in Table 1, to verify the performance of the load power forecasting model. The MAPE results listed in Table 1 show higher percentage error for forecasting load power. This is because the residential load consumption varies everyday depending on the owners' activities. However, this paper used actual residential load consumption data of actual solar homes in order to provide realistic load patterns.  Figure 8 shows the power flow profiles of the grid-connected solar PV system, which include the forecast solar PV power, the forecast load power, the grid power, the battery charging and  The load power profiles were also determined to accurately represent the load power of a residential house during weekend and weekday in this paper. The load power profiles of the forecast days were shown in Figure 7, which depicts the actual and forecast load power profiles of the forecast days to compare these profiles and illustrate the effectiveness of the proposed load power forecasting model. The load power is forecast from 00:30 to 24:00 for each forecast day. The load power profile of the weekend (i.e., 24 February 2013) is shown in Figure 7a, while the load power profile of weekday (i.e., 25 February 2013) is shown in Figure 7b. As observed in Figure 7, the load power of the weekend is higher than that of the weekday, which was also observed from the mean load power shown in Figure 4. In addition, the load power profiles vary every 30 minutes for weekend and weekday, as shown in Figure 7. The MAPE results for each forecast day were calculated as listed in Table 1, to verify the performance of the load power forecasting model. The MAPE results listed in Table 1 show higher percentage error for forecasting load power. This is because the residential load consumption varies everyday depending on the owners' activities. However, this paper used actual residential load consumption data of actual solar homes in order to provide realistic load patterns. Figure 8 shows the power flow profiles of the grid-connected solar PV system, which include the forecast solar PV power, the forecast load power, the grid power, the battery charging and discharging power, and the SOC charging and discharging profiles of the forecast days. Figure 8a shows the power flow of each element of the grid-connected solar PV system using the forecast solar PV power profile and forecast load power profile of 24 February 2013 (i.e., weekend) while Figure 8b shows the power flow of each element of the grid-connected solar PV system using the forecast solar PV power profile and forecast load power profile of 25 February 2013 (i.e., weekday). Figure 8a shows the power flow profiles of each system in the grid-connected solar PV system of the weekend. Since it is off-peak from 00:30 to 06:00 and from 22:00 to 24:00, the grid power profile is high from 00:30 to 03:00 and from 22:00 to 24:00, because the grid is used to supply the load and is used to charge the battery in these time ranges. In addition, the grid power is negative at 12:30, 13:30, and 14:00, because there is excess solar PV power after the solar PV power supplies the load and charges the battery. The battery power profile is negative when it is charged by the grid at the off-peak period (i.e., 00:30 to 06:00 and 22:00 to 24:00). In addition, the battery power varies from positive (i.e., when it supplies the load when there is a shortage of solar PV power at time range 6:30 to 19:30 and when there is no available solar PV power at peak period (i.e., 20:00 to 21:30)) to negative (i.e., when it is charged using the excess solar PV power from 6:30 to 19:30). Moreover, the battery power is negative from 00:30 to 03:00 and from 22:00 to 24:00, because the battery is being charged by the grid at these time periods. The battery charging and discharging power also follows the battery charging and discharging profile, with the maximum battery power of 500 W. The charging and discharging SOC profile are also shown, which varies from minimum to maximum battery SOC of 0.2 and 0.9, respectively. It is observed that the battery SOC varies more during the period when there is available solar PV power, since the battery can be charged and discharged during this period. The load power profiles were also determined to accurately represent the load power of a residential house during weekend and weekday in this paper. The load power profiles of the forecast days were shown in Figure 7, which depicts the actual and forecast load power profiles of the forecast days to compare these profiles and illustrate the effectiveness of the proposed load power forecasting model. The load power is forecast from 00:30 to 24:00 for each forecast day. The load power profile of the weekend (i.e., 24 February 2013) is shown in Figure 7a, while the load power profile of weekday (i.e., 25 February 2013) is shown in Figure 7b. As observed in Figure 7, the load power of the weekend is higher than that of the weekday, which was also observed from the mean load power shown in Figure 4. In addition, the load power profiles vary every 30 minutes for weekend and weekday, as shown in Figure 7. The MAPE results for each forecast day were calculated as listed in Table 1, to verify the performance of the load power forecasting model. The MAPE results listed in Table 1 show higher percentage error for forecasting load power. This is because the residential load consumption varies everyday depending on the owners' activities. However, this paper used actual residential load consumption data of actual solar homes in order to provide realistic load patterns.  Figure 8 shows the power flow profiles of the grid-connected solar PV system, which include the forecast solar PV power, the forecast load power, the grid power, the battery charging and discharging power, and the SOC charging and discharging profiles of the forecast days. Figure 8a shows the power flow of each element of the grid-connected solar PV system using the forecast solar PV power profile and forecast load power profile of 24 February 2013 (i.e., weekend) while Figure 8b shows the power flow of each element of the grid-connected solar PV system using the forecast solar PV power profile and forecast load power profile of 25 February 2013 (i.e., weekday).  Figure 8a shows the power flow profiles of each system in the grid-connected solar PV system of the weekend. Since it is off-peak from 00:30 to 06:00 and from 22:00 to 24:00, the grid power profile is high from 00:30 to 03:00 and from 22:00 to 24:00, because the grid is used to supply the load and is used to charge the battery in these time ranges. In addition, the grid power is negative at 12:30, 13:30, and 14:00, because there is excess solar PV power after the solar PV power supplies the load and charges the battery. The battery power profile is negative when it is charged by the grid at the offpeak period (i.e., 00:30 to 06:00 and 22:00 to 24:00). In addition, the battery power varies from positive (i.e., when it supplies the load when there is a shortage of solar PV power at time range 6:30 to 19:30 and when there is no available solar PV power at peak period (i.e., 20:00 to 21:30)) to negative (i.e., when it is charged using the excess solar PV power from 6:30 to 19:30). Moreover, the battery power is negative from 00:30 to 03:00 and from 22:00 to 24:00, because the battery is being charged by the grid at these time periods. The battery charging and discharging power also follows the battery charging and discharging profile, with the maximum battery power of 500 W. The charging and discharging SOC profile are also shown, which varies from minimum to maximum battery SOC of 0.2 and 0.9, respectively. It is observed that the battery SOC varies more during the period when there is available solar PV power, since the battery can be charged and discharged during this period.
The power flow profiles of the grid-connected solar PV system of the weekday are shown in The power flow profiles of the grid-connected solar PV system of the weekday are shown in Figure 8b. Same as in weekend, the grid power supplies the load and charges the battery during off-peak periods (i.e., 00:30 to 06:00 and 22:00 to 24:00). However, the initial SOC in 25 February 2013 is the available SOC at the end of 24 February 2013, instead of 0.2. Since the battery is charged during the off-peak period in 24 February 2013 (i.e., 22:00 to 24:00), the battery SOC reaches 0.7 and is only charged in 25 February 2013 from 00:30 to 01:00, since it already reaches the maximum battery SOC (i.e., 0.9). Since there is a peak period in weekdays, the period when there is available solar PV power is further divided into two periods (i.e., shoulder and peak). As depicted in Figure 8b, the battery is not used to supply the load, even though its SOC is at maximum from 06:30 to 13:30, unlike on the weekend, where the battery is used to supply the load, due to the shortage of solar PV power. On weekdays, the shortage power in this period (i.e., 06:30 to 13:30) is provided only by the grid. While during peak period (i.e., 14:00 to 19:30), since the battery is in its maximum capacity, the battery is used to supply the load which can minimize the electricity needed from the grid during this peak period. Similar to that of the weekend, the grid is positive when it supplies power and negative when it accepts power. In addition, the battery power is also positive when it discharges and negative when it charges, which follows the battery charging and discharging profile with a maximum battery power of 500 W. The charging and discharging SOC profile are also shown, which varies from minimum to maximum battery SOC. As observed in Figure 8, the battery SOC profile of weekdays does not vary much compared to that of the weekend.
From the output power flow profiles of the proposed approach, the overall quality of the power flow management of the grid-connected solar PV system was improved considering the time-of-use electricity pricing, and therefore minimize the electricity cost. These results will help power system engineers to investigate the power flow profiles of the solar PV system, grid, battery, and load in the grid-connected solar PV system. In addition, this may also help in management decision for the planning and operation of the grid-connected solar PV system with ESS, in order to balance the solar PV power generation and the residential load consumption in the system.

Conclusions
This paper presented models in managing the power flow of each system of the grid-connected solar PV system with ESS. In order to improve the overall quality of the power flow management of the grid-connected solar PV system, this paper developed three design models, which include forecasting solar PV power and forecasting load power based on historical solar electricity data of an actual solar home in Australia. The historical solar PV power generation data and historical residential load consumption data of the summer season were used to develop and improve the quality of the solar PV power forecasting model and load power forecasting model, respectively. Big data tools were used to efficiently handle and manage these data from large amount of data sets. Moreover, the battery capacity of the ESS was also determined based on these historical solar PV power generation data and residential load consumption data, in order to avoid the over-sizing and under-sizing of the battery capacity of the ESS.
In order to present the effectiveness of the proposed models, the solar PV power profiles and load power profiles were forecast for the weekends and weekdays of the summer season in Australia. Furthermore, the power flow profiles of each system of the grid-connected solar PV system of weekend and weekday of summer season were presented as outputs of the proposed approach. The solar PV power profiles of weekday and weekend were presented using the proposed solar PV power forecasting model. The MRE results for each forecast day were presented to verify the performance of the proposed solar PV power forecasting model. A prediction accuracy of less than 10% was obtained using the proposed solar PV power forecasting model. In addition, the load power profiles of weekend and weekday in the same forecast days were also presented. The residential load power in weekend is observed to be higher than that of in weekday. The MAPE results for each forecast day were presented to verify the performance of the proposed load power forecasting model. Using the results of these forecasting models, the overall quality of the grid-connected solar PV system may be improved. Furthermore, the power flow profiles of each system of the grid-connected solar PV system for weekend and weekday were presented. These profiles include solar PV power profiles, load power profiles, grid power profiles, battery power profiles, and the SOC profiles of the battery of the ESS, considering the time-of-use electricity pricing to minimize the electricity cost.
From the output of the proposed models and methods in managing the power flow of the grid-connected solar PV system, these results may help power system engineers in planning and operation of the grid-connected solar PV system with ESS, in order to balance the power generation and the residential load consumption in the system, minimizing the electricity cost from the grid.