Skip to content

Pypower model direct from PSS/E RAW model and support data files#82

Closed
dchassin wants to merge 172 commits into
mainfrom
pypower-model
Closed

Pypower model direct from PSS/E RAW model and support data files#82
dchassin wants to merge 172 commits into
mainfrom
pypower-model

Conversation

@dchassin
Copy link
Copy Markdown
Collaborator

@dchassin dchassin commented Nov 15, 2025

The purpose of this PR is to create a pypower case of the WECC 240 directly from the PSS/E RAW file and verify that it solves correctly with the schedule, fossil, load, and renewable data updates.

Quick Start

Run marimo edit . in the pypower folder, e.g.,

python3 -m venv .venv
. .venv/bin/activate
pip import --upgrade pip -r requirements.txt
marimo edit .

The review.py notebook runs the model with various options and review features.

PR Overview

This is accomplished by creating the following modules:

  1. psse.py read data from the WECC240 PSSE RAW file into data frames
  2. psse2pp.py converts the PSSE data into PyPOWER model
  3. schedule.py updates a PyPOWER model with the NREL WECC240 scheduling data
  4. hifld.py updates a PyPOWER model with the HIFLD generation fleet data (TODO: replace with eia860m.py)
  5. loads.py updates a PyPOWER model with the NREL load data
  6. renewables.py updates a PyPOWER model with the NREL renewables data

The number of support folders are provided:

  1. wecc240 provides manually extracted CSV files of the PSSE RAW file and scheduling data
  2. tests provides miscellaneous testing data that not part of the code itself and used for development purposes.

The following folders are created during normal usage of the model:

  1. summaries contains summary CSV files
  2. plots contains PNG plots
  3. kml contains KML output

The following folders are creating during testing

  1. results contains the output of the tests.py script including CSV, PNG, KML, and Python files containing copies PyPOWER cases.

How To

To load the original WECC240 PyPOWER model and run a simulation, do the following:

from ppmodel import PPModel
from wecc240 import wecc240
model = PPModel(case=wecc240)
model.set_input("bus","PD","tests/load.csv",scale=10)
model.set_input("bus","QD","tests/load.csv",scale=1)
model.set_output("bus","VM","results/bus_vm.csv",format=".3f")
model.set_output("bus","VA","results/bus_va.csv",format=".4f")
result =  model.run_timeseries(
    "2020-08-01 00:00:00+07:00",
    "2020-08-02 00:00:00+07:00",
    freq="1h",
    )

Tasks

PSS/E segment readers

  • Area
  • Branch
  • Bus
  • Dcline
  • Gen
  • Load
  • Shunt
  • Xform
  • Zone

PyPower model constructors

  • Bus
  • Branch
  • Gen
  • Gencost
  • Dcline
  • Dclinecost

PSS/E to PyPower converters

  • Bus from PSS/E bus, load, and shunt segments
  • Branch from PSS/E branch and xform segments
  • Gen from PSS/E gen segment
  • Gencost from PSS/E gen segment and cost data
  • Dcline from dcline data
  • Dclinecost from dcline and cost data
  • Replace DC line pseudo loads with DC lines data

Original case modification options

  • Import generation costs from scheduling data
  • Line flow limits from scheduling data
  • Storage constraints from scheduling data
  • Import HIFLD generation fleet data
  • Import EIA860 generation fleet data
  • Import load model data
  • Import renewable fleet model data

International generator handling

  • Canadian import/export tieline flow schedules
  • Exclude Canadian busses from generation node mapping

Powerflow solutions

  • Original model
  • Scheduling model
  • HIFLD model
  • EIA860m model
  • Load model
  • Renewables model

DC OPF solutions

  • Original model
  • Scheduling model
  • HIFLD model
  • EIA860 model
  • Load model
  • Renewables model

AC OPF solutions

  • Original model
  • Scheduling model
  • HIFLD model
  • EIA860 model
  • Load model
  • Renewables model

Time-series solution

  • Run over time range
  • Set input streams
  • Set output streams
  • Set I/O mapping between data rows and file columns (geodata -> case)
  • Timeseries performance profile

Check plots

  • PSS/E values vs original powerflow solution
  • PSS/E values vs original DC OPF solution
  • PSS/E values vs original AC OPF solution

KML outputs

  • Original model
  • Scheduling model
  • HIFLD model
  • EIA860 model
  • Load model
  • Renewables model

Github actions

  • Analyse code with pylint
  • Run tests
  • Download test results

Summaries

  • Node generation count
  • Bus catalog
  • No-generation busses

Documentation

  • Write README.md

@dchassin dchassin self-assigned this Nov 15, 2025
@bmeyers
Copy link
Copy Markdown
Contributor

bmeyers commented Jan 8, 2026

initial work on pypower, superseded by separate package.

@bmeyers bmeyers closed this Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants