A Grid-Connected Optimal Hybrid PV-BES System Sizing for Malaysian Commercial Buildings

: In this article, the optimal sizing of hybrid solar photovoltaic and battery energy storage systems is evaluated with respect to rooftop space and feed-in tariff rates. The battery scheduling is performed using a proposed rule-based energy management strategy. The rules are formulated based on the demand limit, PV export power limit, and state of charge of the battery. Furthermore, optimization modeling with initial choices of parameters and constraints in terms of solar photovoltaic and battery energy storage capabilities is developed to minimize the total net present cost. The hourly values of solar irradiance, air temperature, electrical loads, and electricity rates are considered the inputs of the optimization process. The optimization results are achieved using particle swarm optimization and validated through an uncertainty analysis. It is observed that an optimal photovoltaic and battery energy storage system can reduce the cost of electricity by 12.33%, including the sale of 5944.029 kWh of electricity to the grid. Furthermore, energy consumption, peak demand, and greenhouse gas emissions are reduced by 13.71%, 5.85%, and 62.59%, respectively. A comprehensive analysis between the variable and ﬁxed data for the load, energy from PV, batteries, and the grid, and costs demonstrates that the optimal sizing of photovoltaic and battery energy storage systems with the best mix of energy from PV, batteries, and the grid provides the optimal solution for the proposed conﬁguration.


Introduction 1.Motivation
The increased demand for electricity has led to reduced fossil fuel resources and increased CO 2 emissions.The mitigation of global warming through the use of gridconnected solar photovoltaic (PV) and battery energy storage systems (BES) has recieved outstanding attention.However, the application of CO 2 reduction to the demand side has not received much attention from researchers and policymakers despite buildings being responsible for a large amount of greenhouse gas emissions (e.g., more than 78% of generated electricity resources come from the combustion of fossil fuels in Malaysia).As a result, Malaysia is ranked 26th among the world's top 35 greenhouse gas emitters, and Malaysia's CO 2 emissions have increased by 221% [1].Malaysia's installed solar energy capacity in the last ten years is roughly 1.8 GW [2].Malaysia has begun to prioritize clean energy, with the goal of reaching a capacity mix of 20-25% renewables by 2025 in order to minimize greenhouse gas emissions and diversify its power fuel mix [3,4].In May 2020, Malaysia announced a fourth round of contenders for a large-scale solar PV of 1 GW to encourage solar energy integration, particularly from local market actors [5].In order to improve the self-consumption of PV, the available PV power is first used to supply the load; if there is excess PV power, it can be sold to the grid as long as it is under the maximum PV export power limitation, which is stated by Malaysian energy commission guidelines [6].RERs (renewable energy resources) are intermittent due to their nature.This problem is considered stochastic, and batteries can be used to overcome this problem.When PV generation is high compared to load demand, excess PV power is locally stored using BES and can be used to supply the load during peak periods [7][8][9][10].For most commercial buildings that are built in city/urban areas where outer space is limited, the primary concern is the determination of the optimal capacity of PV-BES systems, considering their available rooftop space and the need to obtain maximum PV power output.Therefore, this study investigates optimal sizing to incentivize building owners to install PV and battery systems, which can contribute to reducing greenhouse gas emissions.

Existing Works and Their Limitations
In order to achieve increased energy savings with distributed energy resources, such as PV and BES, optimal energy management has to be performed [11].Various studies [12][13][14] analyzed optimal PV systems with BES for residential buildings using heuristic methods, such as particle swarm optimization (PSO) and genetic algorithms (GA).GA and PSO are typically used to find optimal distributed renewable energy systems [15,16].In [17], a hybrid GA-PSO algorithm was employed to determine the optimal component sizes for an off-grid PV-wind-battery system to reduce the net present cost and loss of load failure probability.In [18], PSO was implemented as it provided superiority over other algorithms due to its low storage requirements, simplicity, decreased dependency on initial point sets, and higher convergence rate [19].In particular, in dealing with optimal component sizing for distributed energy resources (DERs), PSO has been recognized as one of the most robust heuristic optimization strategies [20].A comparative discussion among three algorithms, namely GA, PSO, and the imperialistic competitive algorithm (ICA), indicated that PSO is faster and provides the best solution [21].
Maleki et al. proposed a method for the optimal sizing of an off-grid PV-dieselbattery system considering the loss of load failure probability and the effects of reliability indexes using modified PSO [22].In [23], the component sizing of a stand-alone PV system for a campus building in Malaysia was carried out using an iterative method without taking the optimal operation of the battery into account.This may introduce another peak over the course of a day.Several studies have shown how to determine the optimal sizes of PV-BES systems using HOMER Pro, PVSyst, and GA without exporting maximum PV power to the grid for commercial buildings in Malaysia [24][25][26].This constraint is absolutely required to reduce the stress on the grid.In [27][28][29], PSO, GA, and the grasshopper optimization algorithm (GOA) were utilized to find the optimal size and location of renewable energy systems without taking the interest rate, electricity inflation rate, BES, and inverter replacement costs into account.A resilience analysis of renewable energy-based hybrid microgrids using HOMER Grid software was reported in [30,31], which did not consider the comprehensive modeling of an efficient energy management system (EMS).An analysis was performed in [32] to find the optimal size of a PV-BES system for Malaysian commercial buildings using HOMER Grid software to minimize energy costs without considering the amount of reduction in the peak demand.In [33], the optimal sizing of a PV-BES system was investigated without considering battery charging by the grid.Furthermore, in [34,35], the salvage value was not taken into account when determining optimal PV sizing for residential buildings.The salvage value is the remaining value of components after a project's lifetime.When the salvage value is incorporated into the optimization model, more realistic results can be obtained.Moreover, the earlier works in terms of optimal PV capacity were mostly concerned with residential buildings with respect to rooftop space [36][37][38].The optimal sizing of PV systems based on the availability of rooftop space has not been considered in the case of commercial buildings.
Various energy management strategies for optimal sizing of PV-BES in hybrid power systems have been outlined in [39][40][41].It is important to ensure that each energy source functions within its parameters when designing an EMS while optimizing the system's performance.Additionally, it is desirable to minimize the influence of the EMS on the overall life cycle of the hybrid power system.A straightforward and well-known rule-based technique employs state machine control [42,43] where every EMS rule or state is defined using heuristics or empirics derived from prior experience.As a result, the effectiveness of this method depends on how well the developer understands how each component functions in the system.The rule-based fuzzy logic energy management technique is another popular strategy, and it is used to distribute power using functions associated with membership and an arrangement of if-then rules [44,45].This method can simply be fine-tuned for best performance, and its output is less susceptible to measurement error and component change.Therefore, if-then rules depend on the expertise and prior experience of an expert to develop a set of rules for effective interaction between the load and energy resources.
Along with the optimization approaches, rule-based techniques are also used in the literature for energy management purposes.These approaches are simple and easy to implement at an industrial scale, as suggested by IEEE Std 2030.7 [46-48].Even though it is considered that rule-based techniques do not provide optimality, there is a possibility for rule-based techniques to integrate with optimization approaches in order to make the algorithm more robust and provide the best solution.In [49], the optimal PV-BES system sizing using rule-based techniques is performed using PSO; however, it resulted in annual power dumps.Similarly, in [50][51][52], the rule-based techniques are integrated with optimization approaches for energy management applications such as peak shaving and demand response using PV-BES.However, the optimal sizing of the PV-BES system has not been explored.For optimal sizing of PV-BES in hybrid power systems, other energy management techniques have also been developed, such as model predictive control [53], neural networks [54], stochastic dynamic programming [55], and adaptive optimal control [56] based techniques.Due to the complexity and large computational requirement of these strategies, the energy management system's response time could be affected.Therefore, the most widespread energy management techniques which can be easily implementable at an industrial scale are covered and validated in this research.

Contributions
Considering the above limitations of the existing literature, the proposed method takes into account load, PV, BES, and reduction of peak demand for minimizing the net present cost (NPC) of components while also lowering net power purchases from the grid.In summary, the contributions of this work are as follows.

1.
Benchmarking the development of a practical optimization technique with rule-based EMS in conjunction with PSO for determining optimal PV and BES capacity using realistic data to provide a clear guideline for consumers in purchasing optimal PV-BES system sizing, taking into account both the average daily energy consumption of consumers and the available rooftop space for PV installation.

2.
The proposed rule-based EMS strategy is tested for different load profiles in the considered commercial building.Furthermore, a qualitative comparison is presented with existing works.

3.
Cash flow analysis is performed based on the proposed system configuration with a simple payback period (SPBP) and return on investment (ROI).

4.
Techno-economic analysis is investigated based on a cost-effective optimal PV-BES system with a reduction in greenhouse gas emissions.

5.
The robustness of the optimization results is validated by performing an uncertainty analysis based on five years of actual data on solar irradiance and air temperature.
The rest of the article is organized as follows: In Section 2, system modeling is described for grid-connected commercial buildings.Section 3 includes an explanation of optimization problem formulation.A techno-economic analysis is presented in Section 4. The results and discussion, including a case study, optimal capacities, PSO convergence, annual optimal operation, rule-based energy management strategies, uncertainty analysis, and a qualitative comparison with existing works, are presented in Section 5.The conclusion is drawn in Section 6.

Grid
A utility grid provides a reliable source of power.In the event of a shortage of power supply to meet the load demand requirements by utilizing the PV-BES system, the following equation calculates the utilization of grid-supplied electricity.

PV Module
A PV module generates electricity from the available solar energy.The following equation can be utilized for calculating the generation power of a single PV module [8].
where η p , P p,r , I s,i , and T a are the PV converter efficiency including cable losses, PV-modulerated output power, solar irradiance on the PV module (kW/m 2 ), and air temperature ( • C), respectively.

Energy Storage System
The generation of PV power mostly depends on nature.Therefore, surplus PV energy is stored in BES for future use.If there is a deficit, it will be compensated by the grid.The stored energy of the battery depends on the previous state-of-charge (SOC) at time t, generated PV power, and the required loads.Therefore, rule-based EMS is proposed.This rule-based EMS is applied because of its simple logic, user-friendliness, and ease of understanding.The applied rules are explicit for customers and designers.All rules can simply be updated whenever needed.The rules are designed using mathematical modeling for battery charging and discharging.The rule-based EMS is described in this section, which is also shown in Figure 1.
( where "&&" represents the logic "AND" operator. The SOC of the battery for each time interval can be calculated using Equation (8).
where  is the battery's self-discharging,  , is the battery's charging efficiency, and  , is the battery's discharging efficiency, which are 1%, 95%, and 98%, respectively.After invoking rule 3 for battery charging, P f −lim is calculated by following Equation (3). Otherwise, The available charging and discharging power of the battery at each time interval can be calculated using the following equation.
The energy level of the battery for each time interval can be calculated using the following equation.
The SOC of the battery for each time interval can be calculated using Equation (8).
where σ is the battery's self-discharging, η b,ch is the battery's charging efficiency, and η b,d is the battery's discharging efficiency, which are 1%, 95%, and 98%, respectively.

Dumped Power
If the difference between PV power and load demand exceeds the PV's maximum exporting power limit, excess power is dumped using a PV control system.The following equation can be used to calculate the dumped power as follows:

Optimization Modeling
The PSO algorithm is used to solve the optimization problem.The flow chart of the optimization process is shown in Figure 2. PSO was successfully employed to obtain optimal PV-BES component sizing for both residential and commercial buildings [57,58].The minimization of total NPC is considered an objective function throughout the 20-year period, including capital investment, annual maintenance cost, replacement expense for the BES and inverter after 10 years, interest rate, and electricity escalation rate.The system configuration for optimal operation with EMS is employed.The cases of constraints in PV-BES capabilities, the battery's SOC, and the PV's exporting power to the grid are all considered.The maximum PV-BES system capacity is taken into account for reliable load delivery using the grid, PV, and BES.The PV and BES capacities are considered control variables for optimization.The proposed configuration is annually evaluated to determine the lowest total NPC, optimal capacity of the PV-BES system, charging and discharging conditions of the battery, exchanging electricity with the grid, and output power of the PV.
The annual operating and maintenance costs vary with an interest rate i over a 20-year period by The present cost of replacing a component every M years over the lifetime of the project is as follows: The PV system has a lifespan of 25 years, while the lifetime of the project is 20 years.Therefore, the salvage value after the lifetime of the project is calculated by Malaysian utility companies imposed ICPT (imbalance cost pass-through) charges to non-domestic consumers; after each consecutive 6 months, they review whether to increase the electricity price based on increasing fuel costs, friction parts of power plants, etc.In this investigation, the electricity price is assumed to be increased by 1% after each consecutive 6 months, which means 2% annually.It is worth noting that the escalation rate is considered to be above the interest rate i.Therefore, the real interest rate is calculated by Equation (18) shows the constraint on the number of PVs, batteries, and inverters.Equations ( 19) and ( 20) are constraints on the output power cases of PVs and batteries, respectively.Equation ( 21) indicates the constraint on the SOC of the battery at each time interval.The power balance at each time interval is constrained by Equation ( 22).The PV exporting power to the grid is constrained by Equation ( 23).The NPC el of the annual electricity cost is calculated by The system constraints are as follows: .
Equation (18) shows the constraint on the number of PVs, batteries, and inverters.Equations ( 19) and ( 20) are constraints on the output power cases of PVs and batteries, respectively.Equation (21) indicates the constraint on the SOC of the battery at each time interval.The power balance at each time interval is constrained by Equation (22).The PV exporting power to the grid is constrained by Equation (23).

Cost of Electricity (COE)
Those commercial buildings are assigned to the C1 tariff, which includes both energy prices (RM/kWh) and demand charges (RM/kW) imposed by Tenaga Nasional Berhad (TNB) [32] when not taking into account PV-BES systems.The COE is calculated based on the total NPC of both the PV-BES system cost and the electricity cost, incorporating the cost recovery factor (CRF) for both cases divided by the annual electricity consumption (8670 h), as follows:

Annual Cash Flow and Cost Benefit
The payment of the annual cash flow is to be made by the customer each year over a 20-year period.The capital and replacement costs of PV, BES, and inverters are received from commercial banks with a low rate of interest in Malaysia.Equation ( 28) is used to calculate the total annual payment as follows: For the grid-connected commercial building with a PV-BES system, the annual electricity bill is the T ap .The annual benefit after implementing the proposed system configuration and the total benefit over a 20-year period are calculated as follows: The simple payback period (SPBP) is the ratio of the total investment in the PV-BES system to the yearly cash flow over a 20-year period.
The return on investment (ROI) is calculated by dividing the total profit received after implementing the PV-BES system by the total capital expenditure.Equation ( 32) is used to calculate the ROI.

CO 2 Reduction Impact Modeling
In Malaysia, most of the generated electricity comes from fossil fuels, primarily coal and natural gas, as in the case of the Fakulti Kejuruteraan Elektrik (FKE-2) commercial building, which emits significant amounts of CO 2 at 540 g/kWh, NOx at 1.34 g/kWh, and SO 2 at 2.74 g/kWh [37].The overall amount of greenhouse gas emitted by the FKE-2 commercial building is calculated by multiplying the net grid purchase (in kWh) by the emission factor (in g/kWh) for each pollutant.As a result, the electricity consumed by the FKE-2 commercial building in Universiti Teknikal Malaysia (UTeM) from the utility grid system equates to emissions of roughly 83.19 tonnes of CO 2 , 0.206 tonnes of NOx, and 0.422 tonnes of SO 2 every year.The adaptation of a grid-connected hybrid system results in a significant reduction in greenhouse gas emissions, as calculated by Equation (33).

Case Study Description
In this article, the FKE-2 commercial building in UTeM is considered a case study.The monthly electric grid bill comprises the C1 tariff as energy consumption at 0.365 RM/kWh and demand charge at 30.30 RM/kW, respectively [59].Feed-in tariff (FiT) rates are set based on installed PV capacity, as listed in Table 1 [6].In addition, the Malaysian government provides incentives for the deployment of PV systems in buildings, as listed in Table 2 [6].The Malaysian ringgit is taken into consideration for cost and pricing.The highest amount of power that can be exported from a building to the grid is 10 kW, along with an average daily energy consumption of 421.55 kWh.A 1 kW installed capacity of a PV system in Melaka, Malaysia, generates an average of 4.9 kWh with an average air temperature and solar irradiance of 26.5 • C and 6.11 kWh/m 2 /day, respectively [60].The PV-BES system's capital cost, maintenance cost, and replacement cost for the BES and inverter after 10 years are all listed in Table 3 [7].Lithium-ion batteries are considered for integration with PV systems.Actual hourly data for the past year on solar irradiance, air temperature, and electrical loads in the context of Melaka, Malaysia, are used, and this investigation is intended to guarantee the validity of the results.The BES is added in parallel with the PV system in the proposed configuration, as shown in Figure 3. government provides incentives for the deployment of PV systems in buildin in Table 2 [6].The Malaysian ringgit is taken into consideration for cost and p highest amount of power that can be exported from a building to the grid is 10 with an average daily energy consumption of 421.55 kWh.A 1 kW installed c PV system in Melaka, Malaysia, generates an average of 4.9 kWh with an aver perature and solar irradiance of 26.5 °C and 6.11 kWh/m 2 /day, respectively [6 BES system's capital cost, maintenance cost, and replacement cost for the BES a after 10 years are all listed in Table 3 [7].Lithium-ion batteries are considered tion with PV systems.Actual hourly data for the past year on solar irradiance, ature, and electrical loads in the context of Melaka, Malaysia, are used, and thi tion is intended to guarantee the validity of the results.The BES is added in p the PV system in the proposed configuration, as shown in Figure 3.

Rooftop Availability
The rooftop PV installation space for commercial buildings is considered a limitation in this study.For the purposes of installing solar panels, it is considered that there is 350.25 m 2 of effective rooftop area available, considering basic FiT rates, with an installed capacity of 4 kW up to and including 72 kW PV [61].Equation ( 34) can be utilized to determine the maximum PV capacity (P s ) for a particular rooftop [7]:

Optimal Capacities
Considering the limited rooftop area and FiT rates, Table 4 shows the optimal PV-BES system capacity, capital expenditures (capex), total NPC, COE, CO 2 , and its minimization, SPBP, ROI, along with energy import and export from and to the grid.A 32 kW PV system with 14 kWh of batteries is the most profitable configuration.When compared to a system without PV and batteries, the COE was reduced to 0.32 RM/kWh, or 12.33%, in this scenario.Capex can be acquired for a price of RM 149,350 from a Malaysian commercial bank at a low-interest rate.Excess PV energy is sold to the grid.Furthermore, the rooftop area is limited, resulting in decreased PV capacity and lower capex for grid-connected commercial buildings.

PSO Convergence
In the creation process of the PSO algorithm, 50 populations with 200 generations have been considered.Furthermore, the system has been optimized over 10 runs to achieve reliable results.The PSO convergence of the proposed configuration is demonstrated in Figure 4.

PSO Convergence
In the creation process of the PSO algorithm, 50 populations with 200 have been considered.Furthermore, the system has been optimized over achieve reliable results.The PSO convergence of the proposed configuration strated in Figure 4.

Annual Optimal Operation Analysis
The annual optimal operation of the proposed configuration's results is il Figure 5.The optimal capacity of a PV-BES system is the combination of 32 kW with 14 kWh BES.The Malaysian utility company TNB indicates peak hour tariff occur between 8 a.m. and 10 p.m.The maximum PV output power is 29 a system efficiency of less than 90%.Whenever PV power is less than the de the deficit is compensated by using BES and the grid.PV-exported power m greater than 10 kW due to the grid constraints of the consumers.Therefore, sur from the PV is first used to charge the battery.Afterward, it is sold to the grid; than 10 kW, it is considered dumped power.From 4000 h to 6000 h, load dem than PV output power, which implies that after meeting the load demand, extr is used to charge the battery; if there is still a surplus, it is sold to the grid a Figure 5d.Load power and PV power are not equal, as illustrated in Figure fore, when load demand exceeds the demand limit, grid import power is s higher, and vice versa, as demonstrated in Figure 5c.In addition, the need mand is satisfied by PV power, and if demand is higher than the threshold, th discharged to reduce it.It is noteworthy that throughout the yearly operatio hours when the grid does not import power, which can be compared to a building.This also indicates that after load feeding, any surplus power gener PV system is sent to the battery and the grid.There are times when the grid im little power because the load demand is less than the demand limit.Again, P power cannot be greater than 10 kW, which is observed during the middle Furthermore, battery capacity (14 kWh) has contributed to reducing dumped ure 5h shows that there is no dumped power, which implies the proposed sys

Annual Optimal Operation Analysis
The annual optimal operation of the proposed configuration's results is illustrated in Figure 5.The optimal capacity of a PV-BES system is the combination of 32 kW PV systems with 14 kWh BES.The Malaysian utility company TNB indicates peak hours for the C1 tariff occur between 8 a.m. and 10 p.m.The maximum PV output power is 29.8 kW, with a system efficiency of less than 90%.Whenever PV power is less than the demand limit, the deficit is compensated by using BES and the grid.PV-exported power must not be greater than 10 kW due to the grid constraints of the consumers.Therefore, surplus energy from the PV is first used to charge the battery.Afterward, it is sold to the grid; if it is more than 10 kW, it is considered dumped power.From 4000 h to 6000 h, load demand is less than PV output power, which implies that after meeting the load demand, extra PV power is used to charge the battery; if there is still a surplus, it is sold to the grid as shown in Figure 5d.Load power and PV power are not equal, as illustrated in Figure 5a,b.Therefore, when load demand exceeds the demand limit, grid import power is significantly higher, and vice versa, as demonstrated in Figure 5c.In addition, the need for load demand is satisfied by PV power, and if demand is higher than the threshold, the battery is discharged to reduce it.It is noteworthy that throughout the yearly operation, there are hours when the grid does not import power, which can be compared to a zero-energy building.This also indicates that after load feeding, any surplus power generated by the PV system is sent to the battery and the grid.There are times when the grid imports very little power because the load demand is less than the demand limit.Again, PV-exported power cannot be greater than 10 kW, which is observed during the middle of the year.Furthermore, battery capacity (14 kWh) has contributed to reducing dumped power.Figure 5h shows that there is no dumped power, which implies the proposed system is more efficient than others.Figure 5g shows the maximum and minimum SOC of the battery varies from 20% to 100%.At various hours of the year, a battery's SOC is greater than 20%, which means the battery is not completely discharging due to low electricity usage compared to PV generation.Therefore, the battery is charged using PV power supplies after being fed to the load.If load demand is less than the demand limit and PV power is also unavailable, the grid is utilized to charge the battery as illustrated in Figure 5e.It is also taken into consideration that the battery would not produce another peak while using the grid for charging.Figure 5g shows the maximum and minimum SOC of the battery varies from 20% to 100%.At various hours of the year, a battery's SOC is greater than 20%, which means the battery is not completely discharging due to low electricity usage compared to PV generation.Therefore, the battery is charged using PV power supplies after being fed to the load.If load demand is less than the demand limit and PV power is also unavailable, the grid is utilized to charge the battery as illustrated in Figure 5e.It is also taken into consideration that the battery would not produce another peak while using the grid for charging.Battery discharge usually occurs when the load demand exceeds the demand limit threshold, as shown in Figure 5f.

Rule-Based Energy Management Strategies Analysis
In this section, the proposed rule-based EMS strategies are tested by considering the optimal PV-BES system capacity for different loads and PV power profiles to show their applicability for any grid-connected PV-BES system commercial building.In Malaysia, there are two seasons, namely the monsoon (also known as winter) and summer.The following cases 1, 2, 3, and 4 are presented based on seasonal load and PV power generation profiles.
Case 1: Winter load profile with higher PV generation availability.
A 24 h energy management strategy of the proposed configuration is shown in Figure 6.When P l (t) > P d−lim and P p (t) < P l (t) − P d−lim , the discharging of the battery occurs during t = 10, 13, 16, and 17 h; while charging mode t = 2, 3, 4, 5, 6, 7, and 24 h, only the grid is utilized as P l (t) < P d−lim &&P p (t) == 0. In contrast, when t = 8, 9, 11, 18, 19, and 20 h, after feeding the PV power to the load, if P l (t) < P d−lim , grid power is used for charging the battery.This is observed only when t = 9 h.However, when t = 12, 14, and 15 h, PV power is used for charging the battery, as P p (t) > P l (t).When t = 12, 14, and 15 h, the load demand is satisfied using PV, and the remaining power is used to charge the battery, if there is still any, and then sold to the grid, which is comparable with net zero energy buildings and also introduces the consumer as a prosumer.
Battery discharge usually occurs when the load demand exceeds the demand limit threshold, as shown in Figure 5f.

Rule-Based Energy Management Strategies Analysis
In this section, the proposed rule-based EMS strategies are tested by considering the optimal PV-BES system capacity for different loads and PV power profiles to show their applicability for any grid-connected PV-BES system commercial building.In Malaysia, there are two seasons, namely the monsoon (also known as winter) and summer.The following cases 1, 2, 3, and 4 are presented based on seasonal load and PV power generation profiles.
Case 1: Winter load profile with higher PV generation availability.
A 24 h energy management strategy of the proposed configuration is shown in Figure 6.When    and      , the discharging of the battery occurs during  = 10, 13, 16, and 17 h; while charging mode  = 2, 3, 4, 5, 6, 7, and 24 h, only the grid is utilized as    &&  0. In contrast, when  = 8, 9, 11, 18, 19, and 20 h, after feeding the PV power to the load, if    , grid power is used for charging the battery.This is observed only when  = 9 h.However, when  = 12, 14, and 15 h, PV power is used for charging the battery, as     .When  = 12, 14, and 15 h, the load demand is satisfied using PV, and the remaining power is used to charge the battery, if there is still any, and then sold to the grid, which is comparable with net zero energy buildings and also introduces the consumer as a prosumer.when  = 9, 10, 11, 18, and 19 h, after feeding the PV power to the load, grid power is used for charging the battery.The sale of the PV power to the grid is not applicable as there is no excess PV power generated.Case 2: Winter load profile with less PV generation availability.An energy management strategy for a 24 h winter load profile with less PV power generation for the proposed configuration is shown in Figure 7.During the case of exceeding load demand P l (t) > P d−lim , and when PV power P p (t) < P l (t) − P d−lim , the discharging of the battery occurs when t = 7 and 12 h; while charging mode t = 1, 2, 3, 4, 5, 6, 20, 21, 22, 23, and 24 h, only the grid is utilized, as P l (t) < P d−lim &&P p (t) == 0. In contrast, when t = 9, 10, 11, 18, and 19 h, after feeding the PV power to the load, grid power is used for charging the battery.The sale of the PV power to the grid is not applicable as there is no excess PV power generated.
Case 3: Summer load profile with higher PV generation availability.A 24 h energy management strategy for summer load profile with higher PV generation is shown in Figure 8.When P l (t) > P d−lim and P p (t) < P l (t) − P d−lim , the discharging of the battery occurs during t = 9, 16, 17, and 22 h; while charging mode t = 1, 2, 3, 4, 5, 6, 8, 21, 23, and 24 h, only the grid is utilized, as P l (t) < P d−lim &&P p (t) == 0. In contrast, when t = 7, 19, and 20 h, after PV power feeds the load, the battery is charged.When t = 15 h, the excess PV power after feeding the load and charging the battery is sold to the grid, which is comparable with net zero energy buildings and introduces the consumer as a prosumer.Case 3: Summer load profile with higher PV generation availability.A 24 h energy management strategy for summer load profile with higher PV generation is shown in Figure 8.When    and      , the discharging of the battery occurs during  = 9, 16, 17, and 22 h; while charging mode  = 1, 2, 3, 4, 5, 6, 8, 21, 23, and 24 h, only the grid is utilized, as    &&  0. In contrast, when t = 7, 19, and 20 h, after PV power feeds the load, the battery is charged.When  = 15 h, the excess PV power after feeding the load and charging the battery is sold to the grid, which is comparable with net zero energy buildings and introduces the consumer as a prosumer.Case 4: Summer load profile with less PV generation availability.
Figure 9 shows the worst-case summer load profile with less PV power generation.If    and      , the discharging power of the battery occurs during  = 4, 8, and 20 h; while charging mode  = 1, 2, 6, and 7 h, only the grid is utilized, as    &&  0. There is no applicable PV power to sell to the grid as there is no available excess PV power generation.When  = 19 h, after feeding PV power to the load, the battery is charged from the grid.It was observed that the battery is charged less with the help of PV and the grid as the day's load is always greater than the permissible limit.It is a good demonstration that the battery must not be charged from the grid, re-  Case 3: Summer load profile with higher PV generation availability.
A 24 h energy management strategy for summer load profile with higher PV generation is shown in Figure 8.When    and      , the discharging of the battery occurs during  = 9, 16, 17, and 22 h; while charging mode  = 1, 2, 3, 4, 5, 6, 8, 21, 23, and 24 h, only the grid is utilized, as    &&  0. In contrast, when t = 7, 19, and 20 h, after PV power feeds the load, the battery is charged.When  = 15 h, the excess PV power after feeding the load and charging the battery is sold to the grid, which is comparable with net zero energy buildings and introduces the consumer as a prosumer.Case 4: Summer load profile with less PV generation availability.Figure 9 shows the worst-case summer load profile with less PV power generation.If    and      , the discharging power of the battery occurs during  = 4, 8, and 20 h; while charging mode  = 1, 2, 6, and 7 h, only the grid is utilized, as    &&  0. There is no applicable PV power to sell to the grid as there is no available excess PV power generation.When  = 19 h, after feeding PV power to the load, the battery is charged from the grid.It was observed that the battery is charged less with the help of PV and the grid as the day's load is always greater than the permissible limit.It is a good demonstration that the battery must not be charged from the grid, resulting in no further peaks being generated with the battery in these cases.Case 4: Summer load profile with less PV generation availability.
Figure 9 shows the worst-case summer load profile with less PV power generation.If P l (t) > P d−lim and P p (t) < P l (t) − P d−lim , the discharging power of the battery occurs during t = 4, 8, and 20 h; while charging mode t = 1, 2, 6, and 7 h, only the grid is utilized, as P l (t) < P d−lim &&P p (t) == 0. There is no applicable PV power to sell to the grid as there is no available excess PV power generation.When t = 19 h, after feeding PV power to the load, the battery is charged from the grid.It was observed that the battery is charged less with the help of PV and the grid as the day's load is always greater than the permissible limit.It is a good demonstration that the battery must not be charged from the grid, resulting in no further peaks being generated with the battery in these cases.

Uncertainty Analysis Using the Last 5 Years' Real Data
An uncertainty analysis is performed to validate the proposed methodology's findings, taking into account the variability in solar insolation and air temperature.This research is based on real data collected from Malaysia's Melaka urban region over a 5-year period (2016-2020).Figure 10a shows the annual average daily air temperature and average solar insolation for this time period.The optimal capabilities of the PV-BES system for the proposed configuration are shown in Figure 10b over a 5-year period.The optimal PV capacity is found to be 32 kW for three years, 35 kW for one year, and 30 kW for one year, respectively.Likewise, the optimal BES capacity varies, with 14 kWh encompassing four years and 10 kWh for one year, respectively.

Uncertainty Analysis Using the Last 5 Years' Real Data
An uncertainty analysis is performed to validate the proposed methodology's findings, taking into account the variability in solar insolation and air temperature.This research is based on real data collected from Malaysia's Melaka urban region over a 5-year period (2016-2020).Figure 10a shows the annual average daily air temperature and average solar insolation for this time period.The optimal capabilities of the PV-BES system for the proposed configuration are shown in Figure 10b over a 5-year period.The optimal PV capacity is found to be 32 kW for three years, 35 kW for one year, and 30 kW for one year, respectively.Likewise, the optimal BES capacity varies, with 14 kWh encompassing four years and 10 kWh for one year, respectively.
This uncertainty analysis verifies that the optimal PV-BES capacities determined in Section 5.3 are appropriate for typical Malaysian commercial buildings, taking rooftop availability, an average daily energy consumption of 421.55 kWh, a demand limit of 18 kW, the FiT rate of 0.4486 RM/kWh, and a maximum permitted PV exporting power limitation of 10 kW to the grid into consideration.

Discussion
The optimal sizing of PV-BES capacity is determined taking into account the availability of rooftop space, grid constraints, load demand, meteorological data, and technical and economic data of the PV-BES system using the proposed efficient energy management system.The case study demonstrated that the proposed configuration of the considered

Uncertainty Analysis Using the Last 5 Years' Real Data
An uncertainty analysis is performed to validate the proposed methodology's findings, taking into account the variability in solar insolation and air temperature.This research is based on real data collected from Malaysia's Melaka urban region over a 5-year period (2016-2020).Figure 10a shows the annual average daily air temperature and average solar insolation for this time period.The optimal capabilities of the PV-BES system for the proposed configuration are shown in Figure 10b over a 5-year period.The optimal PV capacity is found to be 32 kW for three years, 35 kW for one year, and 30 kW for one year, respectively.Likewise, the optimal BES capacity varies, with 14 kWh encompassing four years and 10 kWh for one year, respectively.
This uncertainty analysis verifies that the optimal PV-BES capacities determined in Section 5.3 are appropriate for typical Malaysian commercial buildings, taking rooftop availability, an average daily energy consumption of 421.55 kWh, a demand limit of 18 kW, the FiT rate of 0.4486 RM/kWh, and a maximum permitted PV exporting power limitation of 10 kW to the grid into consideration.

Discussion
The optimal sizing of PV-BES capacity is determined taking into account the availability of rooftop space, grid constraints, load demand, meteorological data, and technical and economic data of the PV-BES system using the proposed efficient energy management system.The case study demonstrated that the proposed configuration of the considered commercial building with a combination of 32 kW of PV systems and 14 kWh of BES is the most profitable, considering the SPBP and ROI.This optimal PV-BES system can reduce energy consumption and peak demand for the considered commercial building by 13.71% and 5.85%, respectively.Therefore, the proposed technique illustrated the potentiality of significant cost savings for commercial buildings on Malaysia's C1 tariff.This uncertainty analysis verifies that the optimal PV-BES capacities determined in Section 5.3 are appropriate for typical Malaysian commercial buildings, taking rooftop availability, an average daily energy consumption of 421.55 kWh, a demand limit of 18 kW, the FiT rate of 0.4486 RM/kWh, and a maximum permitted PV exporting power limitation of 10 kW to the grid into consideration.

Discussion
The optimal sizing of PV-BES capacity is determined taking into account the availability of rooftop space, grid constraints, load demand, meteorological data, and technical and economic data of the PV-BES system using the proposed efficient energy management system.The case study demonstrated that the proposed configuration of the considered commercial building with a combination of 32 kW of PV systems and 14 kWh of BES is the most profitable, considering the SPBP and ROI.This optimal PV-BES system can reduce energy consumption and peak demand for the considered commercial building by 13.71% and 5.85%, respectively.Therefore, the proposed technique illustrated the potentiality of significant cost savings for commercial buildings on Malaysia's C1 tariff.Moreover, this optimal PV-BES system can also reduce COE by 12.33% compared to a system without PV-BES.Furthermore, this approach also significantly decreases CO 2 emissions by 62.59%.This optimal PV-BES system is evaluated and validated using an uncertainty analysis, which was performed over the last five years with real data on solar irradiance and air temperature.
Overall, this study contributes to the improvement of sustainable and efficient energy management practices by providing significant insights into reducing energy and peak demand by obtaining optimal PV-BES system sizing in Malaysian commercial buildings.

Qualitative Comparison
This proposed article is compared to existing works, which are shown in Table 5.This implies that the existing limits, both the demand limit and the feed-in limit, are not considered together when determining the optimal PV-BES capacity of commercial buildings.Therefore, in our proposed method, we have taken into account that both the demand limit and the feed-in limit are fixed, which makes the optimization results more realistic as electricity costs are measured in RM/kWh and RM/kW, while ensuring not to encounter another peak by utilizing BES along with the implementation of grid constraints.

Conclusions
The proposed rule-based energy management strategy with optimization is tested for a grid-connected commercial building in Malaysia and the results are validated accordingly.The total net present cost of the photovoltaic and battery energy storage systems and the electricity cost over 20 years served as an objective function.UTeM's grid-connected FKE-2 commercial building, which is on Malaysia's C1 tariff, was chosen as a case study.Moreover, one year's actual hourly data on solar irradiation, air temperature, and load patterns were analyzed with a thorough examination based on the building's cost of electricity.The optimal capacity is determined as a 32 kW PV and 14 kWh BES system with a COE of 0.32 RM/kWh and an annual reduction of 13.71%, 5.85%, and 62.59% in energy consumption, peak demand, and greenhouse gas emissions, respectively.In addition, conducting an uncertainty analysis using real data over the past five years confirmed the stability of the optimal PV-BES system capacity over this period, resulting in valuable practical guidance for sizing the PV-BES systems in commercial buildings.
In this study, rule-based techniques are effectively used with an optimization approach.Therefore, further work should explore the integration of advanced optimization techniques, for instance, machine learning algorithms, other optimization algorithms, or dynamic programming.These techniques would enhance the performance and efficiency of the proposed energy management control strategy.Additionally, further studies must be enhanced with socio-economic analysis and the development of business models for optimal PV-BES system sizing, maximizing the reduction of optimal peak shaving by utilizing advancement control strategies.This can provide insights into the financial sustainability and potential revenue sources of Malaysian commercial building owners and investors.

T ap
Annual payment for the system, (RM).

NPC sys
Net present cost of the system, (RM).A b,sys Annual benefit of the system, (RM).

T ap,grid
Annual payment for grid without system, (RM).P d,p Dumped power, (kW).

A p,e
Annual payment for grid with system, (RM).

E an, c
Annual energy consumption, (kWh).

A c,o&m
Annual payment for operation and maintenance, (RM).C el Electricity cost, (RM).

T b,sys
Total benefit of the system, (RM).
Total NPC Total net present cost of the system and electricity, (RM).

Figure 1 .
Figure 1.Proposed rule-based EMS for grid-connected commercial buildings.Figure 1. Proposed rule-based EMS for grid-connected commercial buildings.

Figure 1 .
Figure 1.Proposed rule-based EMS for grid-connected commercial buildings.Figure 1. Proposed rule-based EMS for grid-connected commercial buildings.

Figure 2 .
Figure 2. Optimization process through proposed energy management strategy.

Figure 2 .
Figure 2. Optimization process through proposed energy management strategy.

Figure 3 .
Figure 3. PV-BES system configuration for Malaysian commercial buildings.

Figure 3 .
Figure 3. PV-BES system configuration for Malaysian commercial buildings.

Figure 5 .
Figure 5. Annual (January to December) operation results of optimized system for proposed configuration (a) Load demand of commercial building; (b) PV generation; (c) import power; (d) export power; (e) battery charging power; (f) battery discharging power; (g) SOC of the battery; (h) dumped power.

Figure 5 .
Figure 5. Annual (January to December) operation results of optimized system for proposed configuration (a) Load demand of commercial building; (b) PV generation; (c) import power; (d) export power; (e) battery charging power; (f) battery discharging power; (g) SOC of the battery; (h) dumped power.

Figure 6 .Case 2 :
Figure 6.Case 1.A 24 h energy management strategy with a winter load profile and higher PV generation.

Figure 6 .
Figure 6.Case 1.A 24 h energy management strategy with a winter load profile and higher PV generation.

Figure 7 .
Figure 7. Case 2. A 24 h energy management with a winter load profile and less PV generation.

Figure 8 .
Figure 8. Case 3. A 24 h energy management with a summer load profile and higher PV generation.

Figure 7 .
Figure 7. Case 2. A 24 h energy management with a winter load profile and less PV generation.

Figure 7 .
Figure 7. Case 2. A 24 h energy management with a winter load profile and less PV generation.

Figure 8 .
Figure 8. Case 3. A 24 h energy management with a summer load profile and higher PV generation.

Figure 8 .
Figure 8. Case 3. A 24 h energy management with a summer load profile and higher PV generation.

Figure 9 .
Figure 9. Case 4. A 24 h energy management with a summer load profile and less PV generation.

Figure 10 .
Figure 10.Uncertainty analysis using the last five years real data (2016-2020).(a) Air temperature and soar irradiance; (b) PV and BES capacity.

Figure 9 .
Figure 9. Case 4. A 24 h energy management with a summer load profile and less PV generation.

Figure 9 .
Figure 9. Case 4. A 24 h energy management with a summer load profile and less PV generation.

Figure 10 .
Figure 10.Uncertainty analysis using the last five years real data (2016-2020).(a) Air temperature and soar irradiance; (b) PV and BES capacity.

Figure 10 .
Figure 10.Uncertainty analysis using the last five years real data (2016-2020).(a) Air temperature and soar irradiance; (b) PV and BES capacity.

1) Discharging Mode Rule 1: If
P l ≥ P d−lim &&P p (t) ≤ P l (t) − P d−lim , battery is discharged by amount P l (t) − P p (t).

Table 1 .
FiT rates for installed PV capacity in buildings.

Table 2 .
Incentives for the installation of PV in buildings.

Table 3 .
Cost of the PV-BES system, economic rates, and lifespan.

Table 1 .
FiT rates for installed PV capacity in buildings.

Table 4 .
The proposed system configuration's optimization results.

Table 5 .
The proposed article's qualitative comparison with existing works.