-
Notifications
You must be signed in to change notification settings - Fork 0
/
PV_Data.m
77 lines (61 loc) · 1.75 KB
/
PV_Data.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%% Load tempreature and insolation data from excel file.
% Data source: https://re.jrc.ec.europa.eu/pvg_tools/en/#DR
% Data Base: PVGIS-ERA5
% Insolation Data: Direct insolation(W/m2)
% Temperature Data: Temperature value (oC)
% PV-type: BP365, sun tracking data
% PV_spec: Pmax = 65W, Voc = 22.1v, Vmp = 17.6v, Imp = 3.69A, Isc = 3.99A
% Area: Sonderborg, SDU
% Data for: June, December
% Duration
x_time = duration(0:23,45,0)';
x = (0:1:23)';
% Import data for June
June_data = readtable("June_Temp_Radiation.xlsx"); % Change the xlsread to readtable function
June_temp = June_data(:,2);
June_Insolation = June_data(:,1);
% Import data for December
December_data = xlsread("December_Temp_Radiation.xlsx");
December_temp = December_data(:,2);
December_Insolation = December_data(:,1);
% Plot Data for December
subplot(2,2,1)
plot(x_time,December_Insolation)
title("Dec Insolation W/m^2")
ylabel("W/m^2")
xlabel("Hours")
grid on
subplot(2,2,3)
plot(x_time,December_temp)
title("Dec T^oC")
ylabel("T^oC")
xlabel("Hours")
grid on
subplot(2,2,2)
plot(x_time,June_Insolation)
title("June Insolation W/m^2")
ylabel("W/m^2")
xlabel("Hours")
grid on
subplot(2,2,4)
plot(x_time,June_temp)
title("June T^oC")
ylabel("T^oC")
xlabel("Hours")
grid on
%% Calculating the True maximum values
Ptrue = zeros(length(June_Insolation),1); Vmax = zeros(length(June_Insolation),1);
for i = 1: length(June_Insolation)
Ti = June_temp(i); Gi= June_Insolation(i);
[P,Ptrue(i),Vmax(i)] = PVfunction(Ti,Gi);
end
%% Interpolation of data
xq = (0:0.1:24)';
Pint = interp1(x,Ptrue,xq);
Vint = interp1(x,Vmax,xq);
Pint(isnan(Pint)) = 0;
Vint(isnan(Vint)) = 0;
Ptrue = Pint;
%% for test data
% [~,Pii,Vmaxii] = PVfunction(25,1000); % run this for testing the data
% and pv function