Designing Solar Power Purchase Agreement of Rooftop PVs with Battery Energy Storage Systems under the Behind-the-Meter Scheme

: With a signiﬁcant growth of rooftop photovoltaic systems (PVs) with battery energy storage systems (BESS) under the behind-the-meter scheme (BTMS), the solar power purchase agreement (SPPA) has been developed into one of the most attractive models. The SPPA is a scheme where the investors propose to directly sell electricity from rooftop PVs to the customers. The proposed rates are typically performed in terms of the discount rates on the time-of-use (TOU) tari ﬀ with demand charges. The operation modes of the BESS should also be designed in accordance with the proposed rates. Therefore, this paper proposes a methodology to design the discount rates and operation modes of the BESS which will minimize the electricity charges of the customers while maintaining the revenue of the investors under the SPPA and BTMS. The reverse power ﬂow is considered as additional revenue to the investors. This paper also implements the proposed methodology with tari ﬀ structure in Thailand. The result showed that the installed capacity of rooftop PVs and battery capacity directly a ﬀ ect the discount rates and operation modes of the BESS. The rate of excess energy also has a signiﬁcant impact on the discount rates but not a ﬀ ect the operation modes.


Introduction
With a significant growth of rooftop photovoltaic systems (PVs) under the behind-the-meter scheme (BTMS), several investors have adopted and developed many business models of rooftop PVs [1,2]. The business models can be categorized into four groups of (1) community-owned solar; (2) solar power purchase agreement (SPPA); (3) solar leasing agreement; and (4) roof rental agreement [3]. The SPPA is one of the most attractive models where the investors act as a third party to directly sell electricity from their rooftop PVs to the customers at a lower rate than the utility's retail rate [4,5]. The proposed rates of the SPPA are generally divided into the two options of a fixed rate and a discount on the utility's retail rate [6]. The discount rate option is more practical and convenient for applying with a time-of-use (TOU) tariff with demand charges, which was considered in this paper. The customers under the SPPA can reduce their electricity charges without any performance risk, capital investment, or operating expenses. The challenge for all investors is the competitive discount rates on the TOU tariff with demand charges that can propose to the customers. The benefit to the customers and investors will increase if the reverse power flow injected to the utility's grid is available.
To enhance the capability of rooftop PVs, the implementation of battery energy storage systems (BESS) with rooftop PVs has widely expanded in various applications and evolved into the trendy topics [7]. One of the main applications for the customers is the electricity charge saving which includes retail electric energy time shift and demand charge management [8]. However, the major concern point of the combination between rooftop PVs and BESS is the economic feasibility. The design of the discount rates and operation of the BESS should be carefully investigated by considering the benefit to the customers and a return of the investors.
The relevant studies of rooftop PVs with BESS in this paper were classified into two main categories: (1) Techno-economic analysis and (2) Operation optimization model. For the techno-economic analysis, many papers assessed impact of rooftop PVs under the BTMS on electricity charge saving [9][10][11][12]. Several studies evaluated an economic analysis of rooftop PVs with BESS by applying the discounted cash flow, net-present value (NPV), return on investment, and levelized cost of energy [13,14]. Furthermore, an economic analysis of the BESS under the BTMS with an electricity charge discount policy has been proposed [15], as well as some analysis of the demand charge reduction [16,17]. However, the studies on the SPPA and solar leasing agreement are limited. An economic analysis of the SPPA and solar leasing agreement were proposed using the net present value (NPV) [18], while the algorithm for determining the optimal lease payment was proposed by considering the benefit to the customers and investors [19].
For an operation optimization model, many studies have proposed a methodology to operate rooftop PVs with BESS under the BTMS for electricity charge saving and cost optimization. A methodology to control the BESS has been proposed using a genetic algorithm (GA) for minimizing electricity charges [20,21] and a notable concept of mode-based operation was proposed by applying dynamic programming (DP) [22,23]. Another efficient methodology was proposed by applying linear programming (LP) and quadratic programming [24][25][26][27]. In addition, several studies proposed a methodology to simultaneously determine battery capacity and the operation of rooftop PVs with BESS. The cost minimization concept was applied to investigate the battery capacity and operation of rooftop PVs and BESS under the BTMS with various algorithms, such as GA and a teaching-learning-based optimization algorithm [28,29]. Some studies have applied a similar concept to that for electric vehicle charging stations to determine the size and operation of rooftop PVs and BESS [30,31]. Besides, some study on distributed generation (DG) investment planning proposed a useful methodology which can be applied to the SPPA. The proposed cost optimization model was developed to maximize the total profit gained by the utility while maintaining the investment attractive for each DG investor [32].
In the literature, most papers relevant to techno-economic analysis and operation optimization model have only concentrated on the rooftop PVs with BESS under the BTMS with various algorithms. Although these methodologies were efficient and convenient for ascertaining the economic feasibility of rooftop PVs with BESS under the BTMS, studies focusing on the SPPA are limited with scant details. The methodology for designing the SPPA with the additional benefit from reverse power flow has also not ever been reported. In addition, the studies on the SPPA should not only focus on the minimization of the electricity cost of the customers, but also consider the revenue of the investors to ensure its long-term viability to both partners. Therefore, this paper proposes a methodology to design the SPPA for rooftop PVs with BESS under the BTMS. The discount rates on the TOU tariff with demand charges were implemented. The reverse power flow from rooftop PVs with BESS to utility's grid was available and considered as the additional revenue of the investors. With the proposed methodology, the investors can simultaneously design the maximum proposed discount rates to the customers and the operation modes of the BESS. The objective was to minimize the electricity charges of the customers, while maintaining the target internal rate of return (IRR) of the investors under the SPPA and the BTMS. The results from the proposed methodology will be useful for the investors to evaluate the economic feasibility and make an investment decision on the project. The proposed methodology can be used as a criterion for adding the profit margin of their project. The two main contributions of this paper are as follows: (1) A novel optimization model for designing SPPA discount rates on TOU tariff with demand charges and operation modes of the BESS for rooftop PVs with BESS under the BTMS. (2) Implementation case studies of the proposed methodology with the tariff structure in Thailand to evaluate the sensitivity analysis of the installed capacity of rooftop PVs, battery capacity, and rate of excess energy.

Background Knowledge
Four necessary principles (battery energy storage systems, rooftop PVs with BESS, TOU tariff with demand charges and the behind-the-meter scheme) are applied in this paper. A brief explanation of these principles is as follows.

Battery Energy Storage Systems
With a lithium-ion battery module, the BESS can typically be modeled and characterized by the following parameters [25,[33][34][35]: 2.1.1. Battery Capacity Battery capacity is classified into energy capacity in kWh and power capacity in kW. The rated energy and power capacity are presented by considering the roundtrip efficiency (η rt ) and battery bi-directional inverter efficiency (η bi-inverter ), as shown in Equations (1) and (2):

Charged and Discharged Power
The discharged and charged power from the BESS are defined to be positive and negative, respectively. The amount of charged and discharged power typically depends on the stored energy of battery, which can be determined from Equation (3). By applying the rated power capacity, the limits of charged and discharged power can be determined from Equations (4) and (5): P limit bess, dis (t) =L(t)·P nom (4)

State of Charge
State of charge (σ(t)) is expressed the amount of stored energy in battery, as shown in Equation (6). By applying with the boundary of the state of charge and battery degradation coefficient, the lower and upper limits of stored energy in the battery were determined from Equation (7). By applying Equations (3) and (7), the upper energy limits and lower energy limits were determined from Equations (8) and (9), respectively: Energies 2020, 13, 4438 4 of 18

Lifetime of Battery
Lifetime of battery is typically subjected to the degradation, which can be classified into self-degradation and operating degradation. For the self-degradation, the BESS constantly degrades itself on a time-based characteristic without any relation to the operation. For the operating degradation, in this paper it is the linearly expressed lifetime of the battery in terms of cycle aging. The number of battery cycle count and the operating degradation coefficient were determined from Equations (10) and (11), respectively, and as a result, the battery degradation coefficient was determined from Equation (12):

Rooftop PVs with BESS
To produce power at time t, rooftop PVs convert DC power from the PV module to AC power using a PV inverter. The rooftop PVs, BESS, and load were integrated with AC coupling systems [36]. Accordingly, P pv (t), P g (t), P l (t), and P bess (t) are subject to the power balance equation, as shown in Equation (13):

TOU Tariff with Demand Charges
Time-of-Use (TOU) tariff with demand charges, which consists of on-peak energy charges, off-peak energy charges and demand charges, was applied in this paper, as shown in Equations (14)- (17). As a working example, this paper implemented Thailand's electricity tariff structure for large general service load [37]. The on-peak period is only from 9:00 a.m. to 10:00 p.m. on Workdays (Monday-Friday). The remaining time is the off-peak period.

Behind-the-Meter Scheme
Behind-the-meter scheme (BTMS) is a scheme where the output power from rooftop PVs directly supplies to load behind the utility's meter. In case that output power from the rooftop PVs is higher than the load and the reverse power flow is available, an excess energy injected to the grid will be valued as the additional benefit [38][39][40]. The benefit from the excess energy is typically performed in Energies 2020, 13, 4438 5 of 18 terms of electricity charge compensation. The rate of excess energy injected to the grid can be perform in terms of utility's retail rate, as shown in Equations (18) and (19):

Modeling of Cost and Revenue
To evaluate the economic feasibility, the modeling of the total project cost (TPC) and revenue from the SPPA is presented in this section. Note that the currency exchange rate in this paper was assumed to be 30 THB/USD.

Total Project Cost
The TPC was formulated by categorizing into the total cost (TC) of the rooftop PVs and the BESS [35,36,41]. The TC of each component consists of the total investment cost (TIC) and the total operation cost (TOC). The TOC in each year (y) was assumed to be a percentage of the TIC, as expressed in c op . For rooftop PVs, the TC can be determined from Equation (20). For the BESS, the TIC is divided into energy installation cost and power installation cost. The TC of the BESS can be determined from Equation (21):

Solar Power Purchase Agreement
The SPPA is a power purchase agreement, where the investors invest, install, and operate rooftop PVs on the customers' site. The rooftop PVs directly produce and supply electricity to the customers without having to pass the utility's infrastructure [4,6]. Under this scheme, the investors offer an electricity rate that is lower than the utility's retail rate to the customers for a specified number of years. The investors must take responsibility for the operation and maintenance of the rooftop PVs during the period of the SPPA. In addition, at the end of the SPPA, the ownership of rooftop PVs can be transferred to the customers in some cases, depending on the agreement. There are two common options for the proposed electricity rates. The first option is a fixed rate with an escalation over the contract period, while the other option is a discount on the utility's retail rate. The second option is practically more favorable for the customer to easily express the electricity charge saving under the TOU tariff. Therefore, the modeling of the SPPA in this paper was formulated by applying the discount rate options, as shown in Equations (22)- (24). The discount rates are classified into three variables: on-peak discount rate (α 1 ), off-peak discount rate (α 2 ), and demand charge discount rate (β 1 ).

Proposed Methodology
This section consists of the proposed methodology for designing operation modes of the BESS, the proposed modeling of the SPPA and the discount rate optimization. In Section 4.1, the proposed Energies 2020, 13, 4438 6 of 18 mode-based operation of the BESS under the BTMS was proposed. The SPPA of rooftop PVs with BESS was formulated by applying discount rates on TOU tariff with demand charges under the BTMS in Section 4.2. The methodology to design the optimal discount rates and operation modes of the BESS was presented by using genetic algorithm optimization in Section 4.3. The schematic diagram of the SPPA is shown in Figure 1. The reverse power flow from rooftop PVs with BESS was available and considered as the additional revenue to the investors, as shown in Figure 2.

Proposed Methodology
This section consists of the proposed methodology for designing operation modes of the BESS, the proposed modeling of the SPPA and the discount rate optimization. In Section 4.1, the proposed mode-based operation of the BESS under the BTMS was proposed. The SPPA of rooftop PVs with BESS was formulated by applying discount rates on TOU tariff with demand charges under the BTMS in Section 4.2. The methodology to design the optimal discount rates and operation modes of the BESS was presented by using genetic algorithm optimization in Section 4.3. The schematic diagram of the SPPA is shown in Figure 1. The reverse power flow from rooftop PVs with BESS was available and considered as the additional revenue to the investors, as shown in Figure 2.

Operation Modes of Battery Energy Storage Systems
The operation principle of the BESS consists of the two main concepts of the operation (i) modes and (ii) power. Operation modes of the BESS are typically classified into the three modes of charging, discharging, and idling, and K(t) can be applied to represent each mode, as shown in Equation (25). For the operation power, the charged and discharged power from the BESS can be divided into two terms of (i) load and (ii) the utility's grid.

Proposed Methodology
This section consists of the proposed methodology for designing operation modes of the BESS, the proposed modeling of the SPPA and the discount rate optimization. In Section 4.1, the proposed mode-based operation of the BESS under the BTMS was proposed. The SPPA of rooftop PVs with BESS was formulated by applying discount rates on TOU tariff with demand charges under the BTMS in Section 4.2. The methodology to design the optimal discount rates and operation modes of the BESS was presented by using genetic algorithm optimization in Section 4.3. The schematic diagram of the SPPA is shown in Figure 1. The reverse power flow from rooftop PVs with BESS was available and considered as the additional revenue to the investors, as shown in Figure 2.

Operation Modes of Battery Energy Storage Systems
The operation principle of the BESS consists of the two main concepts of the operation (i) modes and (ii) power. Operation modes of the BESS are typically classified into the three modes of charging, discharging, and idling, and K(t) can be applied to represent each mode, as shown in Equation (25). For the operation power, the charged and discharged power from the BESS can be divided into two terms of (i) load and (ii) the utility's grid.

Operation Modes of Battery Energy Storage Systems
The operation principle of the BESS consists of the two main concepts of the operation (i) modes and (ii) power. Operation modes of the BESS are typically classified into the three modes of charging, discharging, and idling, and K(t) can be applied to represent each mode, as shown in Equation (25). For the operation power, the charged and discharged power from the BESS can be divided into two terms of (i) load and (ii) the utility's grid.
The discharged power is formulated and prioritized to supply the load. If the load demand is satisfied, the BESS can be discharged to the utility's grid depending on the condition energy and power limits. The amount of discharged power is subject to output power from rooftop PVs, load demand, maximum discharged power limit, and lower energy limit, as shown in Equations (26)- (28): The charged power is formulated to be charged from rooftop PVs and utility's grid. The amount of charged power is subject to output power from rooftop PVs, load demand, maximum charged power limit, and upper energy limit, as shown in Equations (29)-(31):

Solar Power Purchase Agreement with Behind-the-Meter Scheme
The SPPA with BTMS in this paper was formulated by dividing into two perspectives: (1) Customers' side and (2) Investors' side. For the customers' side, the modeling of electricity charges under the SPPA (R total customer (m))) was formulated based on the TOU tariff with demand charges, which consists of on-peak energy charges (R on customer (t)), off-peak energy charges (R off customer (t)), and demand charges (R demand customer (m)). r on sppa ·P l (t)· ∆t ; P g (t) ≤ 0 r on ·P g (t)· ∆t + r on sppa ·(P pv (t) + P bess (t))· ∆t ; P g (t) > 0 For the investors' side, the revenue of the investors (R total investor (m)))) was formulated based on the similar concept to the electricity charges of the customers, which consists of on-peak revenue (R on investor (t)),), off-peak revenue (R off investor (t)), and demand charge revenue (R demand investor (m)). The different point was the excess energy injected to the utility's grid, which was valued as additional revenue to the investors, as shown in Equations (36)-(39):

Discount Rate and Operation Mode Optimization
The proposed optimization model to design operation modes of the BESS and discount rates on TOU tariff with demand charges was formulated by considering the total electricity charges of the customers (EC customer ) and the profitability of an investment in rooftop PVs with BESS of the investors (NPV investor ), as shown in Equations (40) and (41): Therefore, the discount rates and operation modes were determined for minimizing the total electricity charges of the customers, while remaining the target IRR of the investors, as shown in Figure 3. These discount rates are the maximum discount rates that the investors can propose to the customers and still maintaining an attractive investment. The objective function and constraints are shown in Equations (42)-(46). The decisive variables are on-peak discount rate (α 1 ), off-peak discount rate (α 2 ), demand charge discount rate (β 1 ), and operation modes at time t (K(t)).
Objective Function: Subject to:

Simulation Results and Discussion
In this section, the case studies in Thailand are implemented. The TOU tariff with demand charges were implemented and simulated in this section by dividing into three scenarios: (1) Installed capacity of rooftop PVs (2) Battery Capacity and (3) Rate of excess energy. The results were determined by applying the proposed methodology with the genetic algorithm optimization in MATLAB.

Problem Description
Case studies in this paper are simulated based on the parameters in Table 1. The annual rooftop PVs profile at Chulalongkorn University and standard load profiles of large general service customers from metropolitan electricity authority (Bangkok, Thailand) are applied in this paper, as shown in Figure 4. The installed capacity of rooftop PVs and battery power capacity are shown by comparing to the peak demand. The battery energy capacity is shown by comparing to the daily load consumption. The rate of excess energy is shown by comparing to the utility's retail rate.

Simulation Results and Discussion
In this section, the case studies in Thailand are implemented. The TOU tariff with demand charges were implemented and simulated in this section by dividing into three scenarios: (1) Installed capacity of rooftop PVs (2) Battery Capacity and (3) Rate of excess energy. The results were determined by applying the proposed methodology with the genetic algorithm optimization in MATLAB.

Problem Description
Case studies in this paper are simulated based on the parameters in Table 1. The annual rooftop PVs profile at Chulalongkorn University and standard load profiles of large general service customers from metropolitan electricity authority (Bangkok, Thailand) are applied in this paper, as shown in Figure 4. The installed capacity of rooftop PVs and battery power capacity are shown by comparing to the peak demand. The battery energy capacity is shown by comparing to the daily load consumption. The rate of excess energy is shown by comparing to the utility's retail rate.

Scenario I: Installed Capacity of Rooftop PVs
The proposed discount rates, NPV, and IRR for each installed capacity of rooftop PVs were investigated, as shown in Figure 5a,b, respectively. In case that the installed capacity was smaller than 150%, all discount rates were increased when the installed capacity was increased. However,

Scenario I: Installed Capacity of Rooftop PVs
The proposed discount rates, NPV, and IRR for each installed capacity of rooftop PVs were investigated, as shown in Figure 5a,b, respectively. In case that the installed capacity was smaller than 150%, all discount rates were increased when the installed capacity was increased. However, when the installed capacity was larger than 150%, α 1 and β 1 were approximately constant while α 2 was significantly decreased to limit the IRR. For economic analysis, when the installed capacity was increased, the NPV were proportionally increased because of the escalation of revenue. For operation modes, the total operation time of the BESS in the charging and discharging modes for each case were approximately slightly increased when the installed capacity was increased, as shown in Figure 6.

Scenario II: Battery Capacity
This section was divided into two sub-sections: (1) Battery Energy Capacity and (2) Battery Power Capacity. In each sub-section, the sensitivity of battery energy capacity and battery power capacity on the proposed discount rates, NPV, IRR and the total operation time of the BESS in each mode were investigated.

Battery Energy Capacity
The proposed discount rates, NPV, and IRR for each battery energy capacity, at 50% of battery power capacity, were investigated, as shown in Figure 7a,b, respectively. When the battery energy capacity was increased, all proposed discount rates were significantly decreased to remain the target IRR. For economic analysis, while the IRR remained constant at the target, the NPV were increased because the increase of revenue from the reduction of discount rates were higher than the increase of the total cost. For operation modes, the total operation time of the BESS in the charging and discharging modes for each case were approximately equal and significantly escalated when the battery energy capacity was increased because of the higher energy capacity, as shown in Figure 8. In this scenario, it can be implied that α 2 is the most flexible variable that the investors can initially adjust to maintain the target IRR. α 1 and β 1 are the variables that have a high effect on the electricity charges because the highest output power from rooftop PVs and the peak load are typically occurred during the on-peak period. In addition, the installed capacity of rooftop PVs also affect the operation time of the BESS. If the installed capacity is increased, the operation time of the BESS in discharging and charging modes are increased.

Scenario II: Battery Capacity
This section was divided into two sub-sections: (1) Battery Energy Capacity and (2) Battery Power Capacity. In each sub-section, the sensitivity of battery energy capacity and battery power capacity on the proposed discount rates, NPV, IRR and the total operation time of the BESS in each mode were investigated.

Battery Energy Capacity
The proposed discount rates, NPV, and IRR for each battery energy capacity, at 50% of battery power capacity, were investigated, as shown in Figure 7a,b, respectively. When the battery energy capacity was increased, all proposed discount rates were significantly decreased to remain the target IRR. For economic analysis, while the IRR remained constant at the target, the NPV were increased because the increase of revenue from the reduction of discount rates were higher than the increase of the total cost. For operation modes, the total operation time of the BESS in the charging and discharging modes for each case were approximately equal and significantly escalated when the battery energy capacity was increased because of the higher energy capacity, as shown in Figure 8.

Battery Power Capacity
The proposed discount rates, NPV, and IRR for each battery power capacity, at 2.5% of battery energy capacity, were investigated, as shown in Figure 9a,b, respectively. When the battery power capacity was increased, all proposed discount rates were also significantly decreased. For economic analysis, in case that the battery power capacity was higher than 100%, the IRR could not reach to the target although all discount rates were zero because of the high total cost. For operation modes, the total operation time of the BESS in the charging and discharging modes for each case were approximately equal and significantly increased when the battery power capacity was increased because of the higher power capacity, as shown in Figure 10.

Battery Power Capacity
The proposed discount rates, NPV, and IRR for each battery power capacity, at 2.5% of battery energy capacity, were investigated, as shown in Figure 9a,b, respectively. When the battery power capacity was increased, all proposed discount rates were also significantly decreased. For economic analysis, in case that the battery power capacity was higher than 100%, the IRR could not reach to the target although all discount rates were zero because of the high total cost. For operation modes, the total operation time of the BESS in the charging and discharging modes for each case were approximately equal and significantly increased when the battery power capacity was increased because of the higher power capacity, as shown in Figure 10.
In this scenario, it can be implied that α 2 is also the most flexible variable rate that the investors can propose to the customers with high discount. The battery capacity has a direct effect on the discount rates and operation time of the BESS. If the battery capacity is increased, the operation time of the BESS in discharging and charging modes are increased while the proposed discount rates should be reduced to maintain the target IRR.   In this scenario, it can be implied that α2 is also the most flexible variable rate that the investors can propose to the customers with high discount. The battery capacity has a direct effect on the discount rates and operation time of the BESS. If the battery capacity is increased, the operation time of the BESS in discharging and charging modes are increased while the proposed discount rates should be reduced to maintain the target IRR.

Scenario III: Rate of Excess Energy
The proposed discount rates, NPV, and IRR for each rate of excess energy were investigated, as shown in Figure 11a,b, respectively. When the rate of excess energy was increased, α1, α2, and β1 were significantly increased. For economic analysis, in case that the rate of excess energy (γ) was lower than 100%, the IRR could not reach to the target although all discount rates were zero because of the low revenue and high total cost. For operation modes, the total operation time of the BESS for each case were approximately equal, as shown in Figure 12.
In this scenario, it can be implied that α1 is the most significant variable that the investors should strictly controlled. If γ is increased, the proposed discount rates could be increased and more flexible. There is no effect of the rate of excess energy on the operation time of the BESS.

Scenario III: Rate of Excess Energy
The proposed discount rates, NPV, and IRR for each rate of excess energy were investigated, as shown in Figure 11a,b, respectively. When the rate of excess energy was increased, α 1 , α 2 , and β 1 were significantly increased. For economic analysis, in case that the rate of excess energy (γ) was lower than 100%, the IRR could not reach to the target although all discount rates were zero because of the low revenue and high total cost. For operation modes, the total operation time of the BESS for each case were approximately equal, as shown in Figure 12.
In this scenario, it can be implied that α 1 is the most significant variable that the investors should strictly controlled. If γ is increased, the proposed discount rates could be increased and more flexible. There is no effect of the rate of excess energy on the operation time of the BESS.

Conclusions
This paper proposes a methodology to design the SPPA and operation modes of the BESS for rooftop PVs with BESS by applying the discount rates on TOU tariff with demand charges under BTMS. The discount rates are categorized into three variables, which consist of on-peak discount rate (α1), off-peak discount rate (α2) and demand charge discount rate (β1). The cost optimization problem is formulated for minimizing total electricity charges of the customers while maintaining the target IRR of the investors. The reverse power flow is available and considered as the additional revenue of the investors. The investors can implement this methodology to make an investment decision and design the proposed discount rates to the customers under the SPPA and BTMS.
As working examples, this paper implements the proposed methodology with the tariff structure in Thailand. The case studies are divided into three scenarios: (1) Installed capacity of rooftop PVs (2) Battery Capacity and (3) Rate of excess energy. From the first scenario, it shows that the investors can propose higher discount rates when the installed capacity of rooftop PVs increases. The operation time of the BESS in charging and discharging modes will also increase accordingly. However, the oversized of rooftop PVs will limit the proposed discount rates. In addition, the second scenario shows that an increase of battery energy capacity and battery power capacity will limit the

Conclusions
This paper proposes a methodology to design the SPPA and operation modes of the BESS for rooftop PVs with BESS by applying the discount rates on TOU tariff with demand charges under BTMS. The discount rates are categorized into three variables, which consist of on-peak discount rate (α 1 ), off-peak discount rate (α 2 ) and demand charge discount rate (β 1 ). The cost optimization problem is formulated for minimizing total electricity charges of the customers while maintaining the target IRR of the investors. The reverse power flow is available and considered as the additional revenue of the investors. The investors can implement this methodology to make an investment decision and design the proposed discount rates to the customers under the SPPA and BTMS.
As working examples, this paper implements the proposed methodology with the tariff structure in Thailand. The case studies are divided into three scenarios: (1) Installed capacity of rooftop PVs (2) Battery Capacity and (3) Rate of excess energy. From the first scenario, it shows that the investors can propose higher discount rates when the installed capacity of rooftop PVs increases. The operation time of the BESS in charging and discharging modes will also increase accordingly. However, the oversized of rooftop PVs will limit the proposed discount rates. In addition, the second scenario shows that an increase of battery energy capacity and battery power capacity will limit the proposed discount rates, while the operation time of the BESS in charging and discharging modes will decrease. For the last scenario, the higher rate of excess energy makes the higher proposed discount rates to the customers. There will be no effect from rate excess energy on operation of the BESS. Furthermore, from all scenarios, it can be concluded that the on-peak discount rate is the most significant variable, while the most flexible variable is the off-peak discount rate.
In future studies, the proposed methodology will be applied to various scenarios and assumptions, such as generation PV profile in different locations, load profiles, tariff structures and total cost of rooftop PVs and BESS. It will also be implemented to investigate an appropriate installed capacity of rooftop PVs and battery capacity under the SPPA and BTMS.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest. AC output power from rooftop PVs at time t (kW) P g (t) Output power from the utility's grid at time t (kW) P l (t) Load consumption at time t (kW) P bess (t) Output power from battery energy storage systems at time t (kW) C bess (t)η Stored energy in battery energy storage systems at time t (kWh) η bi-inverter Bi-directional inverter efficiency (%) η rt Battery round-trip efficiency (%) C nom,dc Battery nominal energy capacity (kWh) P nom,dc Battery nominal power capacity (kW) P limit bess,ch (t) Maximum charged power at time t (kW) P limit bess,dis (t) Maximum discharged power at time t (kW) ϕ Energy to power ratio σ(t) State of charge at time t (%) σ max Maximum state of charge (%) σ min Minimum state of charge (%) L(t) Battery degradation coefficient at time t L op (t) Operating degradation coefficient at time t L self (t) Self-degradation coefficient at time t N count (t) Number of used cycles N total Total life cycles of BESS (Cycles) TOU Tariff with Demand Charges γ Multiplier of excess energy (%) r on On-peak energy rate (THB/kWh) r off Off-peak energy rate (THB/kWh) r demand Demand charge rate (THB/kW) r on excess On-peak rate of excess energy (THB/kWh) r off excess Off-peak rate of excess energy (THB/kWh) R on (m) On-peak energy charges at month m (THB) R off (m) Off-peak energy charges at month m (THB) R demand (m) Demand charges at month m (THB) R total (m) Total electricity charges at month m (THB) Solar Power Purchase Agreement r on sppa SPPA on-peak energy rate (THB/kWh) r off sppa SPPA off-peak energy rate (THB/kWh) r demand sppa SPPA demand charge rate (THB/kW) α 1 On-peak discount rate α 2 Off-peak discount rate β 1 Demand charge discount rate