This project implements a bilevel optimization model for strategic storage bidding in electricity markets. The upper level optimizes storage bidding decisions, while the lower level solves the economic dispatch problem that clears the market.
- Bilevel Optimization: Implements both convex and non-convex bilevel formulations for storage bidding
- Economic Dispatch: Solves lower-level market clearing with variable renewable energy (VRE) integration
- Storage Modeling: Supports configurable storage capacity, duration, and efficiency parameters
- Scalable Scenarios: Supports different VRE penetration levels, storage capacities, and other sensitivity factors
- Batch Processing: Includes scripts for running multiple scenarios on HPC clusters
- Julia (version 1.6 or later recommended)
- Gurobi Optimizer (academic license available)
- Required Julia packages: JuMP, Gurobi, BilevelJuMP, DataFrames, CSV, Plots, VegaLite
-
Clone the repository:
git clone https://github.com/Power-Lab/EnergyEcon_Storage_2026.git cd EnergyEcon_Storage_2026 -
Install Julia dependencies:
using Pkg Pkg.add(["JuMP", "Gurobi", "BilevelJuMP", "DataFrames", "CSV", "Plots", "VegaLite", "Statistics", "PrettyTables", "FileIO"])
-
Set up Gurobi license (follow Gurobi installation instructions)
Run a simple simulation:
julia code/run.jl
This will execute a bilevel optimization for a 4-day period with default parameters (20 GW storage capacity, 4-hour duration, wind scale 3x, solar scale 3x).
For running multiple periods, use the batch scripts:
# Run on HPC
cd batch
sbatch b20_hrs4_w3_s3_days4_ptc10.sh
# Or run directly on a local PC
julia code/run_all_tscc.jl b20_hrs4_w3_s3_days4_ptc10The run name format is: b{storage_gw}_hrs{duration}_w{wind_scale}_s{solar_scale}_days{simulation_days}_ptc{production_incentive}
Modify key parameters in code/run_all_tscc.jl for HPC runs or code/run_all_pc.jl for local runs:
storage_cap_gw: Storage capacity in GWstorage_duration: Storage duration in hoursone_way_efficiency: Storage one-way efficiencywind_cap_scale: Wind capacity multipliersolar_cap_scale: Solar capacity multiplierramping_charge_scenario: Ramping charge cost scenarioramping_charge: Storage ramping charge costbidding_ptc: Renewable production tax incentive in $/MW
├── code/ # Julia source code
│ ├── bilevel_cvx.jl # Convex bilevel formulation
│ ├── ed.jl # Economic dispatch model
│ └── run.jl # Single period run
│ └── run_all_tscc.jl # HPC run for multiple periods
│ └── run_all_pc.jl # Local run for multiple periods
├── data/ # Input datasets
│ ├── data_WECC_small_mod/ # WECC system data
│ ├── data_WECC_large/ # WECC system data (more detailed)
├── batch/ # SLURM batch scripts
├── figure/ # Output figures
├── result/ # Output results
└── LICENSE # MIT License
The project uses WECC (Western Electricity Coordinating Council) system data and synthetic datasets for testing. Data includes:
- Generator parameters and costs
- Load profiles
- Variable renewable energy capacity factors
- Fuel prices
This project is licensed under the MIT License - see the LICENSE file for details.
Zhenhua Zhang
Email: zhenhua@ucsd.edu
Affiliation: University of California, San Diego