含可再生能源的配电网最佳空调负荷优化控制

news2025/3/11 6:33:52

目录

1 主要内容

2 部分代码

3 程序结果

4 程序链接


主要内容

该程序完美复现《Optimal air-conditioning load control in distribution network with intermittent renewables》,中文题目(翻译)为《含可再生能源的配电网最佳空调负荷优化控制》,实现内容:为了减轻包括风力发电、环境温度变化和电力零售价格在内的随机变量的不确定性,采用滚动水平优化(RHO)策略来连续更新实时信息并进入控制窗口。此外,为了确保客户的热舒适性,引入了一种新颖的两参数热模型来更精确地计算室内温度变化,保证用户舒适度,以系统总运行成本最低为目标,采用基于MILP(混合整数线性规划)的方法来调度可中断的空调负荷,从而实现最佳调度效果。

  • 该程序采用matlab+mosek(求解器)进行求解,具体mosek安装方法可参见官网,后期公众号也会更新该求解器的安装注意事项。
  • 两参数模型如下:

房屋的热过程由两个部分组成。一个组成部分是房屋内部的热质量,另一个是具有显着不同的热容量的墙壁的热质量。考虑到墙壁的热容量,房屋的室内空气温度变化可能会显著不同。由于热模型的复杂性会对冷却能量的计算精度产生重大影响,因此该模型能够虽然复杂性增加,但是准确性也有效提升。
  • RHO策略

RHO的主要程序如下。
1)在第一个时间步,基于日前的预测数据确定包括电价,环境温度和风能输出在内的参数。MILP模型会根据最低运营成本目标计算并生成一组参数(例如Tr和Tw)。
2)在下一个时间步,基于更新的输入参数(包括实时价格(RTP),新近预测的环境温度,更新的未来风能输出,前一步生成的数据Tr等),使用MILP模型优化成本函数,并为下一个控制窗口生成一组新的参数。
3)在每个时间步,向前移动控制窗口,重复上述过程,直到完成计划范围的最后一个时间步。

部分代码

%% Variables
syms Sac1;               % (integer variables) operational status of AC--0=off,1=on各个房间空调开关状态,房间温度,墙体温度
syms Tr1;                % temperature of the room
syms Tw1;                % temperature of the wall
syms Sac2;               % (integer variables) operational status of AC--0=off,1=on
syms Tr2;                % temperature of the room
syms Tw2;                % temperature of the wall
syms Sac3;               % (integer variables) operational status of AC--0=off,1=on
syms Tr3;                % temperature of the room
syms Tw3;                % temperature of the wall
syms Sac4;               % (integer variables) operational status of AC--0=off,1=on
syms Tr4;                % temperature of the room
syms Tw4;                % temperature of the wall
syms Sac5;               % (integer variables) operational status of AC--0=off,1=on
syms Tr5;                % temperature of the room
syms Tw5;                % temperature of the wall
​
syms P_bat;              % power output from battery to consumers (kW)消费者从电池使用的电量
syms P_buy;              % power bought from grid (kW)从电网购买的电量
syms P_sell;             % power from battery to grid (kW)电池输入电网的电量
syms SoC;                % battery state of charge电池电量,百分比
numofvars = 19;          % the number of variables which have been listed above
%% Import ambient temperature and electrcity prices data from spreadsheets
Tamb = xlsread('Main.xlsx','Data','P2:P97')';      % importing data for expected consumption during the day (pu)预期环境温度
c_buy = xlsread('Main.xlsx','Data','D2:D97')';      % importing data for the cost of purchasing power from the grid (pu)购入电价
PCritical = xlsread('Main.xlsx','Data','Q2:Q49'); % importing data for the critical loads基础负荷,不可控部分
PCritical=0.2*Process_Load(PCritical);
WindGeneration=xlsread('Main.xlsx','Data','U1:U96')';% importing data for wind generation风力发电预测数据
WindGeneration=0.1*WindGeneration; 
c_sell = xlsread('Main.xlsx','Data','E2:E97')';      % importing data for the price of selling power to the grid (kw)卖出电价
%% Data
t_step = 15;              % timestep in minutes每次滑动距离(分钟)
t_total = 24*60;          % total time window in minutes总时长
N = t_total / t_step;     % total number of time steps总滑动次数
​
E_bat = 60;              % battery capacity 1000 kWH电池容量
P_max_discharge = 60;   % battery maximum discharge output kw 电池最大输出功率
P_max_bound = 10000; 
density_of_wall=2400;   % Density of wall is 2000kg/m3墙体密度
density_of_air=1.1839;  % Density of air at 25℃空气密度
GroupOneNumber=10;       % House number of group one is 100;每组房子的房屋数量
GroupTwoNumber=12;       % House number of group two is 100;
GroupThreeNumber=14;     % House number of group three is 100;
GroupFourNumber=18;      % House number of group four is 100;
GroupFiveNumber=15;      % House number of group five is 100;
%House 1
Tr_init_1 = 25;           % initial room temperature is 25℃房间初始温度
Tamb_init_1 = 25;         % last time step ambient temperature before optimization is 25℃
Tw_init_1=25;             % initial wall temperature is 25℃初始墙体温度
Sac_init_1 =0;            % initial ac operational status is off初始空调状态为关闭
cpa_1 = 1005.4;           % cp = cp of air (273 K) = 1005.4 J/kg-K空气比热容
cpw_1=840;                % cpw = cp of wall (273k)=840J/kg-k墙体比热容
Pac_1 =3;                 % power of air conditioner(kW)空调的功率
COP_1=2.8;                % coefficient of performance空调性能系数
Qac_1=COP_1*Pac_1*1000*0.25*900;  % energy of air conditioner at 15minutes(J)15分钟内空调消耗的电量
NumberOfHouse1=200;        % Number of House 1 is 200       
%House 2
Tr_init_2 = 25;           % initial room temperature is 25℃
Tamb_init_2 = 25;         % last time step ambient temperature before optimization is 25℃
Tw_init_2=25;             % initial wall temperature is 25℃
Sac_init_2 =0;            % initial ac operational status is off
cpa_2 = 1005.4;           % cp = cp of air (273 K) = 1005.4 J/kg-K
cpw_2=840;                % cpw = cp of wall (273k)=840J/kg-k
Pac_2 = 4;               % power of air conditioner(kW)
COP_2= 2.8;                % coefficient of performance
Qac_2=COP_2*Pac_2*1000*0.25*900;   % energy of air conditioner at 15minutes(J)
%House 3
Tr_init_3 = 25;           % initial room temperature is 25℃
Tamb_init_3 = 25;         % last time step ambient temperature before optimization is 25℃
Tw_init_3=25;             % initial wall temperature is 25℃
Sac_init_3 =0;            % initial ac operational status is off
cpa_3 = 1005.4;           % cp = cp of air (273 K) = 1005.4 J/kg-K
cpw_3=840;                % cpw = cp of wall (273k)=840J/kg-k
Pac_3 =4;               % power of air conditioner(kW)
COP_3=2.8;                % coefficient of performance
Qac_3=COP_3*Pac_3*1000*0.25*900;   % energy of air conditioner at 15minutes(J)
%House 4
Tr_init_4 = 25;           % initial room temperature is 25℃
Tamb_init_4 = 25;         % last time step ambient temperature before optimization is 25℃
Tw_init_4=25;             % initial wall temperature is 25℃
Sac_init_4 =0;            % initial ac operational status is off
cpa_4 = 1005.4;           % cp = cp of air (273 K) = 1005.4 J/kg-K
cpw_4=840;                % cpw = cp of wall (273k)=840J/kg-k
Pac_4 = 2.8;               % power of air conditioner(kW)
COP_4=2.8;                % coefficient of performance
Qac_4=COP_4*Pac_4*1000*0.25*900;   % energy of air conditioner at 15minutes(J)
%House 5
Tr_init_5 = 25;           % initial room temperature is 25℃
Tamb_init_5 = 25;         % last time step ambient temperature before optimization is 25℃
Tw_init_5=25;             % initial wall temperature is 25℃
Sac_init_5 =0;            % initial ac operational status is off
cpa_5 = 1005.4;           % cp = cp of air (273 K) = 1005.4 J/kg-K
cpw_5=840;                % cpw = cp of wall (273k)=840J/kg-k
Pac_5 =3.5;               % power of air conditioner(kW)
COP_5=2.8;                % coefficient of performance
Qac_5=COP_5*Pac_5*1000*0.25*900;   % energy of air conditioner at 15minutes(J)
%% Define the house geometry各房间的几何参数
% converst radians to degrees
r2d = 180/pi;
% Roof pitch = 40 deg屋顶坡度
pitRoof = 40/r2d;
​
%--House one--%
% House length = 30 m长度
lenHouse1 = 20;
% House width = 10 m宽度
widHouse1 = 12;
% House height = 4 m高度
LWall1 = 0.24;
% Width of the wall =0.24m墙体厚度
htHouse1 = 3.2;
% Number of windows = 6窗口数量
numWindows1 = 6;
% Height of windows = 1 m窗口高度
htWindows1 = 1;
% Width of windows = 1 m窗口宽度
widWindows1 = 1;
windowArea1 = numWindows1*htWindows1*widWindows1;%窗户总面积
wallArea1 = 2*lenHouse1*htHouse1 + 2*widHouse1*htHouse1 + ...
    2*(1/cos(pitRoof/2))*widHouse1*lenHouse1 + ...
    tan(pitRoof)*widHouse1 - windowArea1;%墙体总面积
volume_of_wall1=lenHouse1*htHouse1*LWall1*2+(widHouse1-LWall1*2)*htHouse1*LWall1*2-windowArea1*LWall1;%墙体体积
volume_of_air1=lenHouse1*htHouse1*widHouse1+0.5*widHouse1*tan(40)*0.5*widHouse1;%空气体积
Mw1=volume_of_wall1*density_of_wall;%墙体总质量
Mair1 = density_of_air*volume_of_air1;         % mass of air within the household(kg)空气总质量
​
% Define the type of insulation used定义绝热材料
% Glass wool in the walls, 0.2 m thick墙面玻璃棉,0.2米厚度
% k is in units of J/sec/m/C - convert to J/hr/m/C multiplying by 3600
kWall1 = 0.038*900;   % hour is the time unit
RWall1 = LWall1/(kWall1*wallArea1);
% Glass windows, 0.01 m thick玻璃窗,0.01米厚度
kWindow1 = 0.78*900;  % hour is the time unit
LWindow1 = .01;
RWindow1 = LWindow1/(kWindow1*windowArea1);
​
% Determine the equivalent thermal resistance for the whole building
%确定整个建筑的热阻抗
Rw1 = RWall1*RWindow1/(RWall1 + RWindow1);
% Convection Heat transfer coefficient between air and wall,hwr=15w/(m2k);
%空气与墙壁对流换热系数hwr
hwr1=15;
% convection resistance is Rwr=1/(hA)对流阻抗Rwr
Rwr1=1/(hwr1*wallArea1);
Rwa1=Rwr1;
%Calculate the constants to simplified the计算常数以简化计算

程序结果

4 程序链接

点击直达!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/433376.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

如何快速用本地文件建立一个Url资源定位符

今天有一个需求,用easyExcel从服务端的一个Url来获取excel做处理。 搜了很多方案,首先要解决的一个问题就是,我得从一个Url获取一个excel,那就意味着我要上传一个文件到我的服务器上,把文件传递上去,然后访…

《API加速优化方案:多级缓存设计》

点击上方蓝字关注我们! 这事情还得从两天前说起...话说迭代上了个接口,该接口横跨多个应用服务,链路如下图所示: 问题来了:通过skywalking,我们的监控到dev环境的该接口偶尔请求耗时很长,且抛异…

震撼开源!首个1万多人共同标注的35种语言的高质量对话数据集来啦

文 | 小戏 “数据”!“数据”!“数据”! 大模型时代,最珍贵的是什么?是 Transformer 的架构吗?是 RLHF 的方法吗? 不是!是数据,是高质量的数据,是高质量且开源…

科幻AI生活来临,博联版“贾维斯”让全屋智能触手可及

1 ChatGPT提升交互体验 解决人机语音交互痛点 据洛图科技(RUNTO)《中国智能音箱零售市场月度追踪》报告,2022年中国智能音箱市场销量为2631万台,市场销额达到75.3亿元。当前智能音箱已完成初轮用户普及,舒适的居家定制服务走入千家万户&…

低代码开发重要工具:jvs-logic(逻辑引擎)基础原理与功能架构

逻辑引擎介绍 逻辑引擎是一种能够处理逻辑表达式的程序,它能够根据用户输入的表达式计算出表达式的值。在实际应用中,逻辑引擎通常被用于处理规则引擎、决策系统、业务规则配置等领域,具有广泛的应用前景。 原理与核心功能描述 基础原理 …

JUC并发编程之CompletableFuture

Future future是java5新加的一个接口,他提供了一种异步并行计算的功能 接口定义了操作异步任务执行的一些方法,如获取异步任务的执行结果、取消任务的执行、判断任务是否被取消、判断任务是否执行完毕 目的:异步多线程执行且有返回结果&#…

干货分享 | 一文了解交互式应用程序安全测试(IAST)技术

软件开发过程中,安全检测极为重要。带有漏洞的软件一旦被恶意利用,将造成数据泄露、业务瘫痪,为企业带来不可估量的损失。这就要求企业在系统开发初期发现系统安全问题,快速定位应用漏洞并修复,从源头减少开发过程中的…

黑马点评Redis实战(短信登录;商户查询缓存)

黑马点评 通过一个类似于大众点评的项目了解学习redis在实战项目中的使用,下面是项目中会涉及到的模块: 一、导入黑马点评项目 导入springboot项目,导入sql脚本到数据库,开启nginx,更改项目配置文件中的redis和mys…

头部证券公司安全体系搭建实战讲解—开源网安S-SDLC平台助力金融科技安全发展

数字化时代背景下,新兴技术广泛应用导致软件安全隐患不断扩大。而金融行业由于项目周期长、业务规模大、应用数量多、合规监管严、内外合作多等特性,进一步加重了安全风险。 与此同时,《等保2.0》、《网络安全法》等国家政策的发布&#xff0…

【排序】直接插入排序与希尔排序(图示详解哦)

全文目录 引言直接插入排序思路实现 希尔排序思路实现 总结 引言 在上一篇文章中,我们实现了选择排序与堆排序,在本篇文章中将继续介绍直接插入排序与希尔排序: 直接插入排序与希尔排序都属于插入排序的一种: 这两种排序的思想都…

Ae:摄像机设置

Ae菜单:图层/摄像机设置 Camera Settings 快捷键:Ctrl Shift Y 新建摄像机图层时,首先会弹出摄像机设置 Camera Settings对话框。 经典 3D 渲染器时的摄像机设置 Cinema 4D 渲染器时的摄像机设置 类型 Type 有两种类型的摄像机供选择。 提…

空间矢量数据保存为GeoJSON、PDF等文件格式

专注系列化、高质量的R语言教程 推文索引 | 联系小编 | 付费合集 我们使用的空间矢量数据一般是Shapefile格式的,它在ArcGIS、R语言中都能加载,但是这种数据格式在使用时也有不便:它是由多个文件构成的,一般有.shp、.shx、.dbf、.…

Session和Cookie区别介绍+面试题

Session 会话: 对应的英文单词:session用户打开浏览器,进行一系列操作,然后关闭浏览器。整个过程叫做一次会话一个会话包含多次请求 session机制属于B/S结构的一部分,主要的作用就是为了保存会话状态。(用户登录成功后…

Spring使用注解存储和读取对象

文章目录 一、存储Bean对象配置扫描添加注解存储Bean对象注解使用范围Bean的命名五大类注解的关系为什么需要五大类注解? 二、方法注解BeanBean重命名 三、对象注入属性注入Setter注入构造方法注入Autowired 和 Resource 的区别 一、存储Bean对象 之前我们存储Bean时&#xff…

【MATLAB基础绘图第2棒】绘制柱状/饼图填充图

MATLAB绘制柱状填充图 方法1:hatchfill2工具1.1 案例1:柱状图填充1.2 案例2:饼图填充 方法2:applyhatch函数2.1 案例1:柱状图填充2.2 案例2:饼图填充 方法3: applyhatch_plusC函数3.1 案例1&…

分析软件及其隐藏后门实验笔记

软件后门和软件加壳是什么 软件后门可以理解为在软件中植入病毒等具有后门功能的代码,通过运行软件来对用户的系统造成破坏、窃取机密等。 软件加壳一种常用的方式是在二进制的程序中植入一段代码,在运行的时候优先取得程序的控制权,之后再把…

Cisco SD-WAN (Viptela) version 20.11.1 ED - 软件定义广域网

请访问原文链接:https://sysin.org/blog/cisco-sd-wan-20/,查看最新版。原创作品,转载请保留出处。 作者主页:sysin.org 支持 SASE 的架构,其集成了面向多云、安全、统一通信和应用优化的各种功能,可用于轻…

ChatGPT干掉程序员?想多了...

GPT-4才诞生没几天,感觉朋友圈已经被这个人工智能刷屏了,大家一边在感叹人工智能行业蓬勃发展的同时,一边又有不少人患上了AI焦虑症。 这其中,以程序员首当其冲。原因无他,只因为GPT-4的惊人的能力和不少大佬的发言。 …

4.17~4.18学习总结

网络编程 概述 1.什么是网络编程 在网络通信协议下,不同计算机上运行的程序,进行的数据传输,计算机跟计算机之间可以通过网络进行数据传输。 2.常见的软件架构: B/S,C/S 3.通信的软件架构CS BS各有什么区别和优点…

阿里云免费使用stable diffusion三个月【ai生成图片】详细教程【保姆级】

起因 这两天关注了ai生成图片,尝试了mijiourney服务【比较贵没入手】,结果免费的没有了,没用上,换了国内的一些小程序体验了下 综合体验式是太慢了,而他们是基于国外开源的stable diffiusion模型开发的【可以比肩mij…