Introduction

Among the most disturbing topics in the status quo is the spread of environmental pollution worldwide1. The primary factor that causes ecological pollution is fossil fuels because of their use in energy production and industrial fields2,3. No doubt, finding a new energy source has become necessary to reduce the use of fossil fuels and their emissions4,5. Among the robust proposed solutions is renewable energy, like solar and wind energy. The demand for renewable energy as an alternative source is growing6,7. Solar energy is one of the most popular sources because it is limitless and spotless to produce energy without harmful emissions8,9. Depending on the photovoltaic (PV) effect, a solar cell converts the irradiation into electrical energy through many physical processes10. Even though all the PV cells have enticing features, their energy conversion efficiency is still relatively low11. Figure 7 shows the power-voltage (P–V) diagram for a PV array, demonstrating the variation of the PV power concerning PV voltage under various amounts of temperature and irradiance. It is clear that only under steady-state environmental conditions does the PV cell provide the highest operating point, called the maximum power point (MPP)9,12,13. To achieve this point, we must employ a critical device known as a maximum power point tracking (MPPT) controller14. Today, researchers worldwide seek to develop and create new methods to extract as much power from PV panels15,16. In the literature8,17,18, we can find various classifications of these MPPT techniques.

Among the classical MPPT techniques, we mention Perturb and observe P&O19,20,21, Incremental Conductance (INC)22,23,24, and Hill Climbing (HC)25,26,27. However, each technique has specific strengths and weaknesses; for example, P&O and HC are simple and require fewer sensors than other techniques28,29. In30, a modified perturbation and observation have been proposed to avoid the drift due to the traditional P&O’s incorrect choice. The INC algorithm was introduced to resolve P&O issues. In31, an improved MPPT strategy based on INC is suggested to increase productivity and efficiency under fast-changing irradiance. Ref32, has been proposed an improved P&O using simulated annealing (SA) algorithm, the proposed algorithm exhibits better performance in varying weather conditions and partial shading Nevertheless, the classical MPPT methods and even those developed are still weak under varying environmental conditions and rapid oscillations around the maximum power.

In terms of dynamic weather-varying conditions, intelligent MPPT techniques33 are often used, including fuzzy logic control (FLC)34,35, artificial neural networks (ANN)36,37,38, adaptive neuro-fuzzy inference systems (ANFIS)39, sliding mode control40, and Gauss–Newton method-based MPPT34. These techniques are very efficient and faster for tracking the MPP. Nevertheless, they require many data sets to train and improve tracking accuracy, especially ANN and ANFIS-based MPPT; their implementation can be challenging.

Recently, bio-inspired algorithms like Particle Swarm Optimization (PSO)41, Genetic Algorithm (GA)42, Grey Wolf Optimization (GWO)43, and Whale Optimization Algorithm44 have been widely used in PV systems to determine the maximum power point, especially under partial shading conditions45. In46 a new MPPT called the slime mold golden sine algorithm was proposed in order to address the partial shading problem, the proposed SMGSA method exhibits superior effectiveness and enhancement. Most of these strategies follow an identical sequence or procedure to accomplish optimization47,48. Although bio-inspired solutions can effectively handle the challenge of partial shading, their efficacy depends entirely on the parameters chosen and the starting conditions49.

Combining bio-inspired algorithms with other MPPT approaches can overcome this restriction in bio-inspired algorithms. In50, an invented P&O with adaptive variable step size based on a PID controller optimized using the Genetic Algorithm was introduced. It shows less oscillation around the MPP and improves efficiency. Ref.51 has suggested a fuzzy logic controller optimized through the cuckoo strategy optimization approach (COA-FLC) for Maximum Power Point Tracking (MPPT) under various meteorological conditions. This COA-FLC has improved the convergence time and minimized the output ripple power. A fractional order based MPPT enhanced using different metaheuristic techniques was suggested in52, The results obtained demonstrated a high level of accuracy and increased robustness.

To avoid such improbable and substantial variations during the transitory phase, researchers proposed a two-level MPPT control architecture53. In54, the ripple correlation control algorithm was the initial loop of control, while the model reference adaptive controller MRAC was the second. The separation of these control algorithms results in the attainment of MPPT while ensuring the entire system’s stability. Another solution is described in55; an improved model reference adaptive controller was associated with incremental conductance. A set of tests and simulations using PSIM and experimental tests are employed to verify the effectiveness of the suggested methodology. However, most plants have PV systems and boost converters, mathematically modeled as second-order systems. Indeed, the performance of traditional MRAC tracking systems could be better for second-order systems. To improve MPPT performance, a novel MRAC structure has been expanded from the first to the second order56.

Nevertheless, one of the significant issues caused by non-linearity is determining MRAC adaptation gains according to specific methods. As described in references57,58, the authors investigated the influence of changing the adaptation gain on the overall system’s performance, including the time response and the oscillation in the response. In this article, meta-heuristic algorithms have been used to overcome this difficulty. Two optimization techniques are applied to tune the parameters of MRAC and improve its dynamic performance, namely the genetic algorithm (GA) and the whale optimization algorithm (WOA)59. In addition, an adaptable Neuro-Fuzzy Inference System (ANFIS) has been employed to produce voltage references for maximum power capacity, which a designed controller subsequently tracks; Fig. 1 illustrates the block diagram of the developed system.

Figure 1
figure 1

The proposed MPPT block diagram for the PV system.

The rest of this paper is organized as follows: Section “Mathematical modeling of photovoltaic array” describes a photovoltaic array's mathematical modeling and the boost converter’s mathematical representation. The neuro-fuzzy network and the proposed optimal model reference adaptive controller, OMRAC, are presented in Section “Dynamics modeling of the DC–DC boost converter”. Section “Proposed MPPT” contains the simulation results, discussion, conclusion, and future work.

Mathematical modeling of photovoltaic array

Single diode model

Several mathematical models illustrating solar panels' operation and performance are documented in the literature. Indeed, real-time simulation requires equivalent circuit modeling of PV cells. The most popular approximate equivalent model researchers use is the single-diode model, as presented in Fig. 2. The used circuit consists of at least four components: a current source IPh, a diode D, a parallel resistor Rp, and a series resistor Rs.

Figure 2
figure 2

PV cell circuit using a single diode model.

According to the single diode equivalent model of the PV cell presented in Fig. 2, the output current IPV can be described as follows60.

$${{\text{I}}}_{{\text{PV}}}={{\text{N}}}_{{\text{p}}}{{\text{I}}}_{{\text{ph}}}-{{\text{N}}}_{{\text{p}}}{{\text{I}}}_{\mathbf{r}\mathbf{s}}.\left[{\text{exp}}\left(\frac{{\text{q}}\left({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}\right)}{{{\text{AkTN}}}_{{\text{s}}}}\right)-1\right]-{{\text{N}}}_{{\text{p}}}\left[{\text{q}}\left(\frac{\left({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}\right)}{{{\text{N}}}_{{\text{s}}}{{\text{R}}}_{{\text{sh}}}}\right)\right],$$
(1)

The reverse saturation current of the cell is referred to as Irs. V denotes the voltage of the cell, whereas Ns indicates the number of PV cells linked in series at the same time. Np indicates the number of photovoltaic cells linked in parallel. K represents the Boltzmann constant, q symbolizes an electron’s charge, T denotes Kelvin’s temperature, and A represents the diode ideality constant. Based on Eq. (2), the irradiance of the sun E and the ambient temperature T are two of the main factors determining the IPh.

$${{\text{I}}}_{{\text{ph}}}=\left[{{\text{I}}}_{{\text{sc}}}+{{\text{k}}}_{{\text{i}}}\left(\mathbf{T}-{{\text{T}}}_{{\text{r}}}\right)\right]\left(\frac{{\text{E}}}{1000}\right),$$
(2)

Ki represents the short-circuit current, T denotes the temperature coefficient of the cell, Isc is the short-circuit current, and E represents the variation in solar radiation. Equation (3) gives the saturation current in cell Irs. A strong correlation exists between temperature and saturation current61,62.

$${{\text{I}}}_{{\text{rs}}}={{\text{I}}}_{{\text{rr}}}{\left[\frac{{\text{T}}}{{{\text{T}}}_{{\text{r}}}}\right]}^{3}{\text{exp}}\left(\left[\frac{{{\text{qE}}}_{{\text{G}}}}{{\text{k}}.{\text{A}}}\right]\left[\frac{1}{{{\text{T}}}_{{\text{r}}}}-\frac{1}{{\text{T}}}\right]\right),$$
(3)

Irr: represents the reverse saturation corresponding to Tr; Tr: is the cell reference temperature; EG: is the band-gap energy of the semiconductor used in the cell.

Triple diode model

The PV cell scheme based triple diode model is illustrated in Fig. 3. This model taken into consideration two additional diodes as in the single diode model63,64. The expression of the output current can be given as following65.

$${{\text{I}}}_{{\text{PV}}}={{\text{N}}}_{{\text{p}}}{{{\text{I}}}_{{\text{ph}}}-{\text{N}}}_{{\text{p}}}{{\text{I}}}_{01}\left({{\text{e}}}^{\frac{{\text{q}}({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}}{{{\text{AKTN}}}_{{\text{s}}}{{\text{n}}}_{1}}}-1\right)-{{\text{N}}}_{{\text{p}}}{{\text{I}}}_{02}\left({{\text{e}}}^{\frac{{\text{q}}({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}}{{{\text{AKTN}}}_{{\text{s}}}{{\text{n}}}_{2}}}-1\right) -{{\text{N}}}_{{\text{p}}}{{\text{I}}}_{03}\left({{\text{e}}}^{\frac{{\text{q}}({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}}{{{\text{AKTN}}}_{{\text{s}}}{{\text{n}}}_{3}}}-1\right)\left({{\text{N}}}_{{\text{p}}}\frac{{\text{q}}({\text{v}}+{{\text{R}}}_{{\text{s}}}{{\text{I}}}_{{\text{PV}}}}{{{\text{N}}}_{{\text{s}}}{{\text{R}}}_{{\text{sh}}}}\right)$$
(4)

where \(I_{01} ,I_{02}\) and \(I_{03}\) denoted to the reverse saturation current of each diode.

Figure 3
figure 3

PV cell circuit using triple diode model.

Dynamics modeling of the DC-DC boost converter

A traditional MPPT algorithm relies on Eq. (4) to determine the converter's duty cycle when the system is stable. On the other hand, the MPPT controller needs to consider the dynamics related to the duty cycle d and the PV voltage VPV to optimize transient responses66,67. When the duty cycle is adjusted to reflect varying environmental circumstances, the MPPT controller should remove any transient fluctuations in the PV voltage68,69,70.

$${{\text{V}}}_{{\text{PV}}}={\left(1-{\text{d}}\right)}^{2}\left({{\text{R}}}_{0}{{\text{I}}}_{{\text{PV}}}\right)$$
(4)

As suggested in71,72, a small signal model of the studied system was considered (Fig. 4) in order to make it easier to analyze how the system responds to changes over time. A resistor R with a small signal PV voltage represents the solar array V̂pv and current I ̂pv throughout its terminals, while battery storage represents the load RO. By ignoring the battery load, the transfer function between the duty cycle d ̂(s) as an input and the array voltage V ̂pv(s) as an output of the system can be described as following72:

Where f (D) is the correlation between a boost converter's voltage at the output array Vo and the operating duty cycle D.

$${{\text{f}}\left({\text{D}}\right)={\text{V}}}_{{\text{PV}}}-\left(1-{\text{d}}\right){{\text{V}}}_{0}$$
(6)
Figure 4
figure 4

PV small signal model coupled to the boost converter.

The first derivation of Eq. (6) can be expressed by:

$$\dot{{\text{f}}}\left({\text{D}}\right)=-{{\text{V}}}_{0},$$
(7)

By inserting Eq. (7) into Eq. (5), we can obtain:

$$\frac{{{\text{V}}_{{{\text{pv}}}} \left( {\text{s}} \right)}}{{{\text{d}}\left( {\text{s}} \right)}} = \frac{{ - {\text{V}}/}}{{{\text{s}}^{2} + \frac{{{\text{L}}1}}{{{\text{RC}}_{1} }}{\text{s}} + \frac{1}{{{\text{LC}}_{1} }}}}$$
(8)

The negative sign in (8) implies that reducing the duty cycle d(s) causes the array voltage to increase. The transfer function depicted previously is derived from a linearized form73. Noteworthy is that C1 and L are identified, while R is unknown. The PV system's operating point (particularly the parameter R) fluctuates as ambient circumstances change quickly74,75. The value of R may be estimated by calculating the slope of the line tangent to point A on the I–V curve shown in Fig. 5 and then taking the inverse of that slope.

Figure 5
figure 5

I-V curve of a solar array while changing R.

$$\frac{1}{{\text{R}}}=-\frac{\mathrm{\Delta I}}{\mathrm{\Delta V}} ,$$
(9)

Proposed MPPT

The proposed MPPT technique in this paper can be divided into three main steps, as depicted in Fig. 6. The first objective is maintaining a constant reference voltage (Vref) from the PV module output using an adaptive neuro-fuzzy controller under fluctuating environmental circumstances.

Figure 6
figure 6

Block diagram of the suggested MPPT technique.

The ANFIS controller employs a relationship between VMPP and (irradiance and temperature) to supply reference peak power voltage. This reference value is compared with the value Vpv to provide an error value sent to the proposed MPPT's second stage. During the second control stage, the MRAC algorithm generates a control input that adjusts the DC–DC converter’s PWM signal. This paper also optimizes this controller using meta-heuristic optimization algorithms to ensure the most efficient dynamic performance of the system.

Reference voltage generation via adaptive neuro-fuzzy algorithm (ANFIS)

To guarantee maximum power from the PV panel to the load, the MPPT controller must constantly check the PV array output voltage. Several methods have been used for calculating or learning the PV array reference peak power voltage. For instance, artificial neural networks (ANN)60, regression plans49,76, Gaussian process regression (GPR)11, and adaptive neuro-fuzzy inference systems (ANFIS)39. This paper uses the Neuro-Fuzzy algorithm to generate/estimate the voltage reference VMPP for the proposed controller.

The curve of PV characteristic change under varying environmental conditions for every single temperature value (T) and irradiance (G) is presented in Fig. 7. The VMPP data was collected using MATLAB/Simulink by adjusting the temperature from 20 to 70 °C while keeping the irradiance constant at 1000 w/m2. Then, we set the temperature to 25°, whereas the irradiance has been varied from 100 to 1000 w/m2. Figure 8 presents the result of these data as a 3-D plane. The structure of the ANFIS model in MATLAB/Simulink for VMPP estimation is depicted in Fig. 9. The neuro-fuzzy estimator comprises temperature (T) and irradiance (G) inputs. The fuzzification layer, which includes ten triangular membership functions assigned to every variable, represents each rule in the output layer as a linear equation77,78.

Figure 7
figure 7

The characteristic curve of a photovoltaic module under varying environmental conditions.

Figure 8
figure 8

3D-plane.

Figure 9
figure 9

The architecture of NeuroFuzzy.

The ANFIS algorithm provides the reference voltage to the development controller. Then, the controller forces the output voltage to track the desired voltage to reach the maximum power point.

Model reference adaptive control (MRAC)

An adaptive controller is, intuitively, one that can adapt its actions based on variations in the process dynamics and the nature of the disturbance79. Several researchers have attempted to define adaptive control in the literature. As shown in Fig. 9, we will use the pragmatic approach in this research, which involves a controller with adjustable parameters and a mechanism that allows these parameters to be adjusted. MRAC systems are designed so that the plant model's output constantly tracks the reference model’s output80,81. The structure of the model consists of a PV system with a boost converter, represented by a second-order transfer function, as shown in Eq. (8). The voltage reference Vref produced by the first level (ANFIS estimator) is regarded as an input to the system, represented as u (t). In contrast, y (t) represents the output. The plant model can be rewritten in the following manner:

$${{\text{G}}}_{{\text{p}}}\left({\text{s}}\right)=\frac{{\text{Y}}\left({\text{s}}\right)}{{\text{U}}\left({\text{s}}\right)}=\frac{{{\text{K}}}_{{\text{p}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+{{\text{b}}}_{{\text{p}}}}$$
(10)

where \({{\text{k}}}_{{\text{p}}}=\frac{-{{\text{V}}}_{0}}{{{\text{LC}}}_{1}}, {{\text{a}}}_{{\text{p}}}=\frac{1}{{{\text{RC}}}_{1}}\mathrm{ and }{{\text{b}}}_{{\text{p}}}=\frac{1}{{{\text{LC}}}_{1}}\)

Figure 10
figure 10

The architecture of the model references adaptive control.

The reference model that guides how the process output should ideally react to the control signal u(t) is given in Eq. (11). Where ym is the desired output, Km represents a positive gain, and am and bm must be selected. The reference model thus offers the suggested solution.

$${{\text{G}}}_{{\text{m}}}\left({\text{s}}\right)=\frac{{{\text{Y}}}_{{\text{m}}}\left({\text{s}}\right)}{{{\text{U}}}_{{\text{c}}}\left({\text{s}}\right)}=\frac{{{\text{K}}}_{{\text{m}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{m}}}{\text{s}}+{{\text{b}}}_{{\text{m}}}}$$
(11)

The controller architecture depicted in Fig. 10 illustrates the approach we will use to achieve the control objective. The control law is described as follows58:

$${{\text{U}}={\uptheta }_{1}{\text{Y}}}_{{\text{c}}}-{\uptheta }_{2}{\text{Y}}={\uptheta }^{{\text{T}}}{\text{w}}$$
(12)

where θ = [θ1, θ2] are the parameters of the controller vector, and ω is described as Y = [Yc, Y]T.

Figure 11
figure 11

Structure of the controller in the proposed OMRAC.

In order to design the adaptation mechanism, MRAC theory uses two basic mathematical techniques. The MIT rule (Massachusetts Institute of Technology) is known as the gradient approach and Lyapunov stability theory. This study has chosen the MIT rule to adjust the controller’s parameters as an adaptation mechanism. By using the MIT rule, the loss function is expressed by:

$${\text{J}}\left(\uptheta \right)=\frac{1}{2}{{\text{e}}}^{2}$$
(13)

where e represents the error obtained by subtracting the plant y output value from the reference model output Ym.

$${\text{e}}={\text{Y}}-{\mathrm{Y }}_{{\text{m}}}$$
(14)

A mathematical equation was developed for updating the parameter θ, based on the assumption that, if the purpose were to minimize the error-related cost, moving towards the negative gradient of J. where J is supposed to change proportionally to θ would be advisable. Therefore, the derivative of θ equals the negative variation in J. Based on the cost function selected above, the following result can be obtained:

$$\frac{\partial\uptheta }{\partial {\text{t}}}=-\Upsilon \frac{\partial {\text{J}}}{\partial\uptheta }- {\Upsilon }_{{\text{e}}}\frac{\partial {\text{e}}}{\partial\uptheta }$$
(15)

Γ and ∂e/∂θ are the system’s adaptation gain and sensitivity derivative, respectively.

The transfer function between the input YC and the plant’s output y is given by:

$$\frac{{\text{Y}}}{{{\text{Y}}}_{{\text{c}}}}=\frac{{{\text{K}}}_{{\text{p}}}{\uptheta }_{1}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)}$$
(16)

Thus, Eq. (14) can be rewritten as follows:

$${\text{e}}=\left[\frac{{{\text{K}}}_{{\text{p}}}{\uptheta }_{1}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)}-\frac{{{\text{K}}}_{{\text{m}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{m}}}{\text{s}}+{{\text{b}}}_{{\text{m}}}} \right]{\mathrm{Y }}_{{\text{c}}}$$
(17)

According to (15), the sensitivity derivatives ∂e/∂θ1 and ∂e/∂θ2 can be described by:

$$\left\{\begin{array}{c}\frac{\partial {\text{e}}}{\partial {\uptheta }_{1}}=\frac{{{\text{K}}}_{{\text{p}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)}{{\text{Y}}}_{{\text{c}}} \\ \frac{\partial {\text{e}}}{\partial {\uptheta }_{2}}=\frac{{{\text{K}}}_{{\text{p}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)}Y\\ \end{array}\right.$$
(18)

In order to ensure a perfect tracking error from this close loop process, we will assume that the time behavior is the same as that of the reference model, as follows:

$${{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)={{\text{s}}}^{2}+{{\text{a}}}_{{\text{m}}}{\text{s}}+{{\text{b}}}_{{\text{m}}}$$
(19)

Therefore, based on the MIT rule, the control parameters are updated as follows:

$$\left\{\begin{array}{c}\frac{\partial {\uptheta }_{1}}{\partial {\text{t}}}=-\Upsilon \left[\frac{{{\text{K}}}_{{\text{p}}}}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{p}}}{\text{s}}+\left({{\text{b}}}_{{\text{p}}}+{{\text{k}}}_{{\text{p}}}{\uptheta }_{2}\right)}\right]e\left({\text{t}}\right) \\ \frac{\partial {\uptheta }_{2}}{\partial {\text{t}}}=-\Upsilon \left[\frac{1}{{{\text{s}}}^{2}+{{\text{a}}}_{{\text{m}}}{\text{s}}+{{\text{b}}}_{{\text{m}}}}\right]e\left({\text{t}}\right)\\ \end{array}\right.$$
(20)

The next step will be to tune the adaptation gain of the MRAC controller by employing two optimization techniques.

Optimization techniques

This section provides two optimizer algorithms, namely GA and WOA, to adjust the adaptation gains of the proposed MRAC structure. It is worth mentioning that both these methods are widely recognized and have been frequently employed for similar applications.

Genetic algorithm (GA)

GA is an algorithm that is based on the population genetics concept. Each solution represents a chromosome, while each parameter corresponds to a gene79,82,83. GA employs an objective (fitness) function to assess the fitness of every single population member. The approach of retaining the most efficient solutions in each generation and utilizing them to generate the following solutions renders this algorithm reliable and proficient in approximating the best possible solution for a given problem84,85. In order to update the population, three genetic processes (selection, crossover, and mutation) are applied after each chromosome has been evaluated through a cost function and assigned a fitness value51. The genetic algorithm (GA) uses a selection operator (Boltzmann selection, Tournament selection, Rank selection, etc.)86 to allocate probabilities to individuals based on their fitness values. It allows for the selection of individuals to create the next generation in proportion to their fitness values. Once individuals are chosen via a selection operator, they must be utilized to produce the new generation. The chromosomes from the male and female genes are merged to generate a novel chromosome; this operation in GA is called crossover87,88. Mutation operators maintain diversity by adding randomness. By using this operator, the GA algorithm avoids local solutions and prevents solutions from becoming similar43,79,89,90.

In this study, the cost function chosen to evaluate the result of each individual in the population is Integral Time Absolute Error (ITAE), where the error (e') can be obtained by subtracting the measured power from the maximum power (denoted Pref), as described in (21):

$${\text{ITAE}}=\int {\text{t}}\left|{{\text{e}}}^{\mathrm{^{\prime}}}\right|\partial {\text{t}}$$
(21)

Figure 11 depicts the procedure for adjusting the parameters of the MRAC controller with GA, which can be outlined using a flowchart, as shown below:

Figure 12
figure 12

Block diagram for tuning of MRAC adaptive gain using GA.

Whale optimization algorithm

Highly intelligent and emotionally complex, whales have long captivated our imagination and inspired scientific research. Humpback whales are one of the most giant baleen whales. One of the most attractive aspects of humpback whales is their distinct hunting technique73. Based on this hunting technique, Mirjalili et al. introduced an innovative swarm intelligence algorithm called the Whale Optimization Algorithm (WOA)59. The humpback whale employs a distinctive hunting mechanism named the bubble net feeding method91. Noteworthy is that the bubble-net feeding method is a distinctive behavior exclusive to humpback whales. The hunting protocol of the humpback whale can be summarized in three steps:

Encircling Prey: Humpback whales can detect the whereabouts of their prey and surround them. In the Whale Optimization Algorithm (WOA), the precise location of the optimal design within the search space has yet to be discovered. Therefore, the algorithm postulates that the current foremost candidate solution is either the target prey or close to the optimal solution. Once the optimal search agent is identified, the remaining search agents adjust their positions toward the optimal search agent. This conduct is mathematically illustrated through the subsequent equations:

$$\overline{{\text{D}} }=\left|\overline{{{\text{X}} }^{*}}\left({\text{t}}\right).\overline{{\text{C}} }\overline{{\text{X}} }\left({\text{t}}\right)\right|$$
(22)
$$\overline{{\text{X}} }\left({\text{t}}+1\right)=\overline{{{\text{X}} }^{*}}\left({\text{t}}\right)-\overline{{\text{D}} }.\overline{{\text{A}} }$$
(23)

In the given equation, t denotes the present iteration, C⃗ and A⃗ serve as coefficient vectors, while X* represents a vector denoting the location of the best solution attained thus far. The process of determining the vectors A⃗ and C⃗ involves the following computations:

$$\overline{{\text{A}} }=2\overline{\mathrm{a }.} \overline{{\text{r}} }-\overline{{\text{a}} }$$
(24)
$$\overline{{\text{C}} }=2\overline{{\text{r}} }$$
(25)

The vector a⃗ gradually decreases linearly, starting by 2–0 over a series of iterations, whereas (r)⃗ is a haphazard vector within the range [0,1].

Attacking Mechanism Using Bubble-Net: Two methods were developed to construct a mathematical representation for the bubble-net procedure of humpback whales: the Shrinking Encircling Mechanism and the Spiral Updating Position method92.

Shrinking encircling mechanism: This conduct can be achieved by decreasing the value of vector a⃗ in the Eq. (24). It is essential to highlight that vector a⃗ narrows the range of fluctuations in vector A⃗. Accordingly, the value of A⃗ inside the range [−a, a]. By assigning random values to A⃗ within the range of [− 1, 1], the search agent’s updated position can be between its original position and the current best agent’s position.

Spiral updating position: The method described in this approach involves computing the distance between a whale, which is positioned at coordinates (X, Y), and the location of its prey, which is located at coordinates (X*, Y*). Hence, a spiral equation is formulated to represent the helix-shaped movement of the whales. This spiral equation is expressed as:

$${\overline{\text{X}}}\left( {{\text{t}} + 1} \right) = \overline{{{\text{X}}^{*} }} \left( {\text{t}} \right) + \left( {\overline{{{{{\rm D}^{\prime}}}}} .{\text{e}}^{{{\text{bt}}}} } \right){ }\cos \left( {2{\pi l}} \right)$$
(26)

While \(\overline{{{{{\text D}^{\prime}}}}} = \left| {\overline{{{\text{X}}^{*} }} - {\overline{\text{X}}}} \right|\) represents how the whale is far away from the prey, where the prey is the best result achieved thus far, the constant b defines the logarithmic spiral’s form. At the same time, l serves as a stochastic number within the interval of [− 1, 1].

In order to simulate the whales’ coordinated movements, it is postulated that there is an even chance of 50% to opt for either the shortening encircling mechanism or the spiral model while the optimization procedure, to alter the whales’ positions simultaneously20,56,93. The mathematical representation of this model is given by:

$${\overline{\text{X}}}\left( {{\text{t}} + 1} \right) = \left\{ {\begin{array}{*{20}c} {\overline{{{\text{X}}^{*} }} \left( {\text{t}} \right) - {\overline{\text{A}}}.{\overline{\text{D}}}, \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,if p \le 0.5} \\ {\overline{{{{{\text D}^{\prime}}}}} .{\text{e}}^{{{\text{bt}}}} \cos \left( {2{\pi l}} \right) + \overline{{{\text{X}}^{*} }} \left( {\text{t}} \right), \,\,\,\,if p \ge 0.5} \\ \end{array} } \right.$$
(27)

In the equation given, the variable p represents a random number within the range of [0 1].

Exploration Phase: During this phase, it is assumed that humpback whales search for prey randomly based on the positions of other whales. The model of this approach is expressed in this manner:

$$\overline{{{{{\text D}^{\prime}}}}} = \left| {{\overline{\text{C}}}.{\overline{\text{X}}}_{{{\text{rand}}}} - {\overline{\text{X}}}} \right|$$
(28)
$$\overline{{\text{X}} }\left({\text{t}}+1\right)={\overline{{\text{X}}} }_{{\text{rand}}}-\overline{\mathrm{A }.}\overline{{\text{D}} }$$
(29)

In the given equation, \(\overrightarrow{X}{}_{rand}\) represents a whale’s haphazardly selected location data from the current iteration.

Using the same fitness function mentioned in (21), Fig. 13 illustrates the flowchart of the WOA.

Figure 13
figure 13

Whale optimization algorithm for tuning MRAC controller.

Simulation results and discussion

To check the effectiveness of the developed ANFIS-OMRAC algorithm-based MPPT, this section was dedicated to simulating and analyzing the entire model system with Simulink, as shown in Fig. 14. The photovoltaic solar panel chosen in this work is the Soltech 1STH-215-P type. PV specifications and the DC–DC boost converter parameters are listed in Table 1. Indeed, GA and WOA are used to tune the MRAC controller design parameters. GA and WOA require fewer input parameters, which is one of the most significant advantages of these algorithms. The specifications for each algorithmic parameter are defined in Table 2. The number of search agents (population size) is relatively small considering the real-time implementation so that the controller may be optimized as quickly as possible. Figure 15 illustrates the objective function performance during computation. The whale optimization algorithm converges faster than the genetic algorithm. The whale optimization algorithm was more effective than the genetic algorithm concerning the convergence rate and accuracy of results. The optimum MRAC adaptation gain appears in Table 3.

Figure 14
figure 14

Implementation of the proposed model using MATLAB/SIMULINK environment.

Table 1 PV system characteristics.
Table 2 GA and WOA parameters.
Figure 15
figure 15

The performance of the objective function during the computation using GA and WOA.

Table 3 The optimum MRAC controller gains.

After the optimal gain has been determined for OMRAC, the controller is used in online mode. Two different scenarios were used to evaluate the proposed MPPT technique. Firstly, under rapidly changing irradiation with a constant temperature. We will consider a uniform irradiance with a fast-changing temperature in the second test. On the other hand, a comparative study between the proposed GA-MRAC and WOA-MRAC, in addition to a conventional MPPT technique well known as incremental conductance (INC), is done in terms of the different indexes are: settling time (ts), Voltage ripple, Power ripple, the efficiency, integral absolute error (IAE) and integral square error (ISE). The efficiency is given by:

$${\text{Efficiency}}=\frac{{\int }_{{{\text{t}}}_{0}}^{{\text{t}}}{{\text{P}}}_{{\text{PV}}}\left({\text{t}}\right){\text{dt}}}{{\int }_{{{\text{t}}}_{0}}^{{\text{t}}}{{\text{P}}}_{{\text{MPP}}}\left({\text{t}}\right){\text{dt}}}$$
(30)

Sudden change in irradiance level with a fixed temperature

In this case, we consider the state of fast-changing irradiation levels, as shown in Fig. 16. We picked an irradiance profile with both step-up and step-down irradiation changes. In contrast, we set the temperature at the steady state, i.e., 25 °C. Figure 17 illustrates the PV power response for each technique used (GA-MRAC, WOA-MRAC, and INC). The MPPT performance depicted in Fig. 17 demonstrates that the settling time (TS) to reach MPP for the INC approach in the first test (Test 1) is 140 ms (ms). The GA-MRAC method takes 3.34 ms, while the WOA-MRAC method only requires 3.25 ms to reach MPP. The proposed optimal model reference adaptive controller (OMRAC) scheme exhibits superior dynamic performance using either GA or WOA. It quickly attains the MPP under irradiance variation and provides lower fluctuations around it throughout all four irradiation tests.

Figure 16
figure 16

Solar irradiance profile.

Figure 17
figure 17

PV array power under variable irradiance for three MPPT techniques.

The proposed OMRAC method provides better power quality than the INC method regarding power ripple. The suggested controller managed to decrease the oscillation around the MPP, as shown in Fig. 18, as well as low voltage fluctuation with an average efficiency of 99.92% for GA-MRAC and 99.65% for WOA-MRAC. Table 4 summarizes the dynamic performance results for each irradiation level applied in detail. Figure 19 illustrates the graphical representation of voltage, power ripple, and tracking efficiency.

Figure 18
figure 18

Power-Voltage characteristics under variable irradiation.

Table 4 Analysis results for variable irradiation test.
Figure 19
figure 19

Comparison evaluation using the graphical representation: (a) Voltage ripple, (b) Power ripple, (c) Tracking efficiency.

Under variable temperature and fixed irradiation

To carry out this case, the irradiation intensity was maintained at 1000 w/m2, while the temperature was manipulated by the temperature profile depicted in Fig. 20. A sudden shift of 10 °C was introduced to the temperature at each stage.

Figure 20
figure 20

Temperature profile.

Figure 21 shows the PV power output during a sudden temperature change using the proposed GA-MRAC and WOA-MRAC compared with the INC MPPT technique. It is worth mentioning that the suggested optimal MRAC exhibited significantly superior performance to INC. The traditional approach required 10.8 ms to monitor the maximum power point, whereas the GA-MRAC reaction time was calculated to be 1.8 ms. The WOA-MRAC MPPT converged in under 1.7 ms. Noteworthy, the OMRAC provides a superior improvement in convergence time under rapidly changing temperatures over all three temperature tests. The voltage Vpv generated by the photovoltaic (PV) array is depicted in Fig. 22; the optimal MRAC offers better VMPP tracking with a small voltage ripple. On the other hand, there is more voltage fluctuation around VMPP for the INC method.

Figure 21
figure 21

PV power output under variable temperature conditions.

Figure 22
figure 22

Power-Voltage curve under variable temperature.

Figure 23 shows the MPPT point tracking by three different algorithms. Accordingly, the suggested algorithm follows the MPP during varying temperature conditions with almost no power ripple.

Figure 23
figure 23

PV voltage output under variable temperature conditions.

Table 5 shows a comparative analysis of the mentioned techniques under various temperature tests regarding settling time (Ts), Voltage ripple, power ripple, efficiency, IAE, and ISE. Addition to a graphical representation analysis to illustrate and support this comparative study is shown in Fig. 24. Through this table and graphic representation, we notice the superiority of WOA-MRAC, followed by GA-MRAC, and finally, the conventional INC technique. Table 6 thoroughly evaluates the most recent cutting-edge MPPT techniques.

Table 5 Analysis results for variable temperature test.
Figure 24
figure 24

Comparison evaluation using the graphical representation under variable temperature: (a) Power ripple, (b) Voltage ripple, (c) Tracking efficiency.

Table 6 Comparison of the several MPPT methods found in the literature.

Conclusions and future research directions

In this work, an innovative two-level maximum power point tracking (MPPT) controller designed for photovoltaic devices is developed. The first level of control includes the implementation of an Adaptive Neuro-Fuzzy (ANFIS) estimator to generate the voltage reference. To improve the MPPT algorithm efficiency even more, we introduced a second level of control using a model reference adaptive controller (MRAC). To optimize the MRAC controller performance, we employed two optimization techniques, Genetic Algorithm (GA) and Whale Optimization Algorithm (WOA), to fine-tune the controller's parameters. The proposed approach can cope with the challenges of quickly changing atmospheric conditions. The efficacy of the developed algorithm was verified through MATLAB/Simulink software. The performance of the innovative GA-MRAC and WOA-MRAC was compared with a conventional MPPT algorithm, namely incremental conductance (INC). Summing up the results, the WOA-MRAC controller exhibited the most excellent performance with the fastest convergence time, high tracking efficiency, and no further fluctuations. We conclude that the two-level MPPT control system shows promise for the optimization of PV systems, especially in dynamic environments where real-time tracking of the maximum power point is critical for energy harvesting.

In the future, several research directions could enhance the development of MPPT control systems for PV systems. Consider investigating alternative optimization algorithms other than genetic algorithms (GA) and whale optimization algorithms (WOA) to enhance the fine-tuning of MRAC parameters and maybe achieve superior outcomes. Evaluating the reliability of the two-level MPPT system in real-world scenarios, including partial shade, aging, and fluctuating load conditions, will offer vital insights into its practical use. Furthermore, combining the two-level MPPT system with additional control techniques like energy storage systems or grid-connected inverters could improve the system’s efficiency and reliability. Hardware prototypes and field tests are crucial for validating the performance of the two-level MPPT system in real-world situations, offering vital input for PV installations in both residential and commercial environments. Future study should prioritize optimizing and testing the two-level MPPT control system in real-world situations and investigating its integration with other control systems to improve performance.