EGRET: Electrical Grid Research and Engineering Tools

repository·main·Indexed 41 days ago

https://github.com/grid-parity-exchange/egret

A Python-based optimization framework for electrical grid modeling built on Pyomo. EGRET supports solving Unit Commitment and Economic Dispatch problems, including DCOPF and ACOPF, and provides a library of problem formulations and approximations for high-level analysis and research.

Tokens
625
Snippets
3
Records
4
Agent score
1%

What's inside EGRET

  1. EGRET Overview

    main

    EGRET is a Python-based package for electrical grid optimization built on the Pyomo optimization modeling language. It is designed for both high-level analysis (serving as an engine for various optimization formulations) and rapid research into new formulations.

    Key Capabilities:

    • Unit-Commitment: Solving unit-commitment problems.
    • Economic Dispatch: Solving optimal power flow problems, including DCOPF (Direct Current Optimal Power Flow) and ACOPF (Alternating Current Optimal Power Flow).
    • Formulation Library: Access to various problem formulations and approximations.
    • Data Handling: Generic handling of data across different model formulations.
    • Declarative Modeling: Supports declarative model representation for easier formulation development.
  2. Test the EGRET installation

    main

    To verify that the unit commitment functionality is working correctly, run the following command from the models/tests sub-directory of the EGRET repository:

    Note on Solver Behavior:

    • If a commercial MIP solver (like Gurobi or CPLEX) is found by Pyomo, EGRET will run a full test suite including solving several MIPs to optimality.
    • If only open-source solvers are found, EGRET will run a limited test suite primarily focused on solving LP relaxations.
    pytest test_unit_commitment.py
  3. EGRET System Requirements

    main

    To run EGRET, ensure your environment meets the following specifications:

    Core Dependencies:

    • Python: version 3.7 or later.
    • Pyomo: version 6.4.0 or later.
    • Testing: pytest.

    Optimization Solvers: EGRET requires solvers configured via Pyomo. Requirements vary by model type:

    • MIP-based problems (e.g., Unit Commitment): Tested with Gurobi or CPLEX. It is also recommended to install the open-source CBC solver.
    • NLP problems: Tested with Ipopt (ideally with HSL linear solvers).

    Installing CBC (via Conda): On Linux and Mac platforms using Anaconda, you can install the CBC solver using:

    conda install -c conda-forge coincbc
  4. Install EGRET via pip

    main

    EGRET is installed as a Python package. To install it in editable mode, navigate to the main EGRET directory (the folder containing setup.py) in your terminal or Anaconda prompt and run the following command:

    Prerequisites:

    • A Python installation (Anaconda is recommended).
    • Pyomo installed.
    • Relevant optimization solvers installed (see Requirements).
    pip install -e .