Harvested energy comes from natural, unstable energy sources which means it is not a reliable method of supplying power. Using energy from the power grid as a supplementary source ensures that the overall energy supply of the power system can be regulated. To maximize the allocated power, the proposed GWFPP & RGWF algorithms can be used in conjunction to allocate the grid and harvested energy respectively.
The problem needed to be solved is generalized as the following equation with four constraints:
The first constraint is that the harvested energy for any epoch i must be more than or equal to zero. Secondly, the grid power for any epoch i must be equal to or more than zero but less than or equal to the peak power constraint for channel i. Also, the sum of the allocated harvest power for every epoch must be less than or equal to the sum of the harvested energy being put into the system. Similarly, the sum of the allocated grid power for every epoch must be less than or equal to the sum of the grid energy being put into the system.
The Hybrid Power Allocation (HPA) algorithm is essentially a call to the GWFPP & RGWF algorithms with an update in the water level in the middle. First, the array of harvested energy for each epoch, the total grid power being utilized, the peak power constraints of the grid power for each epoch along with the gain and weight arrays must be known. By using the GWFPP algorithm, the optimal grid power allocation for each epoch can be calculated. Next, the gain array of the system must be updated to include the grid power in it. Essentially, for allocating the harvested energy, the RGWF algorithm is called with the gain of the epoch being the sum of the original gain and allocated grid power. By calling the RGWF algorithm with the updated gains, the harvested energy is allocated in a non-decreasing manner.
For example, given the following input information - harvested energy for each epoch being 1, total grid power equals 5, power constraint of the epoch being the epoch integer value (Ex: 1,2,3 etc.), the gain of each epoch being the inverse of the epoch integer value (Ex: 1, 1/2, 1/3) and the weight for every epoch being 1 - the GWFPP algorithm can first be used to compute the optimal grid power allocation; this results in the output of [1 2 2] for the three epoch system. Next, the allocated grid power is added with the inverse of the product of the gain and weight of the epoch to produce a new "staircase" of the system where the original system is frozen with the grid power. Utilizing the RGWF algorithm, the harvested energy is then allocated onto the new "staircase" to obtain the results of [1 1 1].
The proposed algorithm can be written in MATLAB to view the results. From the code below, it is evident that the steps taken are as described above.
*Note: To run this function, the input parameters (Einh,Egt,PU,a and w) must be inputted to the HPA1 function and the function must be assigned to and array of output parameters (sg and sh) to receive an output.
function [sg,sh] = HPA1(Einh,Egt,PU,a,w) %Outputs & inputs
% Einh: Harvested Energy array Egt: Total grid power value
% PU: Peak Power constraint array for grid power a: Gain array
% w: Weight array
sg = GWFPP(Egt,a,PU,w); %Perform GWFPP first with grid power
for i = 1:length(a)
a(i) = 1/((1/a(i)) + sg(i)); %Update value of gains to include grid power aswell
end
sh = RGWF_GOOD(Einh,a,w); %Perform RGWF with harvested energy
% K = length(a);
% for i1 = 1:K
% while i1>=1
% if ((sh(i1)+sg(i1))/w(i1)+1/(a(i1)*w(i1))) >= ((sh(K)+sg(K))/w(K)+1/(a(K)*w(K)))
%
% break;
% else
% sh(1:(i1-1))=(RGWF_GOOD(Einh(i1:K),((1./(a(i1:K).*w(i1:K)))+(sg(i1:K)./w(i1:K))),w(i1:K)));
% sg(1:(i1-1))=(GWFPP(Egt,((1./(a(i1:K).*w(i1:K)))+(sh(i1:K)./w(i1:K))),PU,w(i1:K)));
% end
% end
% end
end
For a visual representation of the algorithms output, the following script can be used;
clearvars;
%function of HPA1 is: [sg,sh] = HPA1(Einh,Egt,PU,a,w)
%Assign Harvested energy, Total grid power, Peak power constraints, Gain, and Weight :
Einh = [1 1 1];
Egt=5;
PU=[1 2 3];
a=[1 1/2 1/3];
w= true(1,3);
[sg,sh] = HPA1(Einh,Egt,PU,a,w)
f1 = figure(1);
clf;
set(f1,'Color',[1 1 1]);
bar((sh./w)+(sg./w)+(1./(a.*w)),1,'g');
hold on;
bar((sg./w)+(1./a.*w),1,'r');
hold on;
bar(1./(a.*w),1);
xlabel('Epochs');
title('Hybrid Power Allocation Algorithm 1 (HPA1)')
legend('sh',...
'sg',...
'1/ai')
Using the aforementioned example in the algorithm section, the HPA1_Call file can be used to generate the optimal solution along with a figure of the output