**5. Annual cost model**

The annual cost of the system, *ACS*, is found with the following equation.

$$A\_{\rm cs} = A\_{\rm cc} + A\_{\rm nc} + A\_{\rm cc} + A\_{\rm cc} \tag{6}$$

where *ACC* <sup>=</sup> capital cost, *ARC* <sup>=</sup> replacement costs, *AFC* <sup>=</sup> fuel cost, and *AOC* <sup>=</sup> operating costs.

Each of these categories is described in the following subsections.

#### **5.1. Annual capital cost**

The capital cost is found from the initial costs for the PV array, MT units, BESS, and DG. The PV capital cost is \$1.8 per peak watt of PV power. It is assumed that each solar panel in the array is 2 m<sup>2</sup> with a 20% efficiency, and that the peak radiation intensity is 1000 W/m<sup>2</sup> . This leads to a per-panel capital cost of \$720, with *Ns* panels in the entire array. Each MT unit has an up-front cost, including installation, of \$22,000 (about \$2 per peak watt of wind power) [11, 12]. There are *NW* of these units installed. Each kWh of BESS capacity has a cost of \$300 [11, 12], and the DG cost is approximated by a linear function of the capacity *Dmax*, from \$7000 for a 5 kW capacity to \$14,000 for a 40 kW capacity, based on advertised prices [12]. The DG cost formula is therefore

$$C\_{\rm DG} = \left(D\_{\rm max} - 5 \text{ kW}\right) \left(\frac{\rm 57000}{\rm 35 \text{ kW}}\right) + \rm \rm 7000\,\tag{7}$$

The total up-front capital cost is then the sum of all four terms.

$$\mathcal{C}\_{\text{Cap}} = \\$720 \cdot \text{N}\_s + \\$22\,000 \cdot \text{N}\_w + \\$300 \cdot \text{B}\_{\text{Cap}} + \text{C}\_{\text{DC}} \tag{8}$$

Standard amortization is applied to this capital cost, using an interest rate of *i* = 6%and a project lifetime of *N* = 20 years. The amortization factor is.

$$CRF = \frac{i\,(1+i)^{\aleph}}{(1+i)^{\aleph}-1} \tag{9}$$

This factor is applied to the capital cost to find the annual capital cost as.

$$A\_{\rm cc} = \mathsf{CRF} \cdot \mathsf{C}\_{\rm CAP} \tag{10}$$

#### **5.2. Annual replacement cost**

• If the RER output is less than the load at a given hour, then all of the available RER output is sent to the load (i.e., no battery charging at this hour), and as much power as possible from the battery is used to meet the load if its charge level is above the minimum threshold. If this is not sufficient to meet the load, the generator is used to make up the difference. • If the RER output is greater than the load, then the load is completely satisfied by the RER and no battery power is used for the load. As much charging power as possible is transmitted to the battery if its charge level is less than the upper threshold. Any remaining power

• The generator is turned on if the combined RER and battery power cannot meet the load. If

• There is a possibility of power outage if the combined RER, battery, and DG outputs cannot

*ACS* = *ACC* + *ARC* + *AOC* + *AGC* (6)

it is already running, then it will remain on until the battery is fully charged.

meet the load. Increasing the size of the system reduces this possibility.

The annual cost of the system, *ACS*, is found with the following equation.

from the RER is sent back to the local grid.

**Figure 9.** Diesel generator RER dispatch algorithm.

10 Smart Microgrids

**5. Annual cost model**

The PV and MT components last the full lifetime of the system, but the BESS and DG have shorter lifetimes and therefore need periodic replacement. Replacement costs are found with a sinking fund factor, which computes the amount of money that needs to be annually set aside to pay for periodic replacement of the BESS and DG. The formula for the sinking fund factor is.

$$SFF(N\_{\perp}) = \frac{\dot{i}}{(1+i)^{N\_{\perp}}-1} \tag{11}$$

The lifetime of the component in question is *NL* and the interest rate *i* is the same as that used in the capital recovery factor. The BESS lifetime is 7 years, and the DG lifetime is 15 years. The annual replacement cost is therefore given by.

$$A\_{\rm RC} = \\$300 \cdot B\_{\rm Cap} \cdot SFF(7) + C\_{\rm DC} \cdot SFF(15) \tag{12}$$

#### **5.3. Annual operating costs**

The only component that has significant operating costs is the DG, which requires fuel, oil for lubrication, and periodic maintenance. Each kWh of output from the DG requires 0.13 gallons of diesel fuel at a cost of \$2 per gallon, with an additional maintenance cost of \$0.05/kWh. The simulation produces the hourly output from the DG as P<sup>D</sup> (t), and summing this quantity gives the yearly energy output. For the entire plant lifetime, the total operating cost TOC can therefore be given as follows.

$$T\_{\rm oc} = N \Sigma P\_D(t) \left( 0.13 \frac{\text{gal}}{\text{KWh}} 2 \frac{\text{g}}{\text{gal}} + 0.05 \frac{\text{g}}{\text{KWh}} \right) \tag{13}$$

This quantity can be amortized using the same amortization factor that was applied to the capital cost. This gives an annual operating cost of.

$$A\_{\rm oc} = \,^T\_{\rm oc} \cdot \text{CRF} \tag{14}$$

ity and diesel generation capacity.

**7. Simulation results**

in addition to the battery.

**7.1. Isolated microgrid with no backup**

min

, *Nw*, *BCAP*,*DMAX*

*L BB* ≤ *BCAP* ≤ *U BB <sup>L</sup> BDG* <sup>≤</sup> *DMAX* <sup>≤</sup> *<sup>U</sup> BDG*

*PEN* ≥ *PE NMAX*

where *Ns* is the number of solar panels, *NW* is number of wind turbines, and *BCAP* is battery capac-

The grid-isolated system with no backup is similarly optimized, except that the renewable energy penetration is naturally 100% for this system, since there is no diesel generator backup power used. A modified version of the backup code is used to model the grid-isolated system with no backup. To ensure that there are no power losses, the cost function includes a large cost penalty for each hour of power shortage. With this arrangement, there is no nonlinear constraint function, such that the PSO algorithm can be used. The optimization algorithm chooses a sufficiently large RER system in order to avoid the high cost penalty on the power losses.

The MATLAB simulation results for the optimization are presented in this section, for two versions of the microgrid: grid-isolated with no backup, and grid-isolated with diesel backup. The hourly RER power is generated in the same way for two cases, using hourly TMY profiles for solar radiation and wind speed. **Figure 10** shows an example of the RER power, for 10 wind turbines and 100 solar panels, relative to the combined commercial and residential load. The upper plot in this figure shows hourly RER power produced for the entire year, and the lower figure compares the RER power to the load for 1 week. When RER power output is greater than the load, the excess production can be passed to the battery. When the RER power is less than the load, the battery must make up the deficit completely for the gridisolated with no backup scenario. If the backup is available, then these elements can be used

The dynamic modeling results for the isolated microgrid with no backup are illustrated in **Figure 11**. This figure shows the hourly flows of power from the RER directly to the load, along with the power from the battery to the load. The RER and battery sizes must be large enough to meet the load each hour, and the figure illustrates that the combined RER and battery flows are equal to the load. This constraint forces the RER and battery sizes to be large enough to meet the highest demand in the year, which means that during most of the year the battery is not fully utilized. This fact is demonstrated by **Figure 12**, which shows the battery

*<sup>L</sup> BS* <sup>≤</sup> *Ns* <sup>≤</sup> *<sup>U</sup> BS*

*<sup>L</sup> BW* <sup>≤</sup> *Nw* <sup>≤</sup> *<sup>U</sup> BW*

*ACS*

Renewable Energy Microgrid Design for Shared Loads http://dx.doi.org/10.5772/intechopen.75980

(16)

13

*Ns*

## **6. Optimization problem formulation**

In this section, the objective function is the total annual microgrid cost *ACS* as described in the previous section. This total annual cost is a nonlinear function of the parameters *Ns* , *Nw* , and *BCAP* , and evaluating this function requires execution of the dynamic model.

The nonlinear minimization is achieved with either the particle-swarm optimization (PSO) algorithm or the genetic algorithm (GA). PSO is used in situations in which no nonlinear constraints are needed, while GA is used if there are constraints.

Some of the constraints are simply bounds on the variables. The minimum values for each number cannot be negative, for example, and the upper bounds are chosen to be large enough for the RER to meet a required percentage of the load. The percentage of the annual load that is met by the wind and solar energy is called the renewable energy penetration formed with the following equation:

$$\text{PEN} = \frac{\sum \left[ P\_i(t) \star P\_z(t) \right]}{\sum L(t)} \times 100\% \tag{15}$$

where *P*1 is Power from RER sources, *P*<sup>2</sup> is Power from battery, and *L* is total load.

The system with DG backup has its own dispatch algorithm, which behaves differently than the grid-connected. This is because the DG on/off cycling incurs a maintenance cost. To avoid this, the rules for determining when to turn on and off the DG are designed to minimize the number of DG cycles. To ensure that there are no power losses, the minimum DG size is restricted to be equal to the peak load, such that the DG is capable of supplying the entire load with no RER assistance, if necessary. A nonlinear constraint is used to enforce a minimum RER penetration. The optimization requires the GA, and it is summarized as follows:

$$\begin{array}{c} \min \\ N\_{\mathcal{S}} \ N\_{w^{\mathcal{S}}} \ B\_{\mathcal{C} \text{AP}, D\_{\text{aux}}} \\ L \ B\_{\mathcal{S}} \le N\_{s} \le \text{U} \ B\_{\mathcal{S}} \\ L \ B\_{\mathcal{W}} \le N\_{w} \le \text{U} \ B\_{\mathcal{W}} \\ L \ B\_{\mathcal{B}} \le B\_{\mathcal{C} \text{AP}} \le \text{U} \ B\_{\mathcal{B}} \\ L \ B\_{\mathcal{D} \text{C}} \le \text{D}\_{\text{MAX}} \le \text{U} \ B\_{\mathcal{D} \text{C}} \\ \text{PEN} \ge \text{PE} \ N\_{\text{MAX}} \end{array} \tag{16}$$

where *Ns* is the number of solar panels, *NW* is number of wind turbines, and *BCAP* is battery capacity and diesel generation capacity.

The grid-isolated system with no backup is similarly optimized, except that the renewable energy penetration is naturally 100% for this system, since there is no diesel generator backup power used. A modified version of the backup code is used to model the grid-isolated system with no backup. To ensure that there are no power losses, the cost function includes a large cost penalty for each hour of power shortage. With this arrangement, there is no nonlinear constraint function, such that the PSO algorithm can be used. The optimization algorithm chooses a sufficiently large RER system in order to avoid the high cost penalty on the power losses.
