6.10 最优潮流计算

1、实验目的

最优潮流(Optimal Power Flow,OPF)是指当系统的结构参数和负荷情况都已给定时,调节可利用的控制变量(如发电机输出功率、可调变压器抽头等)来找到能满足所有运行约束条件的,并使系统的某一性能指标(如发电成本或网络损耗)达到最优值下的潮流分布。

从数学上看,最优潮流计算是一个典型的非线性优化问题。通过该应用案例,展示低代码控制器非线性规划(NLP动作)求解功能。

2、实验原理

最优潮流的数学模型如下所示:

潮流方程

式中,F为目标函数;G为等式约束条件;H为不等式约束条件;x为状态变量,u为控制变量。

最优潮流的目标函数类型很多,常见为以下2种:

(1)系统运行成本最小,一般表示为火电机组燃料费用最小(不考虑启动、停机费用)。

(2)有功传输损耗最小,通常以有功传输最小为目标.

最优潮流考虑的系统约束条件有: (1)各节点有功功率和无功功率的平衡约束。 (2)各发电机有功出力上下界约束。 (3)各发电机、同步补偿机无功出力上下界约束。 (4)并联电抗器、电容器容量约束。 (5)移相器抽头位置约束。 (6)可调变压器抽头位置约束。 (7)各节点电压幅值上下界约束。 (8)各支路传输功率约束。

3、实验步骤

本最优潮流计算的对象选取为matpower中的case9标准算例,目标函数为系统运行成本最小(即发电机组有功出力最小)。具体步骤如下

3.1、测点配置

测点配置表格的内容包含了测点的点号、名称、别名、是否离散、是否是计算点以及默认值等。点号是程序里给这个测点的编号,可以自己定义,使用时,测点与通信通道的点号一一对应完成对接。别名是英文字母与下划线组合使用,可以当做变量名用于AOE表格里表达式的书写,使之可以不用点号来表达,使得表达式的意思表达得更加清楚。本案例测点配置如下:

序号点号名称别名是否离散是否计算点默认值备注
1100001测点1DoCal_POINTTRUEFALSE0计算控制
2100002测点2V1FALSEFALSE1节点1电压幅值
3100003测点3V2FALSEFALSE1节点2电压幅值
4100004测点4V3FALSEFALSE1节点3电压幅值
5100005测点5V4FALSEFALSE1节点4电压幅值
6100006测点6V5FALSEFALSE1节点5电压幅值
7100007测点7V6FALSEFALSE1节点6电压幅值
8100008测点8V7FALSEFALSE1节点7电压幅值
9100009测点9V8FALSEFALSE1节点8电压幅值
10100010测点10V9FALSEFALSE1节点9电压幅值
11100011测点11THETA1FALSEFALSE0节点1电压相角
12100012测点12THETA2FALSEFALSE0节点2电压相角
13100013测点13THETA3FALSEFALSE0节点3电压相角
14100014测点14THETA4FALSEFALSE0节点4电压相角
15100015测点15THETA5FALSEFALSE0节点5电压相角
16100016测点16THETA6FALSEFALSE0节点6电压相角
17100017测点17THETA7FALSEFALSE0节点7电压相角
18100018测点18THETA8FALSEFALSE0节点8电压相角
19100019测点19THETA9FALSEFALSE0节点9电压相角
20100020测点20PG1FALSEFALSE0发电机1有功输出
21100021测点21PG2FALSEFALSE0发电机2有功输出
22100022测点22PG3FALSEFALSE0发电机3有功输出
23100023测点23QG1FALSEFALSE0发电机1无功输出
24100024测点24QG2FALSEFALSE0发电机2无功输出
25100025测点25QG3FALSEFALSE0发电机3无功输出

3.2、AOE配置

本案例中AOE文件配置内容分为三个部分。

AOE网络声明

名称为最优潮流计算,触发条件设置为事件驱动(Event_Drive)。

AOE ID是否启用名称触发条件触发条件参数变量初始值
70001TRUE最优潮流计算Event_DriveV_1:1;V_2:1;V_3:1;V_4:1;V_5:1;V_6:1;V_7:1;V_8:1;V_9:1;
THETA_1:0;THETA_2:0;THETA_3:0;THETA_4:0;THETA_5:0;THETA_6:0;THETA_7:0;THETA_8:0;THETA_9:0;
PG_1:0;PG_2:0;PG_3:0;
QG_1:0;QG_2:0;QG_3:0;

AOE节点声明

AOE ID节点ID名称节点类型超时时间(ms)表达式
700011开始节点Condition10DoCal_POINT > 0.5
700012计算节点Condition101
700013幅值Condition101
700014结束节点Condition10DoCal_POINT == 0

本案例中共有4个节点,节点类型均为Condition,表达式设为1,表明始终满足条件触发执行。

AOE边声明

AOE ID首尾节点动作名称失败模式动作类型动作参数
700011;2进入最优潮流计算DefaultSet_PointsDoCal_POINT:0;
700012;3最优潮流计算DefaultNLP100.0PG_2(8.5PG_2 + 1.2) + 100.0PG_3*(12.25PG_3 + 1.0) + 100.0PG_1*(11.0PG_1 + 5.0) + 1085.0;
17.361111111111111111111111111111
V_1V_4sin(THETA_1 -THETA_4) -PG_1:[0.00000000/0.00000000];
16.0V_2V_8sin(THETA_2 -THETA_8) -PG_2:[0.00000000/0.00000000];
17.064846416382252559726962457338
V_3V_6sin(THETA_3 -THETA_6) -PG_3:[0.00000000/0.00000000];
3.307378962025306456951057043625V_4^2 -V_4V_9*(1.365187713310580204778156996587cos(THETA_4 -THETA_9) - 11.60409556313993174061433447099sin(THETA_4 -THETA_9)) -V_4V_5(1.9421912487147263795270193076659cos(THETA_4 -THETA_5) - 10.510682051867930995087398606192sin(THETA_4 -THETA_5)) - 17.361111111111111111111111111111V_1V_4sin(THETA_1 -THETA_4):[0.00000000/0.00000000];
3.2242003871388416058607617742382
V_5^2 -V_4V_5(1.9421912487147263795270193076659cos(THETA_4 -THETA_5) + 10.510682051867930995087398606192sin(THETA_4 -THETA_5)) -V_5V_6(1.282009138424114920614049505276cos(THETA_5 -THETA_6) - 5.588244962361526013694401626708sin(THETA_5 -THETA_6)) + 0.9:[0.00000000/0.00000000];
2.4370966193142118427772402355913V_6^2 - 17.064846416382252559726962457338V_3V_6sin(THETA_3 -THETA_6) -V_6V_7(1.1550874808900968235094275522337cos(THETA_6 -THETA_7) - 9.784270426363173093256327501274sin(THETA_6 -THETA_7)) -V_5V_6(1.282009138424114920614049505276cos(THETA_5 -THETA_6) + 5.588244962361526013694401626708sin(THETA_5 -THETA_6)):[0.00000000/0.00000000];
2.772209954136232376422626125361V_7^2 -V_7V_8*(1.6171224732461355529131985731272cos(THETA_7 -THETA_8) - 13.697978596908442330558858501784sin(THETA_7 -THETA_8)) -V_6V_7(1.1550874808900968235094275522337cos(THETA_6 -THETA_7) + 9.784270426363173093256327501274sin(THETA_6 -THETA_7)) + 1.0:[0.00000000/0.00000000];
2.8047268525372843761545027518878V_8^2 -V_7V_8*(1.6171224732461355529131985731272cos(THETA_7 -THETA_8) + 13.697978596908442330558858501784sin(THETA_7 -THETA_8)) - 16.0V_2V_8sin(THETA_2 -THETA_8) -V_8V_9*(1.1876043792911486361105956578215cos(THETA_8 -THETA_9) - 5.9751345333085915754314344034144sin(THETA_8 -THETA_9)):[0.00000000/0.00000000];
2.5527920926017282354791859688703V_9^2 -V_4V_9*(1.365187713310580204778156996587cos(THETA_4 -THETA_9) + 11.60409556313993174061433447099sin(THETA_4 -THETA_9)) -V_8V_9(1.1876043792911486361105956578215cos(THETA_8 -THETA_9) + 5.9751345333085915754314344034144sin(THETA_8 -THETA_9)) + 1.25:[0.00000000/0.00000000];
17.361111111111111111111111111111V_1^2 -QG_1 - 17.361111111111111111111111111111V_1V_4cos(THETA_1 -THETA_4):[0.00000000/0.00000000];
16.0V_2^2 -QG_2 - 16.0V_2V_8cos(THETA_2 -THETA_8):[0.00000000/0.00000000];
17.064846416382252559726962457338V_3^2 -QG_3 - 17.064846416382252559726962457338V_3V_6cos(THETA_3 -THETA_6):[0.00000000/0.00000000];
39.308888726118972556378139415756V_4^2 -V_4V_9*(11.60409556313993174061433447099cos(THETA_4 -THETA_9) + 1.365187713310580204778156996587sin(THETA_4 -THETA_9)) - 17.361111111111111111111111111111V_1V_4cos(THETA_1 -THETA_4) -V_4V_5*(10.510682051867930995087398606192cos(THETA_4 -THETA_5) + 1.9421912487147263795270193076659sin(THETA_4 -THETA_5)):[0.00000000/0.00000000];
15.840927014229457370220188749954V_5^2 -V_4V_5*(10.510682051867930995087398606192cos(THETA_4 -THETA_5) - 1.9421912487147263795270193076659sin(THETA_4 -THETA_5)) -V_5V_6(5.588244962361526013694401626708cos(THETA_5 -THETA_6) + 1.282009138424114920614049505276sin(THETA_5 -THETA_6)) + 0.3:[0.00000000/0.00000000];
32.15386180510695623979700030759V_6^2 - 17.064846416382252559726962457338V_3V_6cos(THETA_3 -THETA_6) -V_6V_7(9.784270426363173093256327501274cos(THETA_6 -THETA_7) + 1.1550874808900968235094275522337sin(THETA_6 -THETA_7)) -V_5V_6(5.588244962361526013694401626708cos(THETA_5 -THETA_6) - 1.282009138424114920614049505276sin(THETA_5 -THETA_6)):[0.00000000/0.00000000];
23.303249023271618511898850556463V_7^2 -V_7V_8*(13.697978596908442330558858501784cos(THETA_7 -THETA_8) + 1.6171224732461355529131985731272sin(THETA_7 -THETA_8)) -V_6V_7(9.784270426363173093256327501274cos(THETA_6 -THETA_7) - 1.1550874808900968235094275522337sin(THETA_6 -THETA_7)) + 0.35:[0.00000000/0.00000000];
35.445613130217033415192418033257V_8^2 - 16.0V_2V_8cos(THETA_2 -THETA_8) -V_7V_8(13.697978596908442330558858501784cos(THETA_7 -THETA_8) - 1.6171224732461355529131985731272sin(THETA_7 -THETA_8)) -V_8V_9(5.9751345333085915754314344034144cos(THETA_8 -THETA_9) + 1.1876043792911486361105956578215sin(THETA_8 -THETA_9)):[0.00000000/0.00000000];
17.33823009644852319866004108917V_9^2 -V_4V_9*(11.60409556313993174061433447099cos(THETA_4 -THETA_9) - 1.365187713310580204778156996587sin(THETA_4 -THETA_9)) -V_8V_9(5.9751345333085915754314344034144cos(THETA_8 -THETA_9) - 1.1876043792911486361105956578215sin(THETA_8 -THETA_9)) + 0.5:[0.00000000/0.00000000];
17.361111111111111111111111111111V_1V_4sin(THETA_1 -THETA_4):[/2.50000000];
-17.361111111111111111111111111111
V_1V_4sin(THETA_1 -THETA_4):[/2.50000000];
1.9421912487147263795270193076659V_4^2 -V_4V_5*(1.9421912487147263795270193076659cos(THETA_4 -THETA_5) - 10.510682051867930995087398606192sin(THETA_4 -THETA_5)):[/2.50000000];
1.9421912487147263795270193076659V_5^2 -V_4V_5*(1.9421912487147263795270193076659cos(THETA_4 -THETA_5) + 10.510682051867930995087398606192sin(THETA_4 -THETA_5)):[/2.50000000];
1.282009138424114920614049505276V_5^2 -V_5V_6*(1.282009138424114920614049505276cos(THETA_5 -THETA_6) - 5.588244962361526013694401626708sin(THETA_5 -THETA_6)):[/1.50000000];
1.282009138424114920614049505276V_6^2 -V_5V_6*(1.282009138424114920614049505276cos(THETA_5 -THETA_6) + 5.588244962361526013694401626708sin(THETA_5 -THETA_6)):[/1.50000000];
17.064846416382252559726962457338V_3V_6sin(THETA_3 -THETA_6):[/3.00000000];
-17.064846416382252559726962457338
V_3V_6sin(THETA_3 -THETA_6):[/3.00000000];
1.1550874808900968235094275522337V_6^2 -V_6V_7*(1.1550874808900968235094275522337cos(THETA_6 -THETA_7) - 9.784270426363173093256327501274sin(THETA_6 -THETA_7)):[/1.50000000];
1.1550874808900968235094275522337V_7^2 -V_6V_7*(1.1550874808900968235094275522337cos(THETA_6 -THETA_7) + 9.784270426363173093256327501274sin(THETA_6 -THETA_7)):[/1.50000000];
1.6171224732461355529131985731272V_7^2 -V_7V_8*(1.6171224732461355529131985731272cos(THETA_7 -THETA_8) - 13.697978596908442330558858501784sin(THETA_7 -THETA_8)):[/2.50000000];
1.6171224732461355529131985731272V_8^2 -V_7V_8*(1.6171224732461355529131985731272cos(THETA_7 -THETA_8) + 13.697978596908442330558858501784sin(THETA_7 -THETA_8)):[/2.50000000];
-16.0V_2V_8sin(THETA_2 -THETA_8):[/2.50000000];
16.0
V_2V_8sin(THETA_2 -THETA_8):[/2.50000000];
1.1876043792911486361105956578215V_8^2 -V_8V_9*(1.1876043792911486361105956578215cos(THETA_8 -THETA_9) - 5.9751345333085915754314344034144sin(THETA_8 -THETA_9)):[/2.50000000];
1.1876043792911486361105956578215V_9^2 -V_8V_9*(1.1876043792911486361105956578215cos(THETA_8 -THETA_9) + 5.9751345333085915754314344034144sin(THETA_8 -THETA_9)):[/2.50000000];
1.365187713310580204778156996587V_9^2 -V_4V_9*(1.365187713310580204778156996587cos(THETA_4 -THETA_9) + 11.60409556313993174061433447099sin(THETA_4 -THETA_9)):[/2.50000000];
1.365187713310580204778156996587V_4^2 -V_4V_9*(1.365187713310580204778156996587cos(THETA_4 -THETA_9) - 11.60409556313993174061433447099sin(THETA_4 -THETA_9)):[/2.50000000];
THETA_1:[0.00000000/0.00000000];
PG_1:[0.10000000/2.50000000/],PG_2:[0.10000000/3.00000000/],PG_3:[0.10000000/2.70000000/],QG_1:[-3.00000000/3.00000000/],QG_2:[-3.00000000/3.00000000/],QG_3:[-3.00000000/3.00000000/],V_1:[0.90000000/1.10000000/],V_2:[0.90000000/1.10000000/],V_3:[0.90000000/1.10000000/],V_4:[0.90000000/1.10000000/],V_5:[0.90000000/1.10000000/],V_6:[0.90000000/1.10000000/],V_7:[0.90000000/1.10000000/],V_8:[0.90000000/1.10000000/],V_9:[0.90000000/1.10000000/],THETA_1:[//],THETA_2:[//],THETA_3:[//],THETA_4:[//],THETA_5:[//],THETA_6:[//],THETA_7:[//],THETA_8:[//],THETA_9:[//]
700013;4赋值DefaultSet_PointsV1:V_1;
V2:V_2;
V3:V_3;
V4:V_4;
V5:V_5;
V6:V_6;
V7:V_7;
V8:V_8;
V9:V_9;
THETA1:THETA_1;
THETA2:THETA_2;
THETA3:THETA_3;
THETA4:THETA_4;
THETA5:THETA_5;
THETA6:THETA_6;
THETA7:THETA_7;
THETA8:THETA_8;
THETA9:THETA_9;
PG1:PG_1;
PG2:PG_2;
PG3:PG_3;
QG1:QG_1;
QG2:QG_2;
QG3:QG_3;

4、运行计算

将上述配置文件上传至低代码控制器中,运行即可得到计算结果,其运算结果如下所示。

最优潮流计算结果

matpower计算结果如下:

matpower最优潮流计算结果

对比低代码控制器与matpower计算结果,可见低代码控制器对于交流法潮流能够精确计算(其中电压相角值的单位,低代码控制器为弧度,matpower为角度;低代码控制器的功率需乘以基准值100MW)。

附件:最优潮流计算.rar