MATLAB Implementation of GA Tuned ANFIS MPPT for Solar PV System
MATLAB Implementation of GA Tuned ANFIS MPPT for Solar PV System
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
Maximum Power Point Tracking (MPPT) is an essential control technique used in solar photovoltaic systems to extract the highest possible power under changing environmental and operating conditions.
GA Tuned ANFIS MPPT for Solar PV System

This implementation combines Genetic Algorithm (GA) optimization with an Adaptive Neuro-Fuzzy Inference System (ANFIS) to create an intelligent MPPT controller for a solar PV system in MATLAB/Simulink.
The main idea is simple:
Solar irradiance and temperature are supplied to the trained ANFIS controller.
ANFIS predicts the required maximum power point voltage, Vmpp.
The predicted voltage is compared with the actual PV voltage.
A controller generates the appropriate duty cycle.
A PWM generator controls the boost converter.
The PV array is continuously operated near its maximum power point.
This approach is suitable for students, researchers, and engineers interested in solar PV modeling, intelligent MPPT techniques, ANFIS control, genetic algorithms, and MATLAB/Simulink implementation.
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete MATLAB/Simulink model consists of the following major sections:
Solar PV panel
Irradiance and temperature inputs
PV voltage and current measurement
GA-trained ANFIS MPPT controller
Voltage error calculation
PI controller
PWM generator
DC–DC boost converter
Variable resistive load
PV and load measurement blocks
Voltage, current, and power monitoring
The overall control structure is designed to ensure that the PV panel delivers maximum available power even when the irradiance or load condition changes.
𝐒𝐨𝐥𝐚𝐫 𝐏𝐕 𝐏𝐚𝐧𝐞𝐥 𝐏𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬
The PV panel considered in the simulation has a rated power of approximately 250 W.
Parameter | Value |
Maximum power | 250.2 W |
Open-circuit voltage, Voc | 37.3 V |
Voltage at maximum power point, Vmpp | 30.7 V |
Short-circuit current, Isc | 8.66 A |
Current at maximum power point, Impp | 8.15 A |
Nominal irradiance | 1000 W/m² |
Nominal temperature used in the Simulink test | 25°C |
PV configuration | 1 module, 1 parallel string |
In addition to these electrical parameters, the PV model also considers:
Current temperature coefficient
Voltage temperature coefficient
Irradiance variation
Temperature variation
These parameters are required to represent the behavior of the PV module under different atmospheric conditions.
𝐀𝐍𝐅𝐈𝐒 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐃𝐚𝐭𝐚 𝐆𝐞𝐧𝐞𝐫𝐚𝐭𝐢𝐨𝐧
Before implementing ANFIS MPPT in Simulink, suitable training data must be generated.
The training dataset contains two input variables:
Solar irradiance
PV module temperature
The required output is:
Voltage at maximum power point, Vmpp
Training Data Structure
Category | Variable |
Input 1 | Solar irradiance |
Input 2 | Temperature |
Output | Maximum power point voltage |
Approximate number of generated samples | 1000 |
Random operating conditions are created between selected minimum and maximum values of:
Irradiance
Temperature
For each operating condition, the corresponding PV maximum power point characteristics are calculated.
The resulting information is stored as a PV data matrix for ANFIS training.
𝐖𝐡𝐲 𝐔𝐬𝐞 𝐀𝐍𝐅𝐈𝐒 𝐟𝐨𝐫 𝐌𝐏𝐏𝐓?
ANFIS combines important features of:
Artificial neural networks
Fuzzy inference systems
This allows the controller to learn the nonlinear relationship between environmental conditions and the optimum PV operating voltage.
For this MPPT implementation:
Inputs → Irradiance + Temperature
Output → Reference maximum power point voltage
Once properly trained, ANFIS can quickly estimate the appropriate PV reference voltage for new irradiance and temperature conditions.
𝐖𝐡𝐲 𝐆𝐞𝐧𝐞𝐭𝐢𝐜 𝐀𝐥𝐠𝐨𝐫𝐢𝐭𝐡𝐦 𝐓𝐮𝐧𝐢𝐧𝐠?
The Genetic Algorithm is used to improve the ANFIS training process.
Instead of relying only on conventional ANFIS parameter adjustment, GA searches for improved parameters using a population-based optimization process.
The general GA training procedure includes:
Initial population generation
Fitness evaluation
Selection of better solutions
Crossover
Mutation
Repeated optimization
Selection of the best ANFIS parameters
In this implementation, the optimization is executed for a large number of iterations to obtain an accurately trained inference system.
GA/Training Parameter | Value/Description |
Optimization method | Genetic Algorithm |
Intelligent model | ANFIS |
Maximum GA iterations | 1000 |
Training inputs | Irradiance and temperature |
Training output | Vmpp |
Final output | Trained fuzzy inference system |
𝐆𝐀-𝐓𝐮𝐧𝐞𝐝 𝐀𝐍𝐅𝐈𝐒 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The complete training procedure can be understood in a few steps.
Step 1 – Define PV Parameters
The electrical parameters of the selected 250 W PV panel are initialized.
These include:
Voc
Isc
Vmpp
Impp
Temperature coefficients
Standard irradiance
Reference temperature
Step 2 – Generate Environmental Conditions
Different values of irradiance and temperature are generated over the selected operating range.
Step 3 – Calculate Maximum Power Point Data
For every irradiance-temperature combination, the corresponding maximum power operating point is identified.
Step 4 – Prepare the Dataset
The data are organized as:
Irradiance
Temperature
Target Vmpp
Step 5 – Generate Initial Fuzzy Inference System
An initial fuzzy inference structure is created using the training dataset.
Step 6 – Optimize ANFIS Using GA
The Genetic Algorithm optimizes the parameters of the ANFIS model.
Step 7 – Validate the Controller
The trained ANFIS is evaluated using:
Training data
Independent test data
Step 8 – Export the Trained FIS
The optimized fuzzy inference system is finally exported and used inside the Simulink MPPT controller.
𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐚𝐧𝐝 𝐓𝐞𝐬𝐭𝐢𝐧𝐠 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞
Training performance is checked by comparing:
Target Vmpp
ANFIS predicted Vmpp
The same evaluation is carried out using test data that were not directly used to optimize the controller.
The observed results show that:
Target and predicted responses are almost completely superimposed.
Prediction error remains extremely small.
Training and testing behavior are closely matched.
The optimized ANFIS successfully learns the nonlinear PV relationship.
Performance indicators considered include:
Mean Square Error
Root Mean Square Error
Mean error
Error standard deviation
The displayed training and testing plots show error values approaching numerical precision, indicating very close agreement between the target and ANFIS output for the evaluated dataset.
𝐒𝐢𝐦𝐮𝐥𝐢𝐧𝐤 𝐌𝐨𝐝𝐞𝐥 𝐒𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞
The trained controller is integrated with the solar PV system in MATLAB/Simulink.
The signal flow is:
PV Panel → Boost Converter → Load
while the control path is:
Irradiance + Temperature → GA-Trained ANFIS → Vmpp Reference → Voltage Controller → PWM → Boost Converter
This architecture allows the intelligent MPPT controller to continuously determine the optimum operating voltage.
𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲
The control operation is based on reference voltage tracking.
1. Environmental Inputs
ANFIS receives:
Irradiance
Temperature
2. Vmpp Prediction
The trained controller generates the required maximum power point voltage reference.
3. PV Voltage Measurement
The actual voltage of the PV panel is measured continuously.
4. Voltage Comparison
The measured PV voltage is compared with the ANFIS-generated reference voltage.
5. PI Control
The resulting voltage error is processed by the PI controller.
6. Duty-Cycle Generation
The PI controller determines the required boost converter duty cycle.
7. PWM Generation
The PWM block converts the duty-cycle command into switching pulses.
8. Boost Converter Control
The switching signal controls the semiconductor device of the DC–DC boost converter.
As a result, the PV operating point is moved toward the maximum power point predicted by the GA-trained ANFIS.
𝐁𝐨𝐨𝐬𝐭 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧
The DC–DC boost converter acts as the power-processing interface between the PV module and the load.
Major components include:
Input inductor
Controlled semiconductor switch
Diode
Input/output capacitors
Load resistance
PWM switching circuit
The ANFIS controller does not directly switch the converter.
Instead:
ANFIS predicts Vmpp → Controller calculates duty cycle → PWM generates pulses → Boost converter changes PV operating point
This enables controlled extraction of available PV power.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
Two important operating conditions are investigated.
Test 1 – Load Variation
For the first simulation:
Irradiance = 1000 W/m²
Temperature ≈ 25°C
PV maximum rated power ≈ 250.2 W
Load resistance is changed periodically.
The load is varied approximately every:
0.3 seconds
Observed Behavior
Even though the load changes:
PV voltage remains near the required MPPT operating region.
PV current adjusts according to converter operation.
Load voltage changes depending on connected resistance.
Load current changes with the load.
PV power remains close to 250 W.
Maximum power extraction is maintained despite load disturbance.
This demonstrates the capability of the controller to separate PV maximum power extraction from changes occurring on the load side.
𝐋𝐨𝐚𝐝 𝐕𝐚𝐫𝐢𝐚𝐭𝐢𝐨𝐧 𝐓𝐞𝐬𝐭
Test Parameter | Condition |
Irradiance | 1000 W/m² |
Temperature | Approx. 25°C |
Rated maximum PV power | 250.2 W |
Load variation interval | Approximately 0.3 s |
Main objective | Verify MPPT during load disturbance |
Result | PV power maintained close to maximum |
The simulation waveforms confirm stable tracking of the maximum available PV power under changing load conditions.
𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞 𝐕𝐚𝐫𝐢𝐚𝐭𝐢𝐨𝐧 𝐓𝐞𝐬𝐭
A second test is performed by changing solar irradiance while keeping the load approximately constant.
The irradiance sequence is:
Time Interval | Irradiance |
Initial condition | 1000 W/m² |
After 2 s | 800 W/m² |
After 4 s | 600 W/m² |
After 6 s | 400 W/m² |
After 8 s | 200 W/m² |
The step change allows the dynamic tracking capability of the GA-tuned ANFIS MPPT controller to be observed clearly.
𝐌𝐚𝐱𝐢𝐦𝐮𝐦 𝐏𝐨𝐰𝐞𝐫 𝐓𝐫𝐚𝐜𝐤𝐢𝐧𝐠 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
The maximum power obtained at different irradiance levels closely follows the expected PV characteristics.
Irradiance | Expected Maximum Power | Approx. Simulated Power |
1000 W/m² | 250.2 W | ≈ 250 W |
800 W/m² | 199.9 W | ≈ 200 W |
600 W/m² | 149.6 W | ≈ 149–150 W |
400 W/m² | 98.97 W | ≈ 98–100 W |
200 W/m² | ≈ 48 W | ≈ 48–50 W |
The close agreement between the expected and simulated values indicates effective maximum power point tracking.
𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐔𝐧𝐝𝐞𝐫 𝐂𝐡𝐚𝐧𝐠𝐢𝐧𝐠 𝐈𝐫𝐫𝐚𝐝𝐢𝐚𝐧𝐜𝐞
When irradiance decreases:
PV current decreases.
Available PV power decreases.
The required maximum power point changes.
ANFIS immediately predicts a new reference Vmpp.
The voltage controller updates the duty cycle.
The boost converter moves the PV system toward the new operating point.
The PV power waveform therefore follows the approximate sequence:
250 W → 200 W → 150 W → 100 W → 50 W
corresponding to the stepwise reduction in irradiance.
𝐌𝐨𝐧𝐢𝐭𝐨𝐫𝐞𝐝 𝐒𝐢𝐠𝐧𝐚𝐥𝐬
The MATLAB/Simulink implementation monitors several important quantities.
PV-Side Measurements
PV voltage
PV current
PV power
Load-Side Measurements
Load voltage
Load current
Load power
These signals make it easy to evaluate:
MPPT accuracy
Dynamic response
Converter operation
Load behavior
Solar power extraction
𝐆𝐀-𝐓𝐮𝐧𝐞𝐝 𝐀𝐍𝐅𝐈𝐒 𝐌𝐏𝐏𝐓 𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The complete operation can be summarized as:
Measure or provide irradiance and temperature.
Feed both values into the GA-trained ANFIS controller.
Predict the required Vmpp.
Measure actual PV voltage.
Compare actual voltage with the predicted reference.
Generate voltage error.
Process the error through the PI controller.
Generate the required duty cycle.
Convert the duty-cycle command into PWM pulses.
Control the boost converter.
Adjust the PV operating voltage.
Extract the maximum available solar power.
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
GA-optimized ANFIS based intelligent MPPT
MATLAB/Simulink implementation
250 W solar PV panel model
Irradiance and temperature based prediction
Vmpp-oriented control strategy
DC–DC boost converter integration
PI-based voltage regulation
PWM-controlled switching
Training and testing data validation
Very low prediction error
Load variation testing
Irradiance variation testing
Real-time monitoring of PV voltage, current, and power
Load-side voltage, current, and power measurement
Effective tracking from 1000 W/m² to 200 W/m²
Suitable for studying intelligent renewable energy control
𝐀𝐝𝐯𝐚𝐧𝐭𝐚𝐠𝐞𝐬 𝐨𝐟 𝐆𝐀-𝐓𝐮𝐧𝐞𝐝 𝐀𝐍𝐅𝐈𝐒 𝐌𝐏𝐏𝐓
Intelligent Prediction
ANFIS learns the relationship between environmental conditions and the optimum PV voltage.
Optimization Capability
GA improves the parameters of the inference system to reduce prediction error.
Good Dynamic Tracking
The controller responds to sudden irradiance changes and identifies the new operating point.
Reduced Dependence on Conventional Search
The reference operating voltage is predicted directly from trained environmental data.
Robustness Against Load Changes
Simulation shows that maximum PV power can remain close to the available limit even when load resistance changes.
Suitable for Nonlinear PV Characteristics
ANFIS is well suited to the nonlinear behavior of solar PV systems.
𝐆𝐀-𝐓𝐮𝐧𝐞𝐝 𝐀𝐍𝐅𝐈𝐒 𝐯𝐬 𝐂𝐨𝐧𝐯𝐞𝐧𝐭𝐢𝐨𝐧𝐚𝐥 𝐌𝐏𝐏𝐓
Feature | Conventional MPPT | GA-Tuned ANFIS MPPT |
Main principle | Online search/tracking | Learned optimum operating point |
Environmental inputs | May not be directly required | Irradiance and temperature |
Intelligence | Limited | High |
Offline training | Usually not required | Required |
Optimization | Normally absent | Genetic Algorithm |
Nonlinear mapping capability | Moderate | Strong |
Reference prediction | Limited | Direct Vmpp prediction |
Adaptability | Algorithm-dependent | Dataset and training dependent |
The major advantage of the proposed structure is the combination of optimization and intelligent nonlinear prediction.
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
GA-trained ANFIS MPPT techniques can be studied and extended for:
Rooftop solar PV systems
Standalone PV systems
Grid-connected photovoltaic systems
Battery-integrated solar systems
Solar-powered EV charging stations
DC microgrids
Hybrid renewable energy systems
Solar water pumping systems
PV-fed motor drives
Smart energy management systems
Renewable energy research
Advanced MPPT controller development
𝐖𝐡𝐚𝐭 𝐘𝐨𝐮 𝐂𝐚𝐧 𝐋𝐞𝐚𝐫𝐧 𝐅𝐫𝐨𝐦 𝐓𝐡𝐢𝐬 𝐌𝐀𝐓𝐋𝐀𝐁 𝐌𝐨𝐝𝐞𝐥
This implementation provides practical understanding of:
Solar PV mathematical modeling
PV characteristic variation with irradiance
PV characteristic variation with temperature
Training data preparation
Fuzzy inference system generation
ANFIS training
Genetic Algorithm optimization
Training and testing validation
MPPT reference generation
PI controller implementation
PWM generation
Boost converter control
Load variation analysis
Irradiance variation analysis
PV voltage, current, and power analysis
𝐖𝐡𝐨 𝐈𝐬 𝐓𝐡𝐢𝐬 𝐓𝐨𝐩𝐢𝐜 𝐔𝐬𝐞𝐟𝐮𝐥 𝐅𝐨𝐫?
This MATLAB implementation is particularly useful for:
Electrical engineering students
Power electronics learners
Renewable energy researchers
Solar PV researchers
Control engineering researchers
MATLAB/Simulink users
Engineers working with intelligent controllers
Researchers studying ANN, fuzzy logic, ANFIS, and optimization
Engineers developing advanced MPPT techniques
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The MATLAB Implementation of GA Tuned ANFIS MPPT for Solar PV System demonstrates an intelligent approach for extracting maximum available power from a photovoltaic panel.
The Genetic Algorithm is used to optimize the ANFIS model, while ANFIS learns the relationship between irradiance, temperature, and maximum power point voltage.
Simulation results demonstrate effective operation under both:
Load variation
Solar irradiance variation
For irradiance levels ranging from 1000 W/m² to 200 W/m², the system tracks the corresponding maximum available power from approximately 250 W down to about 50 W.
The combination of GA optimization, ANFIS prediction, PI control, PWM generation, and boost converter control provides a useful framework for studying advanced intelligent MPPT control in solar photovoltaic systems.



Comments