**3. System Model**

This section proposes a novel method in energy analysis based on microgrid photovoltaic cell data analysis by feature extraction and classification using deep learning techniques (Figure 1a). The energy optimization of the microgrid is carried out using a photovoltaic-based energy system with distributed power generation. The data analysis has been carried out for feature analysis and classification using a Gaussian radial Boltzmann

with Markov encoder model. It is an algorithm for learning that assists individuals in finding intriguing characteristics hidden inside datasets that are made up of binary vectors. In networks with multiple layers of feature detectors, the learning process is often quite slow. However, the pace of the algorithm may be increased by adding a learning layer to the feature detectors in the network. The plug-and-play electric grid is one of the outstanding features of the microgrid since it can operate both independently and cooperatively with the power grids. The structural organization and linkages of the microgrid are shown in Figure 1b. With the capacity to choose the quantity and type of renewable energy sources that may be incorporated into the system, these tiny grids offer energy with improved stability, security, and resilience. It follows that microgrids have the capacity to effectively integrate a variety of diverse sources of distributed power generation, particularly renewable power sources. The microgrid is a small-scale local power system which integrates the clean renewable energy sources (RESs) made up of electric loads, control systems, and distributed energy resources (DERs). Energy storage systems (ESSs) and RERs are both used in a microgrid's power generation or DERs. A new sort of contemporary active power distribution system for the use and advancement of renewable energy is the microgrid.

(b)

**Figure 1.** (**a**) The proposed energy analysis technique. (**b**) Structure of the microgrid.

Photovoltaic-based energy system with distributed power generation:

The method is based on a series of newly developed 3D matrix-based equations that calculate the system's overall load at the time of observation, the amount of power supplied to home DC, SLs from the utility's main DC grid, and the efficiency of the entire system. Let "NT" be number of time samples within the observational period of time "T." The following sets of indices, p q, and r, are provided in Equation (1) throughout the modeling.

$$\begin{array}{c} \{\text{superset or subset}\} = \\ \left\{ \begin{array}{l} p \supseteq P\_{1} = \{1, 2, \dots, x\} \text{or} p \supset P\_{1}' = \{1, 2, \dots, x\} \\ q \supseteq Q = \{1, 2, \dots, y\} \text{or} q \supset Q' = \{1, 2, \dots, y\} \\ r \supseteq R = \{1, 2, \dots, n\} \text{or} r \supset R' = \{1, 2, \dots, n\} \end{array} \right\} \\ L\_{i} = \sum\_{j=1}^{N} |V\_{i}| |V\_{j}| \angle \left( G\_{ij} \cos\left(\varphi\_{i} - \varphi\_{j}\right) + B\_{ij} \sin\left(\varphi\_{i} - \varphi\_{j}\right) \right) \\ M\_{i} = \sum\_{j=1}^{N} |V\_{i}| |V\_{j}| \angle \left( G\_{ij} \sin\left(\varphi\_{i} - \varphi\_{j}\right) - B\_{ij} \cos\left(\varphi\_{i} - \varphi\_{j}\right) \right) \end{array} \tag{1}$$

where "*x*" is the largest number of possible loads in "*y*" and SL at the time "*tn*" has maximum samples ("n") in the system. The number "*x*" of DC loads that exist in the "*y*" MGs at time "*tn*" is shown as (2). It is a huge 3D matrix of order [*x, y*] because each component of the matrix is a column matrix of NT of order 1.

$$\begin{aligned} \mathrm{DC\_{LylG\bar{s}}}(t\_n) &= \left[ \left[ p\_{\mathrm{Dlj}}(t\_n) \right]\_{\mathrm{NT}\times 1} \right]\_{\mathrm{x}\times y} \\ &= \begin{bmatrix} \left[ p\_{\mathrm{D11}}(t\_n) \right]\_{\mathrm{NT}\times 1} & \cdots & \left[ p\_{\mathrm{Dly}}(t\_n) \right]\_{\mathrm{NT}\times 1} \\ \vdots & \ddots & \vdots \\ \left[ p\_{\mathrm{Dx1}}(t\_n) \right]\_{\mathrm{NT}\times 1} & \cdots & \left[ p\_{\mathrm{Dxy}}(t\_n) \right]\_{\mathrm{NT}\times 1} \end{bmatrix} \end{aligned} \tag{2}$$

This is [pD11 (*tn*)]. The power of the first DC load present in the first MG at time "*tn*" is represented by the column matrix NT × 1, which is further enlarged as Equation (3).

$$\begin{aligned} \left[p\_{\text{Dij}}(t\_n)\right]\_{\text{NT}\times 1} &= \begin{bmatrix} p\_{\text{Dij}}(t\_1) \\ p\_{\text{Dij}}(t\_2) \\ \vdots \\ p\_{\text{Dij}}(t\_n) \end{bmatrix}\_{\text{NT}\times 1} \\ \text{AC}\_{\text{L}\_{\text{yMGs}}}(t\_n) &= \left[\left[p\_{\text{Aij}}(t\_n)\right]\_{\text{NT}\times 1}\right]\_{\text{NT}\times 1} \\ \text{I}\_{\text{LyMGs}}(t\_n) &= \left[\left[p\_{\text{Lij}}(t\_n)\right]\_{\text{NT}\times 1}\right]\_{\text{x}\times y} \\ \text{VSD}\_{\text{L}\_{\text{yMGs}}}(t\_n) &= \left[\left[p\_{\text{VSD}ij}(t\_n)\right]\_{\text{NT}\times 1}\right]\_{\text{x}\times y} \end{aligned} \tag{3}$$

Equation (4) provides a matrix that includes rated power of converters connected to appropriate loads.

$$(\text{DC/DC})\_{\text{rating}}(t\_{\text{n}}) = \left[ \left[ p\_{\text{rDij}}(t\_{\text{n}}) \right]\_{\text{NT} \times 1} \right]\_{\text{x} \times y} \tag{4}$$

Efficiency of the converter is evaluated as (5). The coefficients matrices' generalized form is provided by (4). An efficiency-based 3D matrix can finally be displayed as (4). Similar matrices would be created for converters connected to A and VSD loads.

$$\eta\_{\text{dd}\_{\mathcal{Y}}}(t\_n) = a\_{nij}(t\_n) \cdot \begin{pmatrix} \frac{p\_{\text{Dj}}(t\_n)}{p\_{\text{Dj}}(t\_n)} \end{pmatrix}^n + a\_{(n-1)ij}(t\_n) \cdot (\cdot \cdot \cdot)^{n-1} + \cdots + \\\ a\_{0ij}(t\_n) \cdot (\cdot \cdot \cdot)^0 \\\ a\_{nij}(t\_n) = \begin{bmatrix} a\_{n11}(t\_n) & \cdots & a\_{n1y}(t\_n) \\ \vdots & \ddots & \vdots \\ a\_{n11}(t\_n) & \cdots & a\_{n1y}(t\_n) \end{bmatrix} = \begin{bmatrix} a\_{nij}(t\_1) \\ a\_{nij}(t\_2) \\ \vdots \\ a\_{nij}(t\_n) \end{bmatrix}. \tag{5}$$

$$\eta\_{\text{(DC/DC)}}(t\_n) = \left[ \begin{bmatrix} \eta\_{\text{dd}\_{ij}}(t\_n) \end{bmatrix}\_{\text{NT}\times 1} \right]\_{x \times y}$$

Since each SL has its independent solar energy structure, therefore a PEC converter with an MPPT base connects it to the storage system. Solar energy can be expressed as Equation (6).

$$\begin{aligned} p\_{\text{solar}}(t\_{\text{s}}) &= \left[ \left[ p\_{\text{sj}}(t\_{\text{s}}) \right]\_{\text{NT}\times 1} \right]\_{y\times 1}^{\*} \\ p\_{\text{S,MGs}}(t\_{\text{s}}) &= \left[ \lambda\_{\text{SD}j} \right]\_{1\times y} \left[ \beta\_{\text{j}}(t\_{\text{s}}) \right]\_{y\times \text{NT}} \left[ \left[ t\_{\text{sm}} \cdot \cdot t\_{\text{s0}} \right]\_{\text{NT}\times 1} \right]^{t} \end{aligned} \tag{6}$$

In Equations (7) and (8), the first matrix is a matrix of conversion factors, the next matrix is a matrix of coefficients obtained from the fitting of curves, and the final matrix is a transposed time matrix with some power.

$$\begin{bmatrix} \left[\lambda\_{\text{SD}-j}\right]\_{1\times y} = \begin{bmatrix} \lambda\_{\text{SD}-1} & \lambda\_{\text{SD}-2} & \cdots & \lambda\_{\text{SD}-y} \end{bmatrix}\_{1\times y} \\\\ \left[\beta\_{j}(t\_{n})\right]\_{y\times\text{NT}} = \begin{bmatrix} \beta\_{m1}(t\_{n}) & \cdots & \cdot & \cdot\\ \vdots & & \ddots & \\ & & \beta\_{01}(t\_{n}) & \\ & & & \vdots\\ & & & \beta\_{m9}(t\_{n}) \cdot \cdot \beta\_{09}(t\_{n}) \end{bmatrix}\_{y\times\text{NT}} \\\\ \beta\_{nj(t\_{n})} = \begin{bmatrix} \beta\_{nj(t\_{1})} \\ \beta\_{nj(t\_{2})} \\ \vdots \\ \beta\_{nj(t\_{n})} \end{bmatrix}\_{\text{NT}\times 1} \\\\ \left[t\_{\text{sm}} \cdot \cdot t\_{s0}\right]^{t} = \left[\left[t\_{1m}^{m} \cdot \cdot t\_{nm}^{m}\right] \cdot \left[t\_{10}^{0} \cdot \cdot t\_{n0}^{0}\right]\right]^{t} \\\\ \beta\_{i}R\_{x} = \frac{V\_{V}}{N\_{i}} \left[\sin\varphi\_{ij}\right] \\\\ \Omega\_{i,R\_{x}=0} \approx \frac{V\_{V}^{2} - V\_{V}\dot{\gamma}\cos\varphi\_{ij}}{X\_{i}} \\\\ \left[\frac{f\_{D}}{f\_{Q}}\right] = \begin{bmatrix} \cos(qi) & -\sin(qi) \\ \sin(qi) & \cos(qi) \end{bmatrix} \begin{bmatrix} f\_{d} \\ f\_{q} \end{bmatrix} \end{bmatrix} \tag{8}$$

Distributed secondary control layers are used as shown in Equation (9) to adjust frequency and voltage anomalies.

$$\begin{cases} \overline{\omega\_{avg}} = \frac{\sum\_{i=1}^{N} \omega\_{DGi}}{\omega\_{i} = \left(\omega\_{ref} - \overline{\omega\_{avg}}\right)}\\ \omega\_{i} = \left(\omega\_{ref} - \overline{\omega\_{avg}}\right) \\ \omega\_{i} = k\_{pf}\omega\_{i} + k\_{if}\int \omega\_{i}dt \end{cases} \tag{9}$$

Equation (10) can be used to express load voltage regulation methods.

$$sV\_{\rm i} = k\_{pf}V\_{\rm i} + k\_{if} \int V\_{\rm i}dt\tag{10}$$

From measured output current and voltage, instantaneous power is written as *p* = *v*odi*i*·*iodi* + *v*oqi*i*·*i*oqi*i* and *q* = *v*odi.*i*oqi*<sup>i</sup>* − *v*oqi*i*·*i*odi. By linearization, a tiny signal that represents active power is generated as shown in (11).

$$\begin{aligned} \Delta P\_i &= -\omega\_{ci} \Delta P\_i\\ +\omega\_{ci} \left( I\_{odi} \Delta v\_{odi} + I\_{oqi} \Delta v\_{oqi} + V\_{odi} \Delta i\_{odi} + V\_{oqi} \Delta i\_{oqi} \right) \\\ v\_{o\text{dqi}} &= \left[ \begin{array}{c} v\_{\text{odi}} & v\_{\text{oqi}} \end{array} \right]^T \dot{\iota}\_{o\text{dqi}} = \left[ \begin{array}{c} i\_{\text{odi}} & i\_{\text{oqi}} \end{array} \right]^T \end{aligned} \tag{11}$$

Equation (12) can be used to define the algebraic modeling for the voltage controller and current controller,

$$\begin{aligned} i^\* \quad & \mathbf{i}^\* \quad \mathbf{l}\_{lii} = \mathbf{F}\_{\mathbf{i}} \cdot \mathbf{v}\_{odi} - \omega\_b \cdot \mathbf{C}\_{fi} \cdot \Delta \mathbf{v}\_{oqi} + \mathbf{K}\_{PVi} (\mathbf{v}^\*\_{odi} - \mathbf{v}^\*\_{odi}) + \mathbf{K}\_{IVi} \mathbf{q}\_{di} \\\ i^\* \quad & \mathbf{i}^\* \quad \mathbf{l}\_{lqi} = \mathbf{F}\_{\mathbf{i}} \cdot \mathbf{v}\_{oqi} + \omega\_b \cdot \mathbf{C}\_{fi} \cdot \Delta \mathbf{v}\_{oqi} + \mathbf{K}\_{PVi} (\mathbf{v}^\*\_{oqi} - \mathbf{v}^\*\_{oqi}) + \mathbf{K}\_{IVi} \mathbf{q}\_{qi} \\\ & \mathbf{v}^\* \quad \mathbf{i} di = -\omega\_b \cdot \mathbf{L}\_{fi} \cdot \mathbf{i}\_{lqi} + \mathbf{K}\_{PCi} (i^\* ldi - \mathbf{i}\_{ldi}) + \mathbf{K}\_{IC} \cdot \gamma\_{di} \\\ & \mathbf{v}^\* \quad \mathbf{i}\_{lqi} = \omega\_b \cdot \mathbf{L}\_{fi} + \mathbf{K}\_{PCi} \left(\mathbf{i}^\* \quad lqi - \mathbf{i}\_{lqi}\right) + \mathbf{K}\_{IC} \cdot \Delta \gamma\_{qi} \end{aligned} \tag{12}$$

$$\begin{split} \frac{d i\_{ldq}}{dt} &= -\frac{R\_{fi}}{\mathbf{L}\_{fi}} \cdot i\_{ldq\dot{i}} + \omega\_{\dot{\imath}} \cdot i\_{ldq\dot{i}} + \frac{1}{\mathbf{L}\_{fi}} \cdot v\_{idq\dot{i}} - \frac{1}{\mathbf{L}\_{fi}} \cdot v\_{odq\dot{i}}\\ \frac{d v\_{odq\dot{i}}}{dt} &= \omega\_{\dot{\imath}} \cdot v\_{oqq\dot{i}} + \frac{1}{\mathbf{C}\_{fi}} \cdot i\_{ldq\dot{i}} - \frac{1}{\mathbf{C}\_{fi}} \cdot i\_{odq\dot{i}}\\ \frac{d i\_{\rm odq\dot{i}}}{dt} &= -\frac{R\_{ci}}{L\_{ci}} \cdot i\_{\rm odq\dot{i}} + \omega\_{\dot{\imath}} \cdot i\_{\rm odq\dot{i}} + \frac{1}{L\_{ci}} \cdot v\_{\rm od\dot{i}q} - \frac{1}{L\_{ci}} \cdot v\_{\rm obd\dot{q}} \end{split} \tag{13}$$

By using reverse transformation, Equation (14) transforms bus voltage back into an *i*th specific inverter reference frame.

$$\begin{aligned} \left[\Delta\mu\_{\text{Muq}}\right] &= \left[T\gamma^{-1}\right] \cdot \left[\Delta\mu\_{b\text{DQ}}\right] + \left[T\_{\sigma}^{-1}\right] \left[\Delta\delta\right], \text{ where, } T\_{\sigma}^{-1} = \\\begin{bmatrix} -\mathcal{U}\_{bD}\text{sin}(\delta) + \mathcal{U}\_{bQ}\text{cos}(\delta) \\ -\mathcal{U}\_{bD}\text{cos}(\delta) - \mathcal{U}\_{bQ}\text{sin}(\delta) \end{bmatrix} \end{aligned} \tag{14}$$

P-N junction diodes are utilized in the structure of the PV module. As they are semiconductor devices, they can convert the energy that is taken in into usable electrical power. These diodes can convert incident light into electrical energy when it reaches their surface. Figure 2 depicts the basic construction, connections, and functionality of a PV module:

**Figure 2.** Working of Photovoltaic.

As seen in the image below, there exist two distinct layers of silicon: a negative N layer and a boron-doped positive P layer. The PV module clad with tempered glass captures solar energy when subjected to sunlight. The energy collected eventually rises above the band gap energy level, causing electrons to pass across that band on their way from the conduction band to the valence band. The conduction band's electrons can therefore move freely and create electron–hole pairs. The electricity generated during the process is used to power the load because the motion of electrons is what causes the passage of electric current. An array configuration is not sufficient to produce enough electricity because it suffers from multiple losses. The maximum power point tracking (MPPT) technique is the best way to maximize each string's efficiency. By employing such control strategies, PV modules can produce the maximum amount of electricity achievable.
