## 4 EMS Optimization  
### Battery Energy and Battery Power  
Battery energy (Figure 2) demonstrates how battery energy varies over a 24 h period, with time ranging from 0 to 25 h for comprehensive data representation. The scale for battery energy spans from 0 to 8 \(\times\) 10\({}^{4}\) kW-h. Starting around 1.8 kW-h, the energy level decreases initially and reaches approximately 0.5 kW-h by the 13 th h. Subsequently, it gradually increases to about 3.7 kW-h by the 24 th h, reflecting fluctuations in energy storage and discharge throughout the day.  
Figure 2 illustrates the variation in battery energy storage (in kW-h) over a 24 h period, showcasing the dynamics of the energy management system (EMS) in response to day-night cycles. The time axis spans from 0 to 24 h, with the vertical axis representing battery energy in increments of 10,410^4104 kW-h.  
* Daytime Period (6:00 AM-6:00 PM, 6 to 18 h): During this period, solar energy generation is typically at its peak, leading to an increase in battery energy storage. This is reflected in the graph, where a significant rise in battery energy is observed starting around the 10 th h and continuing until approximately the 20 th h.
* Nighttime Period (6:00 PM-6:00 AM, 18 to 6 h): Energy consumption is generally higher during this period, with reduced or no solar energy input. The graph shows relatively stable or decreasing battery energy levels during these hours, indicating the discharge of stored energy to meet nighttime demand.  
Figure 2 provides insights into how the EMS manages energy storage, ensuring that sufficient energy is stored during the day for use during nighttime, thereby stabilizing grid operations and enhancing overall system efficiency.  
Battery power (Figure 3) illustrates the dynamics of battery power during the same timeframe, with a similar time scale and range as Figure 2. The scale for battery power ranges from 0 to 4 \(\times\) 104 W. Beginning around 1.9 W, the power quickly ramps up to 4 W within the first hour. Throughout the period, there are instances where power decreases intermittently to 0, 0.5 W, and 1 W but generally remains close to the upper limit of 4 W for extended periods until the 24 th h. These fluctuations in battery power indicate adaptive adjustments by the EMS to optimize grid interactions and energy utilization.  
Figure 3 shows the power output of the battery (in W) over a 24 h period, capturing the real-time fluctuations managed by the energy management system (EMS). The horizontal axis represents time from 0 to 24 h, while the vertical axis denotes power in increments of 10,410^4104 W.  
* Daytime Period (6:00 AM-6:00 PM, 6 to 18 h): During daylight hours, the battery power exhibits more frequent fluctuations, reflecting the dynamic charging and discharging processes driven by variable solar energy input and fluctuating demand. Around midday (10 to 15 h), the power output tends to stabilize, indicating periods of high solar generation and reduced need for rapid power adjustments.  
Figure 2: Battery Energy.  
* Nighttime Period (6:00 PM-6:00 AM, 18 to 6 h): During the night, battery power fluctuates less frequently but still shows noticeable activity as stored energy is dispatched to meet the grid's demand. These fluctuations likely correspond to load changes and the EMS's efforts to maintain grid stability without solar input.  
Figure 3 emphasizes the EMS's role in balancing power supply and demand throughout the day, with distinct patterns of battery power fluctuation corresponding to day and night cycles. Understanding these fluctuations is crucial for optimizing battery performance and enhancing the overall efficiency of energy storage systems in managing grid operations.  
These figures and their data provide valuable insights into how the EMS manages battery energy and power to meet grid demands effectively. Analyzing these parameters helps refine EMS strategies for maximizing energy efficiency, grid stability, and overall system performance.