how to get variable output from pv array when variable 1000 irradiance and temperature is given
6 views (last 30 days)
Show older comments
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
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...
Answers (1)
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
[Output(1:5,:); Output(end-4:end,:)] % look at output beginning, end
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
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
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
all(Output==Output1(1:1000,:))
And we can confirm the results are identical to the previous code...
0 Comments
See Also
Categories
Find more on Circuits and Systems 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!