Matlab|【免费】基于数据驱动的模型预测控制电力系统机组组合优化

news/2024/11/8 16:38:25/

目录

1 主要内容

2 部分代码

3 程序结果

4 下载链接


主要内容

该程序复现文章《Feature-Driven Economic Improvement for Network-Constrained Unit Commitment: A Closed-Loop Predict-and-Optimize Framework》,程序主要做的是一个基于数据驱动的电力系统机组组合调度模型,采用IEEE24节点系统作为研究对象,该模型的创新点在于:提出了一个闭环预测与优化(C-PO)框架,即利用NCUC模型的结构以及相关特征数据来训练一个以成本为导向的RES预测模型,该模型通过诱导的NCUC成本而不是统计预测误差来评估预测质量,并且在优化过程中采用拉格朗日松弛来加速训练过程,该模型理论深度较大,代码学习难度也较大,本次免费分享供相关方向同学参考。

原文模型及部分结果​:

部分代码

Number_day          = Validate_day_end - Validate_day_1st + 1;
First_day_intuition = Validate_day_1st;
Final_day_intuition = Validate_day_end;
Scaler_load         = 0.22;
Scaler_SPG          = 0.39;
Scaler_WPG          = 0.39;
R_for_load          = 0.10;
R_for_RES           = 0.05;
Method_flag         = 'CPO';
Number_hour         = 24;
Number_RES          = 5;
%% -----------------------------SPO tunning----------------------------- %%
lamda                 = 100000;
Number_training_day   = 2;
Number_day_H_validity = 7; % The frequency of updating Predictor H.
Number_historic_day   = 7;
Solver_flag           = 'g';
Solver_gap            = 3;
Solver_time           = 10;
%% -----------------------Prepare box for recorder---------------------- %%
% Rec for UC
Rec_Decision_UC_I    = cell(Number_day, 1);
Rec_Decision_UC_P    = cell(Number_day, 1);
Rec_Decision_UC_R_h  = cell(Number_day, 1);
Rec_Decision_UC_R_c  = cell(Number_day, 1);
Rec_cost_UC_expected = cell(Number_day, 1);
Rec_cost_UC_SUSD     = cell(Number_day, 1);
Rec_RES_prediction   = cell(Number_day, 1);
Rec_infea_UC_flag    = cell(Number_day, 1);
Rec_UC_time          = cell(Number_day, 1);
% Rec for ED
Rec_cost_ACT      = cell(Number_day, 1);
Rec_cost_UC       = cell(Number_day, 1);
Rec_cost_SUSD_all = cell(Number_day, 1);
Rec_cost_SUSD_UC  = cell(Number_day, 1);
Rec_cost_SUSD_ED  = cell(Number_day, 1);
Rec_cost_P        = cell(Number_day, 1);
Rec_cost_LS       = cell(Number_day, 1);
Rec_cost_loss_ACT = cell(Number_day, 1);
Rec_cost_loss_UC  = cell(Number_day, 1);
Rec_infea_ED_flag = cell(Number_day, 1);
%% --------------------------Prepare box for CPO------------------------ %%
% Cost
CPO_cost_ACT      = zeros(Number_day, 1);
CPO_cost_UC       = zeros(Number_day, 1);
CPO_cost_SUSD_all = zeros(Number_day, 1);
CPO_cost_SUSD_UC  = zeros(Number_day, 1);
CPO_cost_SUSD_ED  = zeros(Number_day, 1);
CPO_cost_P        = zeros(Number_day, 1);
CPO_cost_LS       = zeros(Number_day, 1);
CPO_cost_loss_ACT = zeros(Number_day, 1);
CPO_cost_loss_UC  = zeros(Number_day, 1);
% Flag
CPO_infeasible_UC = zeros(Number_day, 1);
CPO_infeasible_ED = zeros(Number_day, 1);
%% -------------------------Set updating frequency---------------------- %%
Number_period = ceil(Number_day/Number_day_H_validity);
if Number_period == floor(Number_day/Number_day_H_validity)Number_day_in_period_full           = Number_day_H_validity;Number_day_in_period_last           = Number_day_H_validity;Period_size_list                    = ones(Number_period,1);Period_1st_list                     = zeros(Number_period,1);Period_end_list                     = zeros(Number_period,1);Period_size_list(1:Number_period-1) = Number_day_in_period_full;Period_size_list(Number_period)     = Number_day_in_period_last;
end
if Number_period > floor(Number_day/Number_day_H_validity)Number_day_in_period_full           = Number_day_H_validity;Number_day_in_period_last           = Number_day - (Number_period - 1)*Number_day_H_validity;Period_size_list                    = ones(Number_period,1);Period_1st_list                     = zeros(Number_period,1);Period_end_list                     = zeros(Number_period,1);Period_size_list(1:Number_period-1) = Number_day_in_period_full;Period_size_list(Number_period)     = Number_day_in_period_last;
end
for i_period = 1:Number_periodPeriod_1st_list(i_period) = (Validate_day_end+1) - sum(Period_size_list(i_period:end));Period_end_list(i_period) = (Validate_day_1st-1) + sum(Period_size_list(1:i_period));
end
%% ------------------Prepare box for training details------------------- %%
% Training detail
CPO_TRA_Predictor_H     = cell(Number_period, 1);
CPO_TRA_Predictor_H_ele = cell(Number_period, 1);
CPO_TRA_obj             = zeros(Number_period, 1);
CPO_TRA_cost_ERM        = zeros(Number_period, 1);
CPO_TRA_regulation      = zeros(Number_period, 1);
CPO_TRA_time            = zeros(Number_period, 1);
%% --------------------------Prepare box for pick----------------------- %%
Picked_TRA_intuition        = zeros(Number_training_day,Number_period);
Picked_TRA_feature          = cell(Number_period,1);
Picked_TRA_load_city        = cell(Number_period,1);
Picked_TRA_reserve_load_req = cell(Number_period,1);
Picked_TRA_reserve_RES_req  = cell(Number_period,1);
Picked_TRA_cost_perfect     = cell(Number_period,1);
%% ------------------------------Let's go------------------------------- %%
for Current_period = 1:Number_periodNumber_dispatch_day = Period_size_list(Current_period);Dispatch_day_1st    = Period_1st_list(Current_period);Dispatch_day_end    = Period_end_list(Current_period);%% -----------------------Select training day----------------------- %%[Picked_TRA_intuition(:,Current_period),...Picked_TRA_feature{Current_period},...Picked_TRA_load_city{Current_period},...Picked_TRA_reserve_load_req{Current_period},...Picked_TRA_reserve_RES_req{Current_period},...Picked_TRA_cost_perfect{Current_period}]...= Step_00_Select_train_day(Dispatch_day_1st,...Dispatch_day_end,...Number_training_day,...Number_dispatch_day,...Scaler_load,...Scaler_SPG,...Scaler_WPG,...R_for_load,...R_for_RES,...Number_historic_day);%% -----------------------------Setp 01----------------------------- %%[CPO_TRA_Predictor_H{Current_period},...CPO_TRA_Predictor_H_ele{Current_period},...CPO_TRA_obj(Current_period),...CPO_TRA_cost_ERM(Current_period),...CPO_TRA_regulation(Current_period),...CPO_TRA_time(Current_period)]...= Step_01_CPO_train(lamda,...Scaler_load,...Scaler_SPG,...Scaler_WPG,...Solver_flag, Solver_gap, Solver_time,...Picked_TRA_feature{Current_period},...Picked_TRA_load_city{Current_period},...Picked_TRA_reserve_load_req{Current_period},...Picked_TRA_reserve_RES_req{Current_period},...Picked_TRA_cost_perfect{Current_period},...Number_training_day,...Method_flag);

程序结果

4 下载链接


http://www.ppmy.cn/news/1394643.html

相关文章

信号处理--使用EEGNet进行BCI脑电信号的分类

目录 理论 工具 方法实现 代码获取 理论 EEGNet作为一个比较成熟的框架,在BCI众多任务中,表现出不俗的性能。EEGNet 的主要特点包括:1)框架相对比较简单紧凑 2)适合许多的BCI脑电分析任务 3)使用两种卷…

深入探索C语言动态内存分配:释放你的程序潜力

🌈大家好!我是Kevin,蠢蠢大一幼崽,很高兴你们可以来阅读我的博客! 🌟我热衷于分享🖊学习经验,🏫多彩生活,精彩足球赛事⚽ 🌟感谢大家的支持&#…

【boost_search搜索引擎】1.获取数据源

boost搜索引擎 1、项目介绍2、获取数据源 1、项目介绍 boost_search项目和百度那种不一样,百度是全站搜索,而boost_search是一个站内搜索。而项目的宏观上实现思路就如同图上的思路。 2、获取数据源 我们要实现一个站内搜索,我们就要有这…

浅易理解:YoloV3 案例_05

目标 熟悉TFRecord文件的使用方法YoloV3模型结构及构建方法数据处理方法利用yoloV3模型进行训练和预测 1.TFrecord文件 该案例中我们依然使用VOC数据集来进行目标检测,不同的是我们要利用tfrecord文件来存储和读取数据,首先来看一下tfrecord文件的相关…

[AIGC] Redis基础命令集详细介绍

Redis是一个强大的开源的键-值存储系统,被广泛应用于各种应用程序中。在使用Redis时,我们需要掌握一些基本的Redis命令来操作存储在其上的数据。这篇文章将向你介绍一些基本的Redis命令,让你能够更好地使用和理解Redis。 文章目录 启动Redis…

yolov5/v7修改标签和检测框显示【最全】

1. 背景介绍 在计算机视觉领域,目标检测是一个重要的任务,它旨在识别图像中的对象并定位它们的边界框。近年来,基于深度学习的目标检测算法取得了显著的进展,其中YOLO(You Only Look Once)系列算法因其速度…

nodejs+vue分类信息服务平台移动端的设计与实现-安卓pythonflask-django-php

分类信息服务平台设计的目的是为用户提供活动信息、活动记录等方面的平台。 与PC端应用程序相比,分类信息服务平台的设计主要面向于移动端,旨在为管理员和用户、商铺提供一个分类信息服务平台。用户可以通过Android及时查看活动信息等。 分类信息服务平台…

pytorch 实现多层神经网络MLP(Pytorch 05)

一 多层感知机 最简单的深度网络称为多层感知机。多层感知机由 多层神经元 组成,每一层与它的上一层相连,从中接收输入;同时每一层也与它的下一层相连,影响当前层的神经元。 softmax 实现了 如何处理数据,如何将 输出…