部分代码:
clear
clc
%% 参数输入
data_genunit=xlsread('参数输入2.xlsx','火电机组');
data_storage=xlsread('参数输入2.xlsx','储能电站');
data_loadcurve=xlsread('参数输入2.xlsx','负荷曲线');
data_network=xlsread('参数输入2.xlsx','网络参数');
%%%%导入出力计划
u=load('u_scuc.mat');
u_ch=load('uch_scuc.mat');
u_dis=load('udis_scuc.mat');
costH=load('costH.mat');
costJ=load('costJ.mat');
u=u.u;
u_ch=u_ch.u_ch;
u_dis=u_dis.u_dis;
costH=costH.costH;
costJ=costJ.costJ;
%%%%调度时长
T=96;
baseMVA=100;
u0=[1 1 1 1 0 0 0 0 0 0]'; %初始状态
%%%%火电机组
genunit=struct;
genunit.node=data_genunit(:,2); %所在节点
genunit.pmax=data_genunit(:,3);
genunit.pmin=data_genunit(:,4);
genunit.price_gener=data_genunit(:,5); %发电报价
genunit.rate=data_genunit(:,6); %上下坡速率
genunit.climb=(genunit.pmax+genunit.pmin)./3; %启停爬坡速率
genunit.time=data_genunit(:,7); %开停机最小持续时间
genunit.cost_start=data_genunit(:,8); %启动成本
genunit.cost_stop=data_genunit(:,9); %关停成本
genunit.price_mil=data_genunit(:,10); %里程报价
genunit.price_cap=data_genunit(:,11); %容量报价
genunit.fm_perfor=data_genunit(:,12); %调频性能
genunit.fm_cap=data_genunit(:,13); %调频容量占比
genunit.mil_cap=data_genunit(:,14); %里程-容量比
gen_num=size(genunit.node,1); %火电机组数量
%%%%储能电站
storage=struct;
storage.node=data_storage(:,2); %所在节点
storage.price_dis=data_storage(:,3); %放电报价
storage.price_ch=data_storage(:,4); %充电报价
storage.power=data_storage(:,5); %充放电功率
storage.cap=data_storage(:,6); %容量
storage.cap_max=data_storage(:,7); %最大容量
storage.cap_min=data_storage(:,8); %最小容量
storage.eff=data_storage(:,9); %充放电效率
storage.price_gener=data_storage(:,10); %发电报价
storage.price_mil=data_storage(:,11); %里程报价
storage.price_cap=data_storage(:,12); %容量报价
storage.fm_perfor=data_storage(:,13); %调频性能
storage.fm_cap=data_storage(:,14); %调频容量占比
storage.mil_cap=data_storage(:,15); %历史里程-容量比
storage_num=size(storage.node,1); %储能电站数量
storage.cap_ini=0.1*ones(storage_num,1); %初始容量
storage.cap_final=0.1*ones(storage_num,1); %末时容量
%%%%负荷曲线
load=data_loadcurve;
bus_num=size(load,1)-1;
load_all=data_loadcurve(size(load,1),:);
load_all=load_all(:,2:end); %各时刻总负荷
P_load=load(1:bus_num,2:T+1);
%%%%网络参数
branch=struct;
branch.i=data_network(:,2);
branch.j=data_network(:,3);
branc