💥1 概述
最优潮流(OPF)是指在满足电网约束的同时,以最小的成本将负荷分配给电厂。描述为在满足网络(潮流)约束的情况下最小化所有承诺的工厂的总燃料成本的优化问题。
📚2 运行结果
这里仅展现部分运行结果
%% Define Variables and Constraints % decision variables g = sdpvar(2,1); p = sdpvar(5,1); theta = sdpvar(4,1); % objective function: min z = g1^2 + 40g1 + g2^2 + 50g2 P = [1 0;0 1]; q = [40;50]; z = g.'*P*g + q.'*g; % constraints: A*g<=b; g>=0; IN*p=g-d; IN.'*theta=p.*X; A = [1 2;4 3]; b = [40;120]; g_all = [g;0;0]; d = [0;0;10;20]; X = [0.01;0.01;0.01;0.02;0.01]; Cons = [A*g<=b; g>=0; IN*p==g_all-d; IN.'*theta==p.*X; p<=20; p>=-20]; % solve ops = sdpsettings('verbose',0,'solver','gurobi'); sol = optimize(Cons,z,ops); if(~sol.problem) s_g = value(g) s_p = value(p) s_theta = value(theta) s_z = value(z) % visualization G = digraph(startNode,endNode); pic = plot(G); %layout(pic,'layered'); labeledge(pic,1:numedges(G),s_p);% 画出线路潮流 for i = 1:4 if(i<3) strMat{i,1}=[num2str(orderedNode(i,1)),',',num2str(s_g(i,1)),',',num2str(d(i,1)),',',num2str(s_theta(i,1))]; else strMat{i,1}=[num2str(orderedNode(i,1)),',',num2str(0),',',num2str(d(i,1)),',',num2str(s_theta(i,1))]; end end labelnode(pic,1:numnodes(G),strMat);% 按编号、p、d、theta排列节点求解信息 else printf('Optimal result not found!'); end %% 该函数负责生成节点关联矩阵,考虑了非连续\编号不从0开始的情况,将节点从小到大排列 function [orderedNode,y] = myincidence(startNode,endNode) uniNode = unique([startNode;endNode]); orderedNode= sort(uniNode); y = zeros(size(uniNode,2),size(startNode,1)); for i = 1:size(startNode,1) y(orderedNode==startNode(i,1),i) = 1; y(orderedNode==endNode(i,1),i) = -1; end end
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]金国彬,石超,陈庆,李国庆,潘狄,成龙.考虑变换器功率约束和直流电压约束的交直流混合配电网最优潮流计算[J].电网技术,2021,45(04):1487-1496.DOI:10.13335/j.1000-3673.pst.2020.1527.