电力系统短期负荷预测(Python代码实现)

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🌈3 Python代码+数据+文章详细讲解

🎉4 参考文献


💥1 概述

本文包括以下5个部分

模型构建: 

训练出模型,然后就可以预测任意一天的96个时刻点的负荷。

📚2 运行结果

  预测日:

部分代码:

max_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最高温度'), [2]].values / 20
min_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最低温度'), [2]].values / 20
avg_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '平均温度'), [2]].values / 20
humidity = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '湿度'), [2]].values / 100
weather_data = np.concatenate([max_tempe, min_tempe, avg_tempe, humidity]).reshape((1, -1))


type_of_day = np.eye(7)[date.dayofweek]
holiday = np.eye(2)[int(is_holiday(date))]
time_data = np.concatenate([type_of_day, holiday]).reshape((1, -1))


features = np.concatenate([load_data, weather_data, time_data], axis=1).reshape(1, 685)
features = Tensor(features)

print('Loading model...')
net = load('./model.pt', map_location='cpu')

print('Start predicting...')
net.eval()
labels = net(features).detach().numpy() * 7000
print('=========预测==============')
max_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最高温度'), [2]].values / 20
min_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最低温度'), [2]].values / 20
avg_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '平均温度'), [2]].values / 20
humidity = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '湿度'), [2]].values / 100
weather_data = np.concatenate([max_tempe, min_tempe, avg_tempe, humidity]).reshape((1, -1))


type_of_day = np.eye(7)[date.dayofweek]
holiday = np.eye(2)[int(is_holiday(date))]
time_data = np.concatenate([type_of_day, holiday]).reshape((1, -1))


features = np.concatenate([load_data, weather_data, time_data], axis=1).reshape(1, 685)
features = Tensor(features)

print('Loading model...')
net = load('./model.pt', map_location='cpu')

print('Start predicting...')
net.eval()
labels = net(features).detach().numpy() * 7000
print('=========预测==============')

🌈3 Python代码+数据+文章详细讲解

博客主页:电气辅导帮

🎉4 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]陆继翔,张琪培,杨志宏,涂孟夫,陆进军,彭晖.基于CNN-LSTM混合神经网络模型的短期负荷预测方法[J].电力系统自动化,2019,43(08):131-137.

[2]罗澍忻,陆秋瑜,靳冰洁,麻敏华.考虑相关因素的长短时记忆网络短期负荷预测方法[J].机电工程技术,2019,48(12):126-129.

[3]王增平,赵兵,纪维佳,高欣,李晓兵.基于GRU-NN模型的短期负荷预测方法[J].电力系统自动化,2019,43(05):53-62.

[4] 牛腾腾.电力系统短期负荷预测  2017,011048 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值