Page 1

	

A	Note	on	the	Computational	Testing	of	AC	Optimal	Power	Flow		

Using	the	Current	Voltage	Formulations	

Richard	P	O’Neill,	Anya	Castillo	and	Mary	Cain		

richard.oneill@ferc.gov;	anya.castillo@ferc.gov;	mary.cain@ferc.gov	

September	2013

	

Background.		We	solve	a	set	of	IEEE	test	problems	ሺ14,	30,	57,	118	and	300	busሻ	on	a	

different	hardware	platform	with	the	same	software	and	compare	the	results	to	

those	in	O’Neill,	Castillo	and	Cain	ሺ2012ሻ.		The	GAMS	code	to	test	the	solvers	is	

unchanged.	In	O’Neill,	Castillo	and	Cain	ሺ2012ሻ,	the	problems	were	originally	solved	

on	a	DELL	Latitude	laptop	with	an	Intel®	CoreTM	i5‐540M	ሺ2.53GHz,	3M	cacheሻ,	

4GB	memory,	32‐bit	and	a	Vista	operating	system	ሺ32	bitሻ.	The	new	hardware	is	a	

DELL	Latitude	laptop	with	CoreTM	i7‐3520M	ሺ2.90GHz,ሻ	and	8GB	memory,	64‐bit	

with	a	Windows	7	operating	system	ሺ64	bitሻ.	Below	the	old	and	new	hardware	

platforms	will	be	referred	to	as	32‐bit	and	64‐bit,	respectively.	

We	used	the	same	GAMS	code	with	two	nonlinear	solvers:	IPOPT	3.8	and	CONOPT	

3.14	and	two	linear	programs	solvers:	CPLEX	12.2.0.1	and	GUROBI	4.0.0.	Differences	

in	solution	times	were	recorded	when	the	problems	were	run	at	different	times.			

Approach.		We	solve	the	nonlinear	IV	formulation	of	the	test	problems	with	

quadratic	costs	ሺOPF2ሻ	to	benchmark	the	solvers	against	the	generally	accepted	

optimal	solution.	Next,	we	solve	the	nonlinear	IV	formulation	with	a	linear	ten‐step	

objection	function	ሺOPFሻ	approximating	the	quadratic	costs	to	benchmark	the	linear	

objective	function	and	examine	how	the	software	performs	with	a	linear	objective	

function.	We	then	solve	a	series	of	linearized	IV	formulations	ሺOPFlinሻ.	Finally,	we	

make	an	additional	run	through	the	nonlinear	IV	formulation	with	the	linear	

objective	function	starting	with	the	optimal	solution	to	the	last	iteration	of	the	

linearized	IV	formulation	OPFlin	ሺOPFpሻ.	We	also	solve	and	present	the	BTHETA	

formulation	for	contrast.	We	apply	IPOPT	and	CONOPT	to	OPF2,	OPF	and	OPFp;	we	

apply	CPLEX	12.2.0.1	and	GUROBI	4.0.0	to	OPFlin	and	BTHETA.	Therefore	we	

consider	for	each	of	the	five	problems,	the	above	nonlinear	or	linear	solver;	we	refer	

to	this	as	the	five	solver‐problem	combinations.	

Starting	Points.	We	solve	each	test	problem	with	ten	different	starting	points.	The	

first	starting	point	is	a	‘flat’	start	ሺin	polar	coordinates,	voltage	magnitude	ൌ	1	and	

voltage	angle	ൌ	0ሻ	for	all	buses.	The	remaining	nine	points	are	uniformly	random	

points	that	satisfy	the	voltage	magnitude	constraints.	The	starting	value	for	current	

is	I	ൌ	YV	where	V	is	the	randomly	generated	point.	This	I,	V	point	satisfies	the	
Page 2

current	flow	equations	but	not	necessarily	the	generator	and	load	constraints	at	

each	bus.	

Test	Problems.		Summary	parameters,	the	widely	accepted	quadratic	optimal	value,	

and	the	step	function	approximation	of	the	objective	function	for	each	test	problem	

are	in	Table	1.	

Table	1.	Test	problem	parameters	and	optimal	solutions	

Nodes	 Branches	 Generators Demand Vmax Vmin Best	Known	

	 	 Number	 Capacity	 Optimal	Value	

	 	 	 Step	

Function	

Quadratic

14	 20	 5	 7.724 2.590 1.06 0.94 82.76	 80.81

30	 41	 6	 326.80 42.42 1.10 0.95 5.918	 5.745

57	 80	 7	 326.78 235.26 1.06 0.94 423.7	 417.4

118	 186	 54	 99.66 42.42 1.06 0.94 1311	 1297

300	 411	 69	 19.76 12.51 1.06 0.94 7488	 7197

Results		

Speedup.		Table	2	presents	the	average	speedups.		We	define	speedup	as	1‐	ሺaverage	

time	for	64‐bitሻ/ሺaverage	time	for	32‐bitሻ.		With	the	exception	of	four	solver‐

problem	combinations	the	speedups	ranged	from	0.18	to	0.95.		Based	on	processor	

speed	alone,	a	speedup	of	about	0.15	is	expected.	The	four	solver‐problem	

combinations	without	speedups	were	in	solving	the	smaller	problemsሺ14	and	30	

busሻ.	For	the	nonlinear	solvers	on	the	larger	ሺ57,	118	and	300	busሻ	problems,	the	

speedups	were	between	0.42	and	0.95.	For	the	linear	solvers	on	the	larger	ሺ57,	118	

and	300	busሻ	problems,	the	speedups	were	between	0.27	and	0.73.		There	are	no	

obvious	reasons	why	the	smaller	problems	did	not	result	in	similar	speedups	to	the	

larger	problems.		

Objective	function.		For	the	14	and	30	bus	problems,	the	same	objective	function	

values	were	found	in	almost	all	comparative	instances.	For	the	57	bus	problem,	

CONOPT‐OPF2	performed	better	on	the	64‐bit	machine,	but	for	the	remaining	

problems,	the	same	objective	function	values	were	found	in	almost	all	comparative	

instances.	For	the	118	bus	problem,	CONOPT	and	IPOPT	had	problems	solving	OPF2	

and	CONOPT	also	had	problems	solving	OPF.		For	the	300	bus	problem,	CONOPT‐

OPF2	performed	better	on	the	64‐bit	machine,	but	for	the	remaining	problems,	the	

same	objective	function	values	were	found	in	almost	all	comparative	instances.		

Appendix	A	contains	more	detailed	results.	
Page 3

Additional	Results	for	64‐bit	machine.	For	the	30	bus	problem,	2	of	10	instances	of	

IPOPT‐OPF	declared	local	optimality	with	active	penalty	variables.		For	the	57	bus	

problem,	3	of	10	instances	of	CONOPT‐OPF2	declared	local	optimality	with	active	

penalty	variables.		For	the	118	bus	problem,	9	of	10	instances	of	CONOPT‐OPF2,	

declared	local	optimality	with	active	penalty	variables;	3	of	10	instances	of	CONOPT‐

OPF	declared	local	optimality	with	active	penalty	variables	and	1	of	10	instances	of	

CONOPT‐OPFp	declared	local	optimality	with	active	penalty.		

Table	2.	Fractional	Speedups	with	New	Hardware	

14bus 30bus 57bus 118bus 300bus

OPF2 CONOPT 0.38 0.63 0.53 0.61 0.67

OPF2 IPOPT 0.42 0.61 0.64 0.72 0.95

OPF CONOPT ‐0.24 0.29 0.53 0.76 0.59

OPF IPOPT 0.27 0.20 0.64 0.79 0.79

OPFp CONOPT ‐0.70  ‐0.10 0.53 0.59 0.44

OPFp IPOPT 0.42 0.53 0.65 0.80 0.42

BTHETA GUROBI 0.00 ‐2.06 0.65 0.71 0.88

BTHETA CPLEX ‐0.32 0.67 0.45 0.69 0.90

OPFlin GUROBI 0.18 0.72 0.68 0.66 0.42

OPFlin CPLEX 0.49 0.66 0.42 0.73 0.27

	

Reference		

Richard	P	O’Neill,	Anya	Castillo	and	Mary	Cain,	“The	Computational	Testing	of	AC	Optimal	

Power	Flow	Using	the	Current	Voltage	Formulations,”	FERC	Staff	Technical	Paper,	

December	2012,	http://www.ferc.gov/industries/electric/indus‐act/market‐planning/opf‐

papers/acopf‐3‐iv‐linearization‐testing.pdf	

Appendix		

Solution	Statistics.	The	summary	statistics	are	over	the	set	of	starting	points.	They	include		

	 OPTVAVG	is	the	average	optimal	solution	with	penalty	variables	set	to	zero	if	necessary.		

	 OPTVCV	is	the	coefficient	of	variation	ሺstandard	deviation/meanሻ	of	optimal	values		

.	 CPUAVG	is	the	average	cpu	time.		

CPUCV	is	the	coefficient	of	variation	ሺstandard	deviation/meanሻ	of	CPU	times		

	 CPUMAX	is	the	maximum	cpu	time.		

	 CONVRG	for	non‐linear	solvers	is	the	number	that	reported	convergence	over	the	ten	

	 starting	points,	that	is,	did	not	exceed	the	maximum	time	limit	of	1000	seconds.		

	 NUMLPS	is	the	total	number	of	linear	programs.	

	 MAXLPS	is	the	number	of	times	the	maximum	number	of	linear	programs	was	reached.		

	 MINOPF	is	the	minimum	objective	function	value	found.		

	 TEPSIN	is	the	number	of	starting	points	that	declared	a	local	optimum	with	nonzero	penalty		

	 	 variables.		
Page 4

The	32‐bit	hardware	was	run	in	March	2012.		The	64‐bit	hardware	was	run	in	August/September	

2013.	The	results	for	the	64‐bit	hardware	are	in	bold	and	italics.	 	
Page 5

Table	for	14	bus	problem.

type	 OPTVAVG	 OPTVCV	 CPUAVG CPUCV CPUMAX CONVRG TEPSIN	 MINOPT

OPF2	

CONOPT	 80.82	 0.000	 0.083 0.065 0.109 10 0	 80.82

80.82	 0.000	 0.056 0.587 0.125 10 0	 80.82

80.82	 0.000	 0.047 0.635 0.094 10 0	 80.82

IPOPT	 80.82	 0.000	 0.432 0.062 0.562 10 0	 80.82

80.82	 0.000	 0.282 0.074 0.421 10 0	 80.82

80.82	 0.000	 0.219 0.380 0.406 10 0	 80.82

OPF		 0	

CONOPT	 82.76	 0.000	 0.056 0.152 0.109 10 0	 82.76

82.76	 0.000	 0.076 0.460 0.109 9 0	 82.76

82.76	 0.000	 0.063 0.742 0.140 10 0	 82.76

IPOPT	 82.76	 0.000	 0.446 0.058 0.546 10 0	 82.76

82.76	 0.000	 0.356 0.064 0.452 10 0	 82.76

82.76	 0.000	 0.295 0.321 0.531 10 0	 82.76

OPFp	 0	

CONOPT	 82.76	 0.000	 0.020 0.307 0.062 10 0	 82.76

82.76	 0.000	 0.039 0.606 0.078 8 0	 82.76

82.76	 0.000	 0.029 0.414 0.047 10 0	 82.76

IPOPT	 82.76	 0.000	 0.237 0.039 0.281 10 0	 82.76

82.76	 0.000	 0.120 0.049 0.265 10 0	 82.76

82.76	 0.000	 0.154 0.382 0.265 10 0	 82.76

BTHETA	 NUMLP MAXLPS	

GUROBI		 76.59	 0.000	 0.002 0.050 0.002 10 0	

		 76.59	 0.000	 0.002 0.050 0.002 10 0	

		 76.59	 0.000	 0.002 0.153 0.004 10 0	

76.59	 0.000	 0.002 0.323 0.002 10 0	

76.59	 0.000	 0.002 0.471 0.003 10 0	

CPLEX	 76.59	 0.000	 0.009 0.049 0.011 10 0	

		 76.59	 0.000	 0.010 0.111 0.02 10 0	

76.59	 0.000	 0.007 0.152 0.008 10 0	

76.59	 0.000	 0.018 2.190 0.128 10 0	

OPFlin	 		

GUROBI		 82.40	 0.003	 0.022 0.306 0.003 56 0	

		 82.40	 0.003	 0.022 0.281 0.003 56 0	

		 82.40	 0.003	 0.024 0.332 0.004 56 0	

82.35	 0.003	 0.018 0.321 0.028 55 0	

82.40	 0.003	 0.019 0.323 0.033 56 0	

CPLEX	 82.37	 0.003	 0.063 0.125 0.008 62 0	

		 82.37	 0.003	 0.065 0.214 0.008 62 0	

82.37	 0.003	 0.018 0.321 0.028 62 0	

82.37	 0.003	 0.047 0.297 0.069 62 0	

	 	
Page 6

Table	for	30	bus	problems

OPTVAVG	 OPTVCV	 CPUAVG CPUCV CPUMAX CONVRG TEPSIN	 MINOPT

OPF2	

CONOPT	 5.745	 0.000	 0.175 0.098 0.296 10 0	 5.745

5.745	 0.000	 0.073 0.471 0.156 10 0	 5.745

5.745	 0.000	 0.056 0.350 0.093 10 0	 5.745

IPOPT	 5.745	 0.000	 1.019 0.084 1.700 10 0	 5.745

5.745	 0.000	 0.379 0.266 0.530 10 0	 5.745

5.745	 0.000	 0.415 0.234 0.671 10 2	 5.745

OPF		

CONOPT	 5.918	 0.000	 0.097 0.138 0.188 10 0	 5.918

5.918	 0.000	 0.076 0.46 0.140 10 0	 5.918

5.918	 0.000	 0.061 0.425 0.109 10 0	 5.918

IPOPT	 5.919	 0.000	 0.760 0.087 1.235 8 0	 5.918

5.919	 0.000	 0.591 0.207 0.811 8 0	 5.918

5.919	 0.000	 0.634 0.191 0.780 8 0	 5.918

OPFp	

CONOPT	 5.918	 0.000	 0.04 0.189 0.078 10 0	 5.918

5.918	 0.000	 0.048 0.695 0.094 10 0	 5.918

5.918	 0.000	 0.040 0.716 0.093 10 0	 5.918

IPOPT	 5.919	 0.000	 0.772 0.07 1.154 10 0	 5.918

5.919	 0.000	 0.395 0.232 0.499 10 0	 5.918

5.919	 0.000	 0.328 0.283 0.499 10 0	 5.918

OPFlin	 NUMLP MAXLPS	

GUROBI		 5.909	 0.004	 0.167 0.185 0.020 80 0	

5.909	 0.004	 0.185 0.191 0.028 80 0	

5.909	 0.004	 0.189 0.216 0.019 80 0	

5.910	 0.004	 0.050 0.199 0.061 80 0	

5.801	 0.002	 0.050 0.193 0.065 77 0	

CPLEX	 5.910	 0.004	 0.300 0.202 0.030 88 0	

5.910	 0.004	 0.308 0.181 0.045 88 0	

5.910	 0.004	 0.104 0.203 0.129 77 5	

5.910	 0.004	 0.102 0.393 0.204 80 5	

BTHETA	

GUROBI		 5.659	 0.000	 0.008 0.026 0.009 10 0	

5.659	 0.000	 0.009 0.075 0.013 10 0	

5.659	 0.000	 0.009 0.048 0.011 10 0	

5.659	 0.000	 0.003 0.269 0.004 10 0	

5.801	 0.002	 0.050 0.193 0.065 77 0	

CPLEX	 5.659	 0.000	 0.024 0.017 0.028 10 0	

5.659	 0.000	 0.028 0.11 0.056 10 0	

5.659	 0.000	 0.009 0.16 0.011 10 0	

5.659	 0.000	 0.008 0.189 0.012 10 0	

Note:	For	the	IPOPT‐OPF,	2	of	10	instances	declared	local	optimality	with	penalty	variables	in	the	

objective	function.	

	 	
Page 7

Table for 57bus problem

OPF2 OPTVAVG OPTVCV CPUAVG CPUCV CPUMAX CONVRG TEPSIN MINOPT

CONOPT 456.72 0.054 0.817 0.130 1.279 9 2 417.38

417.38 0.000 0.445 0.408 0.686 10 2 417.38

417.38 0.000 0.325 0.403 0.499 10 3 417.38

IPOPT 417.38 0.000 2.861 0.085 4.180 10 0 417.38

417.38 0.000 1.153 0.469 2.138 10 0 417.38

417.38 0.000 0.909 0.228 1.233 10 0 417.38

OPF  

CONOPT 423.75 0.000 0.445 0.122 0.671 10 0 423.75

423.75 0.000 0.220 0.627 0.453 10 0 423.75

423.75 0.000 0.198 0.508 0.390 10 0 423.75

IPOPT 423.76 0.000 2.718 0.073 4.150 10 0 423.75

423.76 0.000 1.143 0.441 2.355 10 0 423.75

423.76 0.000 0.824 0.196 1.061 10 0 423.75

OPFp

CONOPT 423.75 0.000 0.226 0.087 0.343 10 0 423.75

423.75 0.000 0.136 0.375 0.219 10 0 423.75

423.75 0.000 0.075 0.638 0.203 10 0 423.75

IPOPT 423.76 0.000 2.348 0.178 6.022 10 0 423.75

423.76 0.000 0.920 0.446 1.904 10 0 423.75

423.76 0.000 0.730 0.591 1.903 10 0 423.75

OPFlin NUMLP MAXLPS

GUROBI   420.88 0.003 0.278 0.171 0.046 50 0

420.88 0.003 0.280 0.185 0.044 50 0

420.88 0.003 0.288 0.171 0.043 50 0

420.87 0.003 0.121 0.712 0.345 50 0

420.87 0.003 0.075 0.162 0.092 50 0

CPLEX 420.59 0.003 0.384 0.257 0.102 56 0

420.59 0.003 0.153 0.223 0.043 56 0

420.59 0.003 0.183 0.221 0.227 56 0

420.59 0.003 0.111 0.261 0.156 56 0

BTHETA

GUROBI   410.58 0.000 0.020 0.032 0.025 10 0

410.58 0.000 0.021 0.045 0.027 10 0

410.58 0.000 0.024 0.060 0.030 10 0

410.58 0.000 0.008 0.413 0.017 10 0

410.58 0.000 0.006 0.092 0.006 10 0

CPLEX 410.58 0.000 0.019 0.031 0.024 10 0

410.58 0.000 0.047 0.049 0.063 10 0

410.58 0.000 0.024 0.179 0.032 10 0

410.58 0.000 0.014 0.079 0.016 10 0

Note:	For	the	CONOPT‐OPF2,	3	of	10	instances	declared	local	optimality	with	penalty	variables	in	the	

objective	function.	

	 	
Page 8

Table for 118 bus problem

OPF2 OPTVAVG OPTVCV CPUAVG CPUCV CPUMAX CONVRG TEPSIN MINOPF

CONOPT 1807 0.049 8.441 0.103 14.227 9 9 1297

1297 3.317 0.366 5.975 10 9 1297

1297 3.317 0.366 5.975 10 9 1297

IPOPT 1956 0.038 10.906 0.113 20.327 10 10 1510

1297 3.310 0.378 6.099 10 10 1297

   2.728 0.359 4.805 10 10

OPF  

CONOPT 1467 0.056 6.204 0.335 25.053 10 3 1311

1312 0.000 1.462 0.475 3.120 10 0 1312

1312 0.000 1.462 0.475 3.120 10 0 1312

IPOPT 1312 0.000 9.076 0.037 10.764 10 0 1311

1312 0.000 1.538 0.475 3.417 10 0 1312

1312 0.000 2.346 0.123 2.776 10 0 1312

OPFp

CONOPT 1326 0.012 1.911 0.232 5.990 10 1 1314

1312 0.000 0.785 0.642 2.137 10 1 1312

1312 0.000 0.785 0.642 2.137 10 1 1312

IPOPT 1367 0.038 5.022 0.204 13.977 10 1 1311

1312 0.000 0.743 0.614 1.981 10 1 1312

1312 0.000 1.311 0.539 3.183 10 1 1312

OPFlin NUMLP MAXLPS

GUROBI   1293 0.006 1.890 0.410 0.150 86 0

1293 0.006 1.890 0.410 0.150 86 0

1293 0.006 1.950 0.410 0.160 86 0

1295 0.006 0.617 0.423 1.043 86 9

1294 0.006 0.492 0.401 0.830 86 9

CPLEX 1295 0.006 1.890 0.430 0.170 82 0

1295 0.006 1.970 0.450 0.180 82 0

1295 0.006 0.571 0.449 1.043 82 5

1295 0.006 0.619 0.449 1.047 82 5

BTHETA

GUROBI   1261 0.000 0.090 0.030 0.100 10 0

1261 0.000 0.090 0.030 0.110 10 0

1261 0.000 0.090 0.030 0.110 10 0

1261 0.000 0.038 0.061 0.044 10 0

1261 0.000 0.024 0.127 0.029 10 0

CPLEX 1261 0.000 0.130 0.010 0.140 10 0

1261 0.000 0.150 0.070 0.210 10 0

1261 0.000 0.038 0.127 0.052 10 0

1261 0.000 0.038 0.127 0.052 10 0

Note:		For	the	CONOPT‐OPF2,	9	of	10	instances	declared	local	optimality	with	penalty	variables	in	the	

objective	function.		For	the	CONOPT‐OPF,	3	of	10	instances	declared	local	optimality	with	penalty	

variables	in	the	objective	function.		For	the	CONOPT	and	IPOPT‐OPFp,	1	of	10	instances	declared	

local	optimality	with	penalty	variables	in	the	objective	function.		For	the	IPOPT‐OPF2,	10	of	10	

instances	declared	local	optimality	with	penalty	variables	in	the	objective	function.			

	 	
Page 9

Table for the 300 bus problem

OPF2 OPTVAVG OPTVCV CPUAVG CPUCV CPUMAX CONVRG TEPSIN MINOPT

CONOPT 7229 0.004 24.500 0.061 30.000 10 1 7197

7197 0.000 8.146 0.169 10.670 10 10 7197

7197 0.000 8.146 0.169 10.670 10 10 7197

IPOPT 7345 0.008 34.700 0.130 73.000 10 4 7197

7197 0.000 1.683 0.853 5.538 10 10 7197

7197 0.000 1.683 0.853 5.538 10 10 7197

OPF  

CONOPT 7488 0.000 6.600 0.086 11.100 10 0 7488

7351 0.000 2.724 0.338 4.165 10 10 7351

7351 0.000 2.724 0.338 4.165 10 10 7351

IPOPT 7488 0.000 16.000 0.209 34.500 10 0 7488

7351 0.000 3.418 0.561 6.833 10 10 7351

7351 0.000 3.418 0.561 6.833 10 10 7351

OPFp

IPOPT 7776 0.027 8.300 0.091 13.100 10 2 7488

8023 0.180 4.647 0.881 14.290 10 10 7351

8023 0.180 4.647 0.881 14.290 10 10 7351

CONOPT 7731 0.010 8.700 0.227 18.300 10 5 7488

7718 0.053 5.070 0.517 9.735 10 10 7068

7718 0.053 5.070 0.517 9.735 10 10 7351

OPFlin NUMLP MAXLPS

CPLEX 7528 0.012 9.900 0.338 0.400 100 10

7528 0.012 10.000 0.328 0.500 100 10

7068 0.000 1.190 0.044 1.288 100 10

7068 0.000 1.190 0.044 1.288 100 10

GUROBI   7615 0.042 16.200 0.161 0.500 100 10

7615 0.042 16.400 0.146 0.500 100 10

7615 0.042 16.600 0.163 0.400 100 10

7615 0.042 16.600 0.148 0.400 100 10

7066 0.000 1.593 0.074 1.802 100 10

7068 0.000 1.593 0.074 1.802 100 10

BTHETA

GUROBI   7195 0.000 0.300 0.011 0.300 10 0

7195 0.000 0.300 0.012 0.300 10 0

7195 0.000 0.300 0.009 0.300 10 0

7195 0.000 0.300 0.034 0.400 10 0

7066 0.000 0.174 0.020 0.181 10 0

7066 0.000 0.174 0.020 0.181 10 0

CPLEX 7195 0.000 0.300 0.027 0.400 10 0

7195 0.000 0.300 0.022 0.400 10 0

7066 0.000 0.218 0.144 0.305 10 0

7066 0.000 0.218 0.144 0.305 10 0