Code base plot RES utilization ratio

本文介绍了如何将数据加载到MATLAB中,通过公式计算每小时的利用率,并用图表展示一天中微电网的小时利用率变化情况。
摘要由CSDN通过智能技术生成

%
% Load your data into MATLAB.
% Calculate the utilization ratio for each hour using the formula: Utilization Ratio = (Total Energy Consumed) / (Total Energy Generated).
% Plot the utilization ratio against time (hour).

% Sample data (replace with your actual data)
hours = 1:24; % Hours of the day
energy_consumed = [10, 15, 20, 18, 22, 25, 30, 35, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10]; % Energy consumed in kWh for each hour
energy_generated = [12, 14, 18, 20, 25, 28, 32, 36, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8]; % Energy generated in kWh for each hour

% Calculate utilization ratio
utilization_ratio = energy_consumed ./ energy_generated;

% Plot
figure;
plot(hours, utilization_ratio, '-o', 'LineWidth', 1.5);
xlabel('Hour of the Day');
ylabel('Utilization Ratio');
title('Hourly Utilization Ratio in the Microgrid');
grid on;
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值