## 4 Simulation Results  
In this work, we considered a real case study to evaluate the performance of the proposed optimal energy management algorithm. The real data for the demand load profile of the engineering building 2-7, Chonbuk National University, Jeonju Campus, South Korea were obtained during a working day. We considered five different scenarios with different system configurations, as given in Table 2. We assumed the time slot size was set to be 15 min, the ESS capacity was set to 50 kWh, and the \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**PriorityParameter** & \(t_{stuy}\) [h] & **SoC [\%]** & \(d_{trip}\) [km] & \(B_{er}\) [kWh] \\ \hline HIGH [3] & \(t_{stay}\leq 3\) & SoC \(\leq 20\) & \(30\leq d_{trip}\) & - \\ MIDDLE [2] & \(3<t_{stay}<6\) & \(20<\) SoC \(<80\) & \(10<d_{trip}<30\) & \(30\leq B_{er}\) \\ LOW [1] & \(6\leq t_{stay}\) & \(80\leq\) SoC & \(d_{trip}\leq 10\) & \(B_{er}<30\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Priority definition. charging and discharging power of ESS was 6.6 kWh. The output power of the PV system was based on Reference [30]. Simulation parameters and assumptions are given in Table 3.  
Three types of EVs (Hyundai BlueOn, Kia Soul and Nissan Leaf Zeo) with different battery capacities (16.4 kWh, 27 kWh and 30 kWh) were considered [31], as given in Table 4. The charging and discharging power for each EV was set to 3.6 kWh. The charging and discharging efficiency were configured as 0.90 and 0.85, respectively. The driver behavior regarding arrival time, departure time, and driving range is given in Table 5. The electricity cost of Korea Electric Power Corporation (KEPCO) during the summer season is shown in Table 6. We considered the electric rate of an educational tariff with option two [32]. We used C++ programming language for our real-time algorithm. Also, we used Qt Creator which is a cross-platform C++, JavaScript and QML integrated development environment which is part of the software development kit (SDK) for the graphical user interface (GUI). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Category** & **Time Period** & **Educational Tariff, Option Two** \\ \hline Off-peak & 23:00–09:00 & 49.800 KRW/kWh \\ Mid-peak & 09:00–10:00 and 12:00–13:00 and & \\  & 17:00–23:00 & 94.200 KRW/kWh \\ On-peak & 10:00–12:00 and 13:00–17:00 & 160.400 KRW/kWh \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Electricity cost of KEPCO (Korea Electric Power Corporation) during the summer season [32]. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Value** \\ \hline Time slot size & 15 min & 96 time slots in a day \\ Building electricity consumption & & Real load profile \\ Photovoltaic output & 0-30 kWh & Ref. [30] \\ ESS capacity & 50 kWh & Ref. [29] \\ Charging ratio of ESS & 6.6 kWh & Efficiency \(\eta\) = 0.90 \\ Discharging ratio of ESS & 6.6 kWh & Efficiency \(\eta\) = 0.85 \\ Charging ratio of EVSE & 3.6 kWh & Efficiency \(\eta\) = 0.90 \\ Discharging ratio of EVSE & 3.6 kWh & Efficiency \(\eta\) = 0.85 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation parameters and assumption; EVSE: electric vehicle supply equipment. \begin{table}
\begin{tabular}{c c c} \hline \hline
**EV Types** & **Battery Capacity (kWh)** & **Max Range (km)** \\ \hline Hyundai BlueOn & 16.4 & 140 \\ Kia Soul \(EV\) & 27 & 150 \\ Nissan Leaf—ZE0 & 30 & 172 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: EV specification [31]. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer Behavior** & **Value** \\ \hline Average arrival time & 8:30 a.m. & PDF: \(\mu\) = 34, \(\sigma\) = 4 \\ Average departure time & 6:30 p.m. & PDF: \(\mu\) = 68, \(\sigma\) = 8 \\ Average daily driving range & 30 km & PDF: \(\mu\) = 30, \(\sigma\) = 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Driver behavior; PDF: probability density function.