evo-dcopf-solver
Solves DC-OPF with spinning reserve co-optimization using PuLP/CBC. Extracts LMPs from dual variables, reserve MCP, binding lines.
SKILL.mdtasks-evolved/energy-market-pricing/environment/skills/evo-dcopf-solver/SKILL.md
GitHubevo-dcopf-solver
Solves DC-OPF with reserve co-optimization using PTDF formulation and PuLP.
Key Functions
solve_dcopf_with_reserves(nb, ng, nl, gen_info, branches, costs, load_p, matrices, reserve_capacity, reserve_requirement, Cg)- Main solverextract_lmps(result, int2ext)- Returns list of {bus, lmp_dollars_per_MWh}extract_reserve_mcp(result)- Returns reserve MCP floatidentify_binding_lines(result, branches, int2ext, threshold=0.99)- Returns binding line dictscompute_total_cost(result)- Returns total cost float
Usage
import sys
sys.path.insert(0, '/app/environment/skills/evo-dcopf-solver/scripts')
from utils import (solve_dcopf_with_reserves, extract_lmps, extract_reserve_mcp,
identify_binding_lines, compute_total_cost)
result = solve_dcopf_with_reserves(nb, ng, nl, gen_info, branches, costs,
load_p, matrices, reserve_capacity,
reserve_requirement, Cg)
lmps = extract_lmps(result, int2ext)
reserve_mcp = extract_reserve_mcp(result)
binding = identify_binding_lines(result, branches, int2ext)
total_cost = compute_total_cost(result)