ACED#

Type for AC-based economic dispatch.

Common Parameters: c2, c1, c0, pmax, pmin, pd, ptdf, rate_a, qd

Common Vars: pg, aBus, vBus, qg

Common Constraints: pb, lub, llb

Available routines: ACOPF, ACOPF1, OPF

ACOPF#

Alias for ACOPF1.

Objective#

Unit

Expression

$

\(min. \sum(c_{2} p_{g}^{2}) + \sum(c_{1} p_{g}) + \sum(u_{g} c_{0})\)

Vars#

Name

Symbol

Description

Unit

Source

Properties

aBus

\(a_{Bus}\)

bus voltage angle

rad

Bus.a

vBus

\(v_{Bus}\)

Bus voltage magnitude

p.u.

Bus.v

pg

\(p_{g}\)

Gen active power

p.u.

StaticGen.p

qg

\(q_{g}\)

Gen reactive power

p.u.

StaticGen.q

plf

\(p_{lf}\)

Line flow

p.u.

Line

pi

\(pi\)

Lagrange multiplier on real power mismatch

$/p.u.

Bus

piq

\(piq\)

Lagrange multiplier on reactive power mismatch

$/p.u.

Bus

mu1

\(mu1\)

Kuhn-Tucker multiplier on MVA limit at bus1

$/p.u.

Line

mu2

\(mu2\)

Kuhn-Tucker multiplier on MVA limit at bus2

$/p.u.

Line

ExpressionCalcs#

Name

Description

Expression

Unit

Source

None

Total cost

\(\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})\)

$

Parameters#

Name

Symbol

Description

Unit

Source

ug

\(u_{g}\)

Gen connection status

StaticGen.u

c2

\(c_{2}\)

Gen cost coefficient 2

$/(p.u.^2)

GCost.c2

c1

\(c_{1}\)

Gen cost coefficient 1

$/(p.u.)

GCost.c1

c0

\(c_{0}\)

Gen cost coefficient 0

$

GCost.c0

pd

\(p_{d}\)

active demand

p.u.

StaticLoad.p0

qd

\(q_{d}\)

reactive demand

p.u.

StaticLoad.q0

Config Fields in [ACOPF]

Option

Symbol

Value

Info

Accepted values

verbose

\(v_{erbose}\)

1

0: no progress info, 1: little, 2: lots, 3: all

(0, 1, 2, 3)

out_all

\(o_{ut\_all}\)

0

-1: individual flags control what prints, 0: none, 1: all

(-1, 0, 1)

out_sys_sum

\(o_{ut\_sys\_sum}\)

1

print system summary

(0, 1)

out_area_sum

\(o_{ut\_area\_sum}\)

0

print area summaries

(0, 1)

out_bus

\(o_{ut\_bus}\)

1

print bus detail

(0, 1)

out_branch

\(o_{ut\_branch}\)

1

print branch detail

(0, 1)

out_gen

\(o_{ut\_gen}\)

0

print generator detail (OUT_BUS also includes gen info)

(0, 1)

out_all_lim

\(o_{ut\_all\_lim}\)

-1

-1: individual flags, 0: none, 1: binding, 2: all

(-1, 0, 1, 2)

out_v_lim

\(o_{ut\_v\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_line_lim

\(o_{ut\_line\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_pg_lim

\(o_{ut\_pg\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_qg_lim

\(o_{ut\_qg\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

opf_alg_dc

\(o_{pf\_alg\_dc}\)

200

0: choose default solver based on availability, 200: PIPS, 250: PIPS-sc, 400: IPOPT, 500: CPLEX, 600: MOSEK, 700: GUROBI

(0, 200, 250, 400, 500, 600, 700)

opf_violation

\(o_{pf\_violation}\)

0.000

constraint violation tolerance

>=0

opf_flow_lim

\(o_{pf\_flow\_lim}\)

0

qty to limit for branch flow constraints: 0 - apparent power flow (limit in MVA), 1 - active power flow (limit in MW), 2 - current magnitude (limit in MVA at 1 p.u. voltage)

(0, 1, 2)

opf_ignore_ang_lim

\(o_{pf\_ignore\_ang\_lim}\)

0

ignore angle difference limits for branches even if specified

(0, 1)

grb_method

\(o_{grb\_method}\)

1

0 - primal simplex, 1 - dual simplex, 2 - barrier, 3 - concurrent (LP only), 4 - deterministic concurrent (LP only)

(0, 1, 2, 3, 4)

grb_timelimit

\(o_{grb\_timelimit}\)

inf

maximum time allowed for solver (TimeLimit)

(0, inf)

grb_threads

\(o_{grb\_threads}\)

0

(auto) maximum number of threads to use (Threads)

(0, 1)

grb_opt

\(o_{grb\_opt}\)

0

See gurobi_options() for details

(0, 1)

pdipm_feastol

\(o_{pdipm\_feastol}\)

0

feasibility (equality) tolerance for Primal-Dual Interior Points Methods, set to value of OPF_VIOLATION by default

>=0

pdipm_gradtol

\(o_{pdipm\_gradtol}\)

0.000

gradient tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_comptol

\(o_{pdipm\_comptol}\)

0.000

complementary condition (inequality) tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_costtol

\(o_{pdipm\_costtol}\)

0.000

optimality tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_max_it

\(o_{pdipm\_max\_it}\)

150

maximum iterations for Primal-Dual Interior Points Methods

>=0

scpdipm_red_it

\(o_{scpdipm\_red\_it}\)

20

maximum reductions per iteration for Step-Control Primal-Dual Interior Points Methods

>=0

opf_alg

\(o_{pf\_alg}\)

0

algorithm to use for OPF: 0 - default, 580 - PIPS

(0, 580)

ACOPF1#

AC optimal power flow using PYPOWER.

This routine provides a wrapper for running AC optimal power flow analysis using the PYPOWER. It leverages PYPOWER's internal AC optimal power flow solver and maps results back to the AMS system.

In PYPOWER, the c0 term (the constant coefficient in the generator cost function) is always included in the objective, regardless of the generator's commitment status. See pypower/opf_costfcn.py for implementation details.

Notes#

  • This class does not implement the AMS-style AC optimal power flow formulation.

  • For detailed mathematical formulations and algorithmic details, refer to the MATPOWER User's Manual, section on Optimal Power Flow.

Added in version 1.0.10.

Objective#

Unit

Expression

$

\(min. \sum(c_{2} p_{g}^{2}) + \sum(c_{1} p_{g}) + \sum(u_{g} c_{0})\)

Vars#

Name

Symbol

Description

Unit

Source

Properties

aBus

\(a_{Bus}\)

bus voltage angle

rad

Bus.a

vBus

\(v_{Bus}\)

Bus voltage magnitude

p.u.

Bus.v

pg

\(p_{g}\)

Gen active power

p.u.

StaticGen.p

qg

\(q_{g}\)

Gen reactive power

p.u.

StaticGen.q

plf

\(p_{lf}\)

Line flow

p.u.

Line

pi

\(pi\)

Lagrange multiplier on real power mismatch

$/p.u.

Bus

piq

\(piq\)

Lagrange multiplier on reactive power mismatch

$/p.u.

Bus

mu1

\(mu1\)

Kuhn-Tucker multiplier on MVA limit at bus1

$/p.u.

Line

mu2

\(mu2\)

Kuhn-Tucker multiplier on MVA limit at bus2

$/p.u.

Line

ExpressionCalcs#

Name

Description

Expression

Unit

Source

None

Total cost

\(\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})\)

$

Parameters#

Name

Symbol

Description

Unit

Source

ug

\(u_{g}\)

Gen connection status

StaticGen.u

c2

\(c_{2}\)

Gen cost coefficient 2

$/(p.u.^2)

GCost.c2

c1

\(c_{1}\)

Gen cost coefficient 1

$/(p.u.)

GCost.c1

c0

\(c_{0}\)

Gen cost coefficient 0

$

GCost.c0

pd

\(p_{d}\)

active demand

p.u.

StaticLoad.p0

qd

\(q_{d}\)

reactive demand

p.u.

StaticLoad.q0

Config Fields in [ACOPF1]

Option

Symbol

Value

Info

Accepted values

verbose

\(v_{erbose}\)

1

0: no progress info, 1: little, 2: lots, 3: all

(0, 1, 2, 3)

out_all

\(o_{ut\_all}\)

0

-1: individual flags control what prints, 0: none, 1: all

(-1, 0, 1)

out_sys_sum

\(o_{ut\_sys\_sum}\)

1

print system summary

(0, 1)

out_area_sum

\(o_{ut\_area\_sum}\)

0

print area summaries

(0, 1)

out_bus

\(o_{ut\_bus}\)

1

print bus detail

(0, 1)

out_branch

\(o_{ut\_branch}\)

1

print branch detail

(0, 1)

out_gen

\(o_{ut\_gen}\)

0

print generator detail (OUT_BUS also includes gen info)

(0, 1)

out_all_lim

\(o_{ut\_all\_lim}\)

-1

-1: individual flags, 0: none, 1: binding, 2: all

(-1, 0, 1, 2)

out_v_lim

\(o_{ut\_v\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_line_lim

\(o_{ut\_line\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_pg_lim

\(o_{ut\_pg\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

out_qg_lim

\(o_{ut\_qg\_lim}\)

1

0: don't print, 1: binding constraints only, 2: all constraints

(0, 1, 2)

opf_alg_dc

\(o_{pf\_alg\_dc}\)

200

0: choose default solver based on availability, 200: PIPS, 250: PIPS-sc, 400: IPOPT, 500: CPLEX, 600: MOSEK, 700: GUROBI

(0, 200, 250, 400, 500, 600, 700)

opf_violation

\(o_{pf\_violation}\)

0.000

constraint violation tolerance

>=0

opf_flow_lim

\(o_{pf\_flow\_lim}\)

0

qty to limit for branch flow constraints: 0 - apparent power flow (limit in MVA), 1 - active power flow (limit in MW), 2 - current magnitude (limit in MVA at 1 p.u. voltage)

(0, 1, 2)

opf_ignore_ang_lim

\(o_{pf\_ignore\_ang\_lim}\)

0

ignore angle difference limits for branches even if specified

(0, 1)

grb_method

\(o_{grb\_method}\)

1

0 - primal simplex, 1 - dual simplex, 2 - barrier, 3 - concurrent (LP only), 4 - deterministic concurrent (LP only)

(0, 1, 2, 3, 4)

grb_timelimit

\(o_{grb\_timelimit}\)

inf

maximum time allowed for solver (TimeLimit)

(0, inf)

grb_threads

\(o_{grb\_threads}\)

0

(auto) maximum number of threads to use (Threads)

(0, 1)

grb_opt

\(o_{grb\_opt}\)

0

See gurobi_options() for details

(0, 1)

pdipm_feastol

\(o_{pdipm\_feastol}\)

0

feasibility (equality) tolerance for Primal-Dual Interior Points Methods, set to value of OPF_VIOLATION by default

>=0

pdipm_gradtol

\(o_{pdipm\_gradtol}\)

0.000

gradient tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_comptol

\(o_{pdipm\_comptol}\)

0.000

complementary condition (inequality) tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_costtol

\(o_{pdipm\_costtol}\)

0.000

optimality tolerance for Primal-Dual Interior Points Methods

>=0

pdipm_max_it

\(o_{pdipm\_max\_it}\)

150

maximum iterations for Primal-Dual Interior Points Methods

>=0

scpdipm_red_it

\(o_{scpdipm\_red\_it}\)

20

maximum reductions per iteration for Step-Control Primal-Dual Interior Points Methods

>=0

opf_alg

\(o_{pf\_alg}\)

0

algorithm to use for OPF: 0 - default, 580 - PIPS

(0, 580)

OPF#

Optimal Power Flow (OPF) routine using gurobi-optimods.

This class provides an interface for performing optimal power flow analysis with gurobi-optimods, supporting both AC and DC OPF formulations.

In addition to optimizing generator dispatch, this routine can also optimize transmission line statuses (branch switching), enabling topology optimization. Refer to the gurobi-optimods documentation for further details:

https://gurobi-optimods.readthedocs.io/en/stable/mods/opf/opf.html

Added in version 1.0.10.

Objective#

Unit

Expression

$

\(min. \sum(c_{2} p_{g}^{2}) + \sum(c_{1} p_{g}) + \sum(u_{g} c_{0})\)

Vars#

Name

Symbol

Description

Unit

Source

Properties

aBus

\(a_{Bus}\)

bus voltage angle

rad

Bus.a

vBus

\(v_{Bus}\)

Bus voltage magnitude

p.u.

Bus.v

pg

\(p_{g}\)

Gen active power

p.u.

StaticGen.p

qg

\(q_{g}\)

Gen reactive power

p.u.

StaticGen.q

plf

\(p_{lf}\)

Line flow

p.u.

Line

pi

\(pi\)

Lagrange multiplier on real power mismatch

$/p.u.

Bus

uld

\(u_{l,d}\)

Line commitment decision

Line.u

ExpressionCalcs#

Name

Description

Expression

Unit

Source

None

Total cost

\(\sum(c_{2} p_{g}^{2})+ \sum(c_{1} p_{g})+ \sum(u_{g} c_{0})\)

$

Parameters#

Name

Symbol

Description

Unit

Source

ug

\(u_{g}\)

Gen connection status

StaticGen.u

c2

\(c_{2}\)

Gen cost coefficient 2

$/(p.u.^2)

GCost.c2

c1

\(c_{1}\)

Gen cost coefficient 1

$/(p.u.)

GCost.c1

c0

\(c_{0}\)

Gen cost coefficient 0

$

GCost.c0

pd

\(p_{d}\)

active demand

p.u.

StaticLoad.p0

qd

\(q_{d}\)

reactive demand

p.u.

StaticLoad.q0