5.1.2. Cost Layer

In the cost layer, only some components of the EES are relevant from the cost perspective. AC loads are not considered as a "variable," as they are assumed to be given upfront in terms number and type; as such, they are not associated with a cost model, as they do not contribute to the overall economic evolution. Therefore, loads are an input of the system; i.e., a trace of the input power demand over time.

Another difference with respect to the power layer is that all costs connect to the grid; i.e., the costs of buying/selling energy to the grid, are taken into account *inside the cost bus*; it is not, therefore, necessary to include a specific component for the grid.

Thus, the cost layer features three components: the two power sources (i.e., the wind turbine and the PV array) and the energy storage (battery pack). Table 2 reports all cost information for such components. All components model their initial and time-dependent capital costs (Equations (1) and (2) or (4)) and their operation and maintenance cost (Equation (5)). Note that the operation and maintenance cost is expressed in terms of \$/kW/Year, as it considers the annual routine operating and maintenance costs, and not accidental inside parts replacement. The interest rate used in Equation (3) is 7% for all components, and the CRF is thus set as 0.094.

The main difference between the models of the components is in terms of their time-dependent capital cost:


The *cost bus* estimates the total electricity cost with Equation (6), plus the net cost and the annualized cost, as defined in Equations (7) and (8). In our analysis, electricity price depends on the kind of operation (i.e., buying or selling) and on the time slot of the day, as shown in Table 3. Electricity buying price *pE*,*buy* is initially defined in three time slots, with the highest price at peak demand hours of the day. Electricity selling price *pE*,*sell* is instead independent of time and is much lower than *pE*,*buy*.


**Table 3.** Electricity prices in different time of the day, as defined in [53].

## 5.1.3. One-Month Example Simulation Traces

In order to illustrate the different quantities that can be trace with the proposed simulation framework, we extract one-month simulation results of the prototype EES configured as shown in Table 1. For the simulation, the environmental traces used are relative to the observation site of MIDC at the University of Arizona [51], which has dry and windy weather all year long, with up to 90% sunny days.

## Evolution of the Power Layer

Figure 6 depicts the evolution of the prototype EES in the initial 30 days by focusing on the power layer. Plot *A* shows the evolution of the environmental traces, in terms of solar irradiance (blue line) and wind speed (orange line), while plot *B* shows the power production of the corresponding power sources (same colors as in *A*). Plot *C* shows residential load demand over time. Plots *D* and *E* show the results of the application of the power bus policy in terms of state of charge (SOC) over time of the battery (*D*) and power balance in the system that leads to buying or selling energy.

**Figure 6.** One-month long simulation of the EES in terms of power tracing quantities. The solar irradiance and wind profiles shown in (**A**) illustrate different daily weather conditions; the corresponding power generation by PV array and wind turbine indicated by (**B**); (**C**) reports the load power consumption of the whole residential community; battery SOC profile is shown in (**D**), within its operating range from 10% to 90%; the interactions with utility grid to buy or sell energy due to the energy surplus and deficit are illustrated in (**E**).

Evolution of the Cost Layer

The corresponding cost information evolution is shown in Figure 7, which reports one subplot per cost equation described in Section 3.2.1. The plots refer to the aggregate cost for all components, as determined by the cost bus, to provide a global view of the system rather than focusing on single components.

The plots in *A* and *B* show the global evolution of the time-dependent capital cost and of the operation and maintenance cost over time, respectively, as in Equations (2) and (5). Such graphs linearly grow over time, as the system components' values decrease over time and maintenance is necessary to allow their correct operation.

The graphs in *C*-*E* are used to comment on the instantaneous electricity cost, dropped down into money spent to buy electricity from the grid (*C*), and money earned by selling to the grid (*D*). Such graphs reflect the application of the policy implemented by the power bus. For the sake of readability, we report in *E* the evolution of the battery SOC: from this plot, it is evident that electricity is bought from the grid when the battery is discharged (*SOC* < 10%) and the loads demand too much power, and that electricity is vice versa sold to the grid when power sources can feed the loads and the battery is fully charged (*SOC* > 90%).

Plot *F* shows the total net cost, as from Equation (7), that grows almost linearly over time, as a result of the sum of electricity cost with the time-dependent capital cost and operation and maintenance cost of all components.

Plot *H* reports the evolution of profit over time (Equation (9)) that mitigates net cost by considering the intrinsic benefit generated by using the produced green energy (reported in plot *G*), rather than satisfying the entire load demand by buying from the grid. As the graph reports, exploiting renewable power sources generates a positive advantage for the EES: profit tends to grow linearly over time. The decreasing periods correspond to time slots when it was necessary to buy electricity from the grid, as the battery SOC was equal to 10% and renewable energy could not feed the loads (e.g., in the daytime of 6th and 20th days, or in the nighttime between the 9th and the 10th day).

**Figure 7.** Evolution of the different cost quantities referring to the overall EES system and to the snapshot of simulation reported in Figure 6: time-dependent capital cost ( **A**); operation and maintenance cost (**B**); electricity cost, divided into buy cost ( **C**) and sell cost ( **D**); SOC evolution of the battery (**E**); net cost (**F**); benefit generated by using power sources to feed the loads ( **G**); and profit ( **H**).

Evolution of Component-Specific Costs

Figure 8 reports the detailed evolution of time-dependent capital cost and *O* & *M* cost for each component in the EES.

**Figure 8.** Time-dependent capital cost and *O* & *M* cost of the PV array ( **A**), the wind turbine (**B**), the battery bank ( **C**) and SOH and battery current profile ( **D**) referring to the snapshot of simulation reported in Figure 6.

The time-dependent capital cost evolves linearly for the PV installation, A, and the wind turbine, *B*, which have a constant depreciation over time, according to Equation (2). The time-dependent capital cost of the battery (*C*) reflects the capacity loss over time, as it is calculated with the wear-out Equation (4). The *full cycle equivalent* battery pack aging mode [41] is adopted in our simulation, which correlates (Equation (10)):

$$N\_{\rm cyc} = \frac{\int\_0^T |I(t)|dt}{2 \ast C\_{\rm nonw}} \text{ and } L = \frac{N\_{\rm cyc}}{N\_{\rm cyc, max}} \tag{10}$$

where *effective number of cycles Ncyc* is an amount of charging and discharging energy divided by a nominal battery capacity *Cnom*; *Ncyc* divided by the *maximum charging and discharging cycles of the battery Ncyc*,*max* indicates the lost capacity (L).

We define 1 − *L* as the state of health (SOH) of the battery pack; the real-time available battery pack capacity is thus computed by *SOH* × *Cnom*. The SOH profile shown in *D* illustrates the available capacity decreases based on the battery charging/discharging current, whereas it keeps stable when there is no current flow in the battery pack (blue line in *D*); e.g., during the night between 5th and 6th days; then results the time-dependent cost also do not change during such period (Orange line in *C*).

The operation and maintenance cost grows almost linearly for all components, in a way that is linearly proportional to the unit operation and maintenance costs listed in Table 2; i.e., 10 \$/kW/Year for the battery pack and 15 \$/kW/Year for the other components. However, the cost growth is strictly related to the power handled by the component over time. This is clear from the plot in *A*, as the *O*&*M* cost of the PV module has approximately a stair-case waveform shape. This happens because at night there is no PV power production, and thus no increase in the *O*&*M* cost. Concerning the *O*&*M* cost of the battery, it shows itself to be similar to its time-dependent cost due to there being no power value sent to the cost layer during the battery pack idle period.
