how to get variable output from pv array when variable 1000 irradiance and temperature is given

6 views (last 30 days)
I have fed 1000 irradiance and 1000 temperature.mat files to pv array but it is providing constant 2080 Volts output. I have generated the datas by writing script. I require variable output as the input varies gradually as like the temperature and irradiance to the solar panel is varying whole day. Kindly help me to solve the issue. Just I am begginer in matlab.
  2 Comments
dpb
dpb on 24 Feb 2025
Show the code you've tried...insufficient information on what the content of 1000 .mat files would be. That would be a very difficult way to store the data if it's a separate file for each observation; it should be one file containing all the data...
vani
vani on 25 Feb 2025
Edited: dpb on 25 Feb 2025
clear all
Iscs=7.84; %% Short Circuit Current at panel name plate details
Imps=7.35; %% Maximum Current from panel name plate details
Vocs=36.3; %% Open Circuit Voltage at panel name plate details
clear all
Iscs=7.84; %% Short Circuit Current at panel name plate details
Imps=7.35; %% Maximum Current from panel name plate details
Vocs=36.3; %% Open Circuit Voltage at panel name plate details
Vmps=29; %% Maximum Voltage from panel name plate details
alpha=0.102; %% Current Temperature coefficient from manufacturer
beta=-0.36099;%% Voltage Temperature coefficent from manufacturer
Gs=1000; %% Standard Irradiance 1000 W/m2
Ts=25; %% Standard Temperature 25 degree
for i=1:1000
Tmin=15;
Tmax=35;
T=(Tmax-Tmin)*rand+Tmin; %% Temperature
Gmin=0;
Gmax=1000;
G=(Gmax-Gmin)*rand+Gmin; %% Irradiance
t=0:1:1000;
IMP(i)=Imps*(G/Gs)*(1+(alpha*(T-Ts))); %% Maximum Current of the given irradiance & temperature
VMP(i)=Vmps+(beta*(T-Ts)); %%Maximum Voltage of given temperature & irradiance
PMP(i)=VMP(i)*IMP(i);
GT(i,:)=[G,T];
tG(i,:)=[t(i),G];
tT(i,:)=[t(i),T];
V(i,1)=VMP(i);
Output(i,1)=IMP(i);
Output(i,1)=PMP(i);
end
Vmps=29; %% Maximum Voltage from panel name plate details
alpha=0.102; %% Current Temperature coefficient from manufacturer
beta=-0.36099;%% Voltage Temperature coefficent from manufacturer
Gs=1000; %% Standard Irradiance 1000 W/m2
Ts=25; %% Standard Temperature 25 degree
for i=1:1000
Tmin=15;
Tmax=35;
T(i)=(Tmax-Tmin)*rand+Tmin; %% Temperature
Gmin=0;
Gmax=1000;
G(i)=(Gmax-Gmin)*rand+Gmin; %% Irradiance
t=(0:999);
IMP(i)=Imps*(G/Gs)*(1+(alpha*(T-Ts))); %% Maximum Current of the given irradiance & temperature
VMP(i)=Vmps+(beta*(T-Ts)); %%Maximum Voltage of given temperature & irradiance
PMP(i)=VMP(i)*IMP(i);
GT(i,:)=[G,T];
G(i,:)=G(1:i);
T(i,:)=T(i,:);
tG(i,:)=[t(i),G(i)];
tT(i,:)=[t(i),T(i)];
V(i,1)=VMP(i);
Output(i,1)=IMP(i);
Output(i,1)=PMP(i);
end
using this code i have generated the Irradiance and temperature.panel is taking the multiple input but providing the constant ouput for all G & T values

Sign in to comment.

Answers (1)

dpb
dpb on 25 Feb 2025
Edited: dpb on 25 Feb 2025
% Get rid of duplicated code -- dpb
% clear all
% Iscs=7.84; %% Short Circuit Current at panel name plate details
% Imps=7.35; %% Maximum Current from panel name plate details
% Vocs=36.3; %% Open Circuit Voltage at panel name plate details
% clear all
Iscs=7.84; %% Short Circuit Current at panel name plate details
Imps=7.35; %% Maximum Current from panel name plate details
Vocs=36.3; %% Open Circuit Voltage at panel name plate details
Vmps=29; %% Maximum Voltage from panel name plate details
alpha=0.102; %% Current Temperature coefficient from manufacturer
beta=-0.36099;%% Voltage Temperature coefficent from manufacturer
Gs=1000; %% Standard Irradiance 1000 W/m2
Ts=25; %% Standard Temperature 25 degree
% move constants outside loop -- dpb
Tmin=15;
Tmax=35;
Gmin=0;
Gmax=1000;
t=0:1:1000;
% create repeatable results for debugging -- remove/comment out for production
rng('default')
for i=1:1000
T=(Tmax-Tmin)*rand+Tmin; %% Temperature
G=(Gmax-Gmin)*rand+Gmin; %% Irradiance
IMP(i)=Imps*(G/Gs)*(1+(alpha*(T-Ts))); %% Maximum Current of the given irradiance & temperature
VMP(i)=Vmps+(beta*(T-Ts)); %%Maximum Voltage of given temperature & irradiance
PMP(i)=VMP(i)*IMP(i);
GT(i,:)=[G,T];
tG(i,:)=[t(i),G];
tT(i,:)=[t(i),T];
V(i,1)=VMP(i);
Output(i,1)=IMP(i);
%Output(i,1)=PMP(i); % used same location for PMP(i) as IMP(i) in Output array
Output(i,2)=PMP(i);
end
[GT(1:5,:); GT(end-4:end,:)] % look at G,T beginning, end
ans = 10×2
905.7919 31.2945 913.3759 17.5397 97.5404 27.6472 546.8815 20.5700 964.8885 34.1501 796.6247 27.4561 125.5362 29.9175 25.1505 31.4479 731.4075 23.2886 367.2859 30.6275
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
[Output(1:5,:); Output(end-4:end,:)] % look at output beginning, end
ans = 10×2
10.9320 292.1871 1.6048 50.8623 0.9105 25.5344 2.2033 67.4185 13.7109 352.3283 7.3220 205.8468 1.3855 37.7200 0.3064 8.1733 4.4374 131.4264 4.2491 114.5921
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
The G,T and Output arrays don't appear to be constant at all...you would have had the same result in both columns the Output array as it was, however, as noted in comments above.
Let's plot with time...
try
plot(t,GT)
catch
lasterr
plot(t(1:end-1),GT)
end
ans =
'Error using plot Specify the coordinates as vectors or matrices of the same size, or as a vector and a matrix that share the same length in at least one dimension.'
Ooops! What went wrong is that the t vector was defined from 0:1000 which contains 1001 elements, but you ran the loop over only 1000 so the output arrays are short one value
We can see this by --
whos t tG tT Output
Name Size Bytes Class Attributes Output 1000x2 16000 double t 1x1001 8008 double tG 1000x2 16000 double tT 1000x2 16000 double
The above can be fixed by running the loop over
for i=1:numel(t)
...
end
instead so if you change your mind on t, nothing else matters.
The above code could also be written using MATLAB array syntax without the loop and there's no need to store the compound variable arrays...
Iscs=7.84; %% Short Circuit Current at panel name plate details
Imps=7.35; %% Maximum Current from panel name plate details
Vocs=36.3; %% Open Circuit Voltage at panel name plate details
Vmps=29; %% Maximum Voltage from panel name plate details
alpha=0.102; %% Current Temperature coefficient from manufacturer
beta=-0.36099;%% Voltage Temperature coefficent from manufacturer
Gs=1000; %% Standard Irradiance 1000 W/m2
Ts=25; %% Standard Temperature 25 degree
% move constants outside loop -- dpb
Tmin=15;
Tmax=35;
Gmin=0;
Gmax=1000;
t=0:1:1000;
% create repeatable results for debugging -- remove/comment out for production
rng('default')
RAND=rand(2,numel(t)).'; % create 2xN random array so can match sequentially-generated pattern
T=(Tmax-Tmin)*RAND(:,1)+Tmin; % random Temperature over t
G=(Gmax-Gmin)*RAND(:,2)+Gmin; % ditto Irradiance
IMP=Imps*(G/Gs).*(1+(alpha*(T-Ts))); % Maximum Current of the given irradiance & temperature
VMP=Vmps+(beta*(T-Ts)); % Maximum Voltage of given temperature & irradiance used final V
PMP=VMP.*IMP; % power -- note the "dot" operator .* to do elementwise multiply
Output1=[IMP PMP]; % create the output array if want/need...
whos Output Output1
Name Size Bytes Class Attributes Output 1000x2 16000 double Output1 1001x2 16016 double
all(Output==Output1(1:1000,:))
ans = 1x2 logical array
1 1
And we can confirm the results are identical to the previous code...

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!