How do I use equations to plot the IV curve of a solar cell which is temperature and irradiance dependent?

125 views (last 30 days)
Hello,
I am trying to write a series of equations that will plot the I-V curve of a solar panel depending on Irradiance and Temperature, and other intrinsic panel variables (Isc, Iph, saturation curent) etc.
I do know that there exists a solar panel model in simulink that is able to plot the IV curve accurately, but I am interested in finding the equations that govern this relationship.
The research paper includes a matlab script that is capable of producing an accurate IV curve, but I have not been able to get it working.
My broken script:
%Equations for IV curve
q = 1.60217662 * (10^(-19)); %elementary charge
k = 1.38064852 * (10^(-23)); %Boltzmanns constant
n = 1.4; %ideality factor
I_SC = 6.15; % Short circuit current
V_OC = 0.721; %Open circuit voltage
T = 298.15; %Cell temperature
V = linspace(0,0.76); %Using voltage as input variable
T_0 = 298.15; % Reference temp = 25C
I_r0 = 1000 %reference Irradiance
TC = 0.0029; % temp coefficint of Isc by manufacturer
V_g = 1.79*(10^(-19)); % Band gap in Joules
I_r = 200:200:1000 % Irradiance input
[V_m,I_rm] = meshgrid(V,I_r); %creating meshgrid
I_s0 = 1.2799*(10^-8); %Saturation current at ref temp given by equation in research paper
I_ph = ((I_SC/I_r0).*I_rm).*(1+ TC*(T-T_0)); % Equation for photocurrent, given in paper
I_s = I_s0.*(T./T_0).^(3/n).*exp((-(q*V_g)/n*k).*((1./T)-(1/T_0))); %saturation current equation in paper
I = I_ph - I_s.*exp(((q*V_m)/(n*k*T))-1); % Current equation
P = I.*V;
Iplot=I;
Iplot(Iplot<0)=nan;
Pplot = P;
Pplot(Pplot<0)=nan;
yyaxis left
plot(V,Iplot);
yyaxis right
plot(V,Pplot);
The script, is able to produce a decent result for different irradiances, but when I repeat the process with a constant irradiance, and Temperature as the input variable, I do not get the desirable result.
In addition to this, if anyone is able to explain to me how the newton rhapson method is applied to this (when the current equation is expanded to include Ir), i would be very grateful.
Any help would be much appreciated.

Answers (4)

KALYAN ACHARJYA
KALYAN ACHARJYA on 11 Aug 2019
Edited: KALYAN ACHARJYA on 11 Aug 2019
"but when I repeat the process with a constant irradiance, and Temperature as the input variable, I do not get the desirable result."
Temperature is already constant
T = 298.15; %Cell temperature
T_0 = 298.15; % Reference temp = 25C
With constant irradiance, you will get the same results, I_r pass the constant I_r vaure for individual plot.,,same thing
say for
I_r=200;
Two plots with two plot commnad, please check, now When
I_r=400;
As changing the I_r, y scale changes to fit the plot,
Therefore when you tried with
I_r = 200:200:1000 % Irradiance input
You will get 10 plots, with constant I_r value (200,400,600,800,1000), just y axes scaling is changing to fit the ranges of all plots.
You can verify the same , by passing single contant I_r value
for I_r = 200:200:1000
%.....
plot..
plot..
hold on;
end
  2 Comments
PhotovoltaicQuestion
PhotovoltaicQuestion on 12 Aug 2019
Yes as I said, when irradiance is varied, the equations plot a graph seemingly consistent with the theoretical results.
When the code is edited to make temperature the variable, it does not work as intended.
T = 223.15:25:323.15 %Cell temperature
V = linspace(0,0.76); %Using voltage as input variable
I_r = 1000 % Irradiance input
[V_m,T_m] = meshgrid(V,T); %creating meshgrid
With an IV curve, Increasing temp is supposed to decrease Voc dramatically, with Isc increasing minimally. This does not happen with my script.
Still genuinely appreciate your attention.
KALYAN ACHARJYA
KALYAN ACHARJYA on 12 Aug 2019
Edited: KALYAN ACHARJYA on 12 Aug 2019
When you plot with single T data, you get the plots
If
>> T=223.15:25:323.15
ans =
223.1500 248.1500 273.1500 298.1500 323.1500
So total plots will be 5 times than single T
I used
for T=223.15:25:323.15
%........
plot();
hold on;
end
I dont think there is any unusual. This is the same graph for 5 different values of T, Hence it looks as dense.
"Increasing temp is supposed to decrease Voc dramatically"
No, idea about subject
If you think the plots are OK for single tempature value, it surely OK for any tempature values or range.

Sign in to comment.


Moudrek Osmani
Moudrek Osmani on 16 Jun 2021
Hello,
How can the above code be modified if the I-V characteristic curve is facing Partial Shading Condition, where I_r decreases to 500W/m2?

BHALKY Manikanta
BHALKY Manikanta on 11 Oct 2022
I_PH value

Roba Alghamdi
Roba Alghamdi on 8 Dec 2023
Hello;
I have an issue that my cureve is not look like a IV cureve, it is a stright down line
ns = 36;
np = 1;
Isc = 3.8;
n = 2.1;
Tr = 298.15; % Corrected the temperature to Kelvin
Gr = 1000;
a = 0.00065;
b = 0.08;
q = 1.602e-19;
K = 8.617e-5;
Voc = 21.1;
Rs = 0.008 * ns; % Corrected Rs for the number of series cells
Rsh = 1000 * (10^np); % Corrected Rsh for the number of parallel cells
Iph = (Isc + a * (Tr - 298.15)) * (Gr / 1000);
Io = (Isc + a * (Tr - 298.15)) / exp(q * (Voc + b * (Tr - 289.15)) / (n * K * Tr * ns)) - 1;
% Function for the solar panel I-V characteristics
solar = @(V, I) Iph - Io * (exp((q * (V + I * Rs)) / (n * K * Tr * ns)) - 1) - ((V + I * Rs) / Rsh);
Voltage = linspace(0, Voc, 100);
current = zeros(size(Voltage));
% Newton-Raphson method for each voltage
for i = 1:length(Voltage)
V = Voltage(i);
I = 0;
% Solve the nonlinear system using Newton-Raphson
solution = fsolve(@(x) solar(V, x),I);
% Extract the current
current(i) = solution;
end
% Plotting
figure;
plot(Voltage, current);
xlabel('Voltage (V)');
ylabel('Current (A)');
title('Solar Panel I-V Characteristics');

Categories

Find more on Solar Power in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!