Calculate the total average daily load
4 ビュー (過去 30 日間)
古いコメントを表示
Hi guys,
I want to calculate the total average daily load consumption for a microgrid. I have the hourly load data and I tried by doing like this:
%% designing the minigrid according to IEEE standard:
% convert the load data from watthours to Amperehours:
%mean_load_Wh=mean(Dataclean_interpolated.InverterEnergy)
Power_Ah=Dataclean_interpolated.InverterEnergy./Dataclean_interpolated.BatteryVoltage;
% calculate the total average daily load:
mean_load=retime(Power_Ah,'daily','mean');
K_p=0.1;% Parasitic losses
D=6; % 10.5 or 6 or 3 ( days of autonomy) depending on different IEEE standards)
C_un=D.*(mean_load.*(1+K_p))
%the adjusted battery capacity:
%C_ad=(C_un X K_t X K_m)/DOD
K_t=1.048; % temp.correction factor
K_m= 1.25;% Design margin
DOD=0.50;% maximum daily depth of discharge
C_ad=(C_un * K_t * K_m)/(DOD)% final battery capacity in Ah
but I get this message:
Undefined function 'retime' for input arguments of type 'double'.
Error in test_func (line 98)
mean_load=retime(Power_Ah,'daily','mean');
I have very basic knowlage in matlab and have learned already a lot from this group and I appreciate all your feedback and help!
Thanks in advance!
0 件のコメント
採用された回答
Steven Lord
2019 年 6 月 11 日
The retime function requires the first input to be a timetable array. From this line of code:
Power_Ah=Dataclean_interpolated.InverterEnergy./Dataclean_interpolated.BatteryVoltage;
I suspect Dataclean_interpolated is your timetable. If so I'd store Power_Ah as a new variable in that timetable then call retime on the timetable.
Dataclean_interpolated.Power_Ah = Dataclean_interpolated.InverterEnergy./Dataclean_interpolated.BatteryVoltage;
Alternately you could call groupsummary on your data with the times from your timetable as the groupvars input. See the "Group Operations with Vector Data" example on the groupsummary documentation page I linked earlier for an example you could adapt to your problem.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!