ams.routines.pypower.DCOPF1#

class ams.routines.pypower.DCOPF1(system, config, **kwargs)[source]#

DC optimal power flow using PYPOWER.

This routine provides a wrapper for running DC optimal power flow analysis using the PYPOWER. It leverages PYPOWER's internal DC 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 DC optimal power flow formulation.

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

  • Algorithms 400, 500, 600, and 700 are not fully supported yet.

Added in version 1.0.10.

__init__(system, config, **kwargs)[source]#

Initialize the routine.

Parameters:
systemOptional[Type]

The system object associated with the routine.

configOptional[dict]

Configuration dictionary for the routine.

Methods

addConstrs(name, e_str[, info])

Add a Constraint to the routine at runtime.

addRParam(name[, tex_name, info, src, unit, ...])

Add RParam to the routine.

addService(name, value[, tex_name, unit, ...])

Add ValueService to the routine.

addVars(name[, model, shape, tex_name, ...])

Add a variable to the routine.

dc2ac([kloss])

Convert the DC-based results with ACOPF.

disable(name)

Disable a constraint by name.

doc([max_width, export])

Retrieve routine documentation as a string.

enable(name)

Enable a constraint by name.

export_csv([path])

Export scheduling results to a csv file.

export_json([path])

Export scheduling results to a json file.

formulation_summary([return_rows])

Print (or return) a per-item table of the live formulation source.

get(src, idx[, attr, horizon])

Get the value of a variable or parameter.

init(**kwargs)

Initialize the routine.

load_json(path)

Load scheduling results from a json file.

run(**kwargs)

Run the DCOPF routine using PYPOWER.

set(src, idx[, attr, value])

Set the value of an attribute of a routine parameter.

solve(**kwargs)

Solve by PYPOWER.

summary(**kwargs)

Summary interface

unpack(res, **kwargs)

Unpack results from PYPOWER.

update([params, build_mats])

Update the values of Parameters in the optimization model.

Attributes