├── .gitattributes ├── .gitignore ├── Homeworks ├── HW6 │ ├── Austin_Prices.csv │ ├── ERCOT-Maps_Load-Zone.jpg │ ├── MAE 573 - Homework 6.pdf │ └── Simulator_HW6.ipynb ├── Homework-01.ipynb ├── Homework-02.ipynb ├── Homework-03.ipynb ├── Homework-04.ipynb ├── Homework-05.ipynb └── hw3_data │ ├── Demand.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ └── Generators_variability.csv ├── LICENSE-MIT ├── LICENSE.md ├── Notebooks ├── 00-Getting-Started-w-DataFrames.ipynb ├── 01-Constrained-Optimization.ipynb ├── 02-Anatomy-of-a-Model.ipynb ├── 03-Basic-Capacity-Expansion.ipynb ├── 04-Economic-Dispatch.ipynb ├── 05-Unit-Commitment.ipynb ├── 06-Optimal-Power-Flow.ipynb ├── 07-Complex-Capacity-Expansion.ipynb ├── Benders-Complex-Capacity-Expansion.ipynb ├── Benders-Decomposition.ipynb ├── anatomy_data │ └── solar_battery_data.csv ├── benders_cems.jl ├── complex_expansion_data │ ├── 10_days │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 16_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 4_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 52_weeks │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ └── 8_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv ├── ed_data │ ├── Demand.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ └── Generators_variability.csv ├── expansion_data │ ├── demand_for_expansion.csv │ ├── generators_for_expansion.csv │ └── wind_solar_for_expansion.csv ├── extra_labs │ ├── Lab 1.pdf │ ├── Lab1.jl │ ├── Lab1_code.jl │ ├── Lab2.ipynb │ ├── Lab2 │ │ └── weather_SAN_2020.csv │ └── Lab2_data │ │ ├── Demand.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ └── Generators_variability.csv ├── ieee_test_cases │ ├── Gen14.csv │ ├── IEEE14BusTestSystem.png │ ├── Load14.csv │ ├── Tran14.csv │ └── Tran14_b.csv ├── img │ ├── brownfield.png │ ├── dimensionality.png │ ├── factory.png │ ├── jump_logo.png │ ├── net_demand.png │ ├── opf_network.png │ ├── phase_shift.png │ ├── renewables.png │ ├── reserves.png │ ├── reserves_taxonomy.png │ ├── solar.png │ └── thermal.png ├── opf_data │ ├── branch.csv │ ├── bus.csv │ ├── gen.csv │ └── gencost.csv └── uc_data │ ├── Demand.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ └── Generators_variability.csv ├── Project.toml ├── Project ├── WECC_6zone_2035 │ ├── Flexible_demand_data.csv │ ├── Flexible_load_availability.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ ├── Generators_variability.csv │ ├── Load_data.csv │ ├── Network.csv │ ├── Period_map.csv │ ├── Representative_Period.csv │ ├── Reserves.csv │ └── Zones.csv ├── WECC_6zone_2050 │ ├── Flexible_demand_data.csv │ ├── Flexible_load_availability.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ ├── Generators_variability.csv │ ├── Load_data.csv │ ├── Network.csv │ ├── Period_map.csv │ ├── Representative_Period.csv │ ├── Reserves.csv │ └── Zones.csv ├── ercot_500kV │ ├── branch.csv │ ├── bus.csv │ ├── bus2sub.csv │ ├── busagg2id.csv │ ├── gencost.csv │ ├── load.csv │ ├── plant.csv │ ├── readme.md │ ├── sub.csv │ ├── var_prof │ │ ├── solar_zone301.csv │ │ ├── solar_zone304.csv │ │ ├── solar_zone306.csv │ │ ├── solar_zone307.csv │ │ ├── solar_zone308.csv │ │ ├── wind_zone301.csv │ │ ├── wind_zone302.csv │ │ ├── wind_zone303.csv │ │ ├── wind_zone304.csv │ │ └── wind_zone305.csv │ └── zone.csv ├── ercot_brownfield_expansion │ ├── 10_days │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 16_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 4_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 52_weeks │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── 8_weeks │ │ ├── Cluster_order.csv │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── ercot_3_zone_map.png │ └── readme.md ├── readme.md ├── wecc_2020_unit_commitment │ ├── Input_descrptions_WECC_UC.xlsx │ ├── WECC_large │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── WECC_medium │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ ├── WECC_small │ │ ├── Fuels_data.csv │ │ ├── Generators_data.csv │ │ ├── Generators_variability.csv │ │ ├── Load_data.csv │ │ └── Network.csv │ └── readme.md └── wecc_2045_all_clean_expansion │ ├── Input_descriptions_WECC_expansion.xlsx │ ├── high_electrification_16_weeks │ ├── Cluster_order.csv │ ├── Flexible_demand_data.csv │ ├── Flexible_load_availability.csv │ ├── Flexible_load_data.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ ├── Generators_variability.csv │ ├── Load_data.csv │ ├── Network.csv │ └── Zones.csv │ ├── readme.md │ ├── reference_electrification_16_weeks │ ├── Cluster_order.csv │ ├── Flexible_load_availability.csv │ ├── Flexible_load_data.csv │ ├── Fuels_data.csv │ ├── Generators_data.csv │ ├── Generators_variability.csv │ ├── Load_data.csv │ ├── Network.csv │ └── Zones.csv │ └── wecc_6_zone_map.png ├── README.md └── Tutorials ├── Debugging with VS Code.md ├── example8.csv.gz ├── exercise_debugging.jl ├── julia_tutorial.ipynb └── jump_infeasibilities.ipynb /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Files generated by invoking Julia with --code-coverage 2 | *.jl.cov 3 | *.jl.*.cov 4 | 5 | # Files generated by invoking Julia with --track-allocation 6 | *.jl.mem 7 | 8 | # System-specific files and directories generated by the BinaryProvider and BinDeps packages 9 | # They contain absolute paths specific to the host computer, and so should not be committed 10 | deps/deps.jl 11 | deps/build.log 12 | deps/downloads/ 13 | deps/usr/ 14 | deps/src/ 15 | 16 | # Build artifacts for creating documentation generated by the Documenter package 17 | docs/build/ 18 | docs/site/ 19 | 20 | # File generated by Pkg, the package manager, based on a corresponding Project.toml 21 | # It records a fixed state of all packages used by the project. As such, it should not be 22 | # committed for packages, but should be committed for applications that require a static 23 | # environment. 24 | Manifest.toml 25 | 26 | .DS_Store 27 | 28 | .ipynb_checkpoints 29 | */.ipynb_checkpoints/* 30 | 31 | ~$* 32 | 33 | Notebooks/results/* 34 | 35 | -------------------------------------------------------------------------------- /Homeworks/HW6/ERCOT-Maps_Load-Zone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Homeworks/HW6/ERCOT-Maps_Load-Zone.jpg -------------------------------------------------------------------------------- /Homeworks/HW6/MAE 573 - Homework 6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Homeworks/HW6/MAE 573 - Homework 6.pdf -------------------------------------------------------------------------------- /Homeworks/Homework-01.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Homework 1" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "_**[Power Systems Optimization](https://github.com/east-winds/power-systems-optimization)**_\n", 15 | "\n", 16 | "_by Jesse D. Jenkins and Michael R. Davidson (last updated: September 14, 2022)_\n", 17 | "\n", 18 | "This Notebook will walk you through defining a simple transport flow model and then ask you to interact with the solutions and modify to model to add additional constraints..." 19 | ] 20 | }, 21 | { 22 | "cell_type": "markdown", 23 | "metadata": {}, 24 | "source": [ 25 | "## Setting up the model" 26 | ] 27 | }, 28 | { 29 | "cell_type": "markdown", 30 | "metadata": {}, 31 | "source": [ 32 | "### Load packages" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": null, 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "using JuMP\n", 42 | "using HiGHS\n", 43 | "using DataFrames\n", 44 | "using CSV" 45 | ] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": {}, 50 | "source": [ 51 | "### Define sets" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": {}, 57 | "source": [ 58 | "We will define two sets, both as arrays of strings" 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "metadata": {}, 64 | "source": [ 65 | "***Production plants, $P$***" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [ 74 | "P=[\"trenton\", \"newark\"] # production plants" 75 | ] 76 | }, 77 | { 78 | "cell_type": "markdown", 79 | "metadata": {}, 80 | "source": [ 81 | "***Markets for products, $M$***" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": null, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "M=[\"newyork\", \"princeton\", \"philadelphia\"] # markets for products" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "Note that sets can also be defined over intervals (as in `i=1:10`) or numerical vectors (as in `x=[2, 4, 5, 11]`) " 98 | ] 99 | }, 100 | { 101 | "cell_type": "markdown", 102 | "metadata": {}, 103 | "source": [ 104 | "### Define parameters" 105 | ] 106 | }, 107 | { 108 | "cell_type": "markdown", 109 | "metadata": {}, 110 | "source": [ 111 | "We'll make use of the defined sets as indexes for our parameters...\n", 112 | "\n", 113 | "***Plant production capacities***" 114 | ] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "metadata": {}, 120 | "outputs": [], 121 | "source": [ 122 | "plants = DataFrame(plant=P, capacity=[350,650])" 123 | ] 124 | }, 125 | { 126 | "cell_type": "markdown", 127 | "metadata": {}, 128 | "source": [ 129 | "***Demand for products***\n", 130 | "\n", 131 | "Stored in a [DataFrame](https://juliadata.github.io/DataFrames.jl/stable/)" 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": null, 137 | "metadata": {}, 138 | "outputs": [], 139 | "source": [ 140 | "markets = DataFrame(\n", 141 | " market=M, \n", 142 | " demand=[325, 300, 275]\n", 143 | ")" 144 | ] 145 | }, 146 | { 147 | "cell_type": "markdown", 148 | "metadata": {}, 149 | "source": [ 150 | "A few different ways to index into our DataFrames to access parameters (all of the below are equivalent)" 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": null, 156 | "metadata": {}, 157 | "outputs": [], 158 | "source": [ 159 | "plants[plants.plant.==\"newark\",:capacity] # option 1" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": {}, 166 | "outputs": [], 167 | "source": [ 168 | "plants[plants.plant.==\"newark\",:].capacity # option 2" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "execution_count": null, 174 | "metadata": {}, 175 | "outputs": [], 176 | "source": [ 177 | "plants.capacity[plants.plant.==\"newark\"] # option 3" 178 | ] 179 | }, 180 | { 181 | "cell_type": "code", 182 | "execution_count": null, 183 | "metadata": {}, 184 | "outputs": [], 185 | "source": [ 186 | "plants[:,:capacity][plants.plant.==\"newark\"] # option 4" 187 | ] 188 | }, 189 | { 190 | "cell_type": "markdown", 191 | "metadata": {}, 192 | "source": [ 193 | "Note that DataFrame indexing returns an Array by default, in this case, a 1-element Array of type Int64 (64-bit integer), as indicated by `Array{Int64,1}` above. \n", 194 | "\n", 195 | "To access the single Int64 value, append `[1]` to any of the above to reference the first (and only) element in this array. " 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "execution_count": null, 201 | "metadata": {}, 202 | "outputs": [], 203 | "source": [ 204 | "plants.capacity[plants.plant.==\"newark\"][1]" 205 | ] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "execution_count": null, 210 | "metadata": {}, 211 | "outputs": [], 212 | "source": [ 213 | "typeof(plants.capacity[plants.plant.==\"newark\"][1])" 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": null, 219 | "metadata": {}, 220 | "outputs": [], 221 | "source": [ 222 | "typeof(plants.capacity[plants.plant.==\"newark\"])" 223 | ] 224 | }, 225 | { 226 | "cell_type": "markdown", 227 | "metadata": {}, 228 | "source": [ 229 | "***Distance from plants to markets***\n", 230 | "\n", 231 | "Stored in a JuMP [DenseAxisArray](https://jump.dev/JuMP.jl/v0.19/containers/) with data array and symbolic references across each of our sets (plants and markets), converted to Symbols for referencing" 232 | ] 233 | }, 234 | { 235 | "cell_type": "code", 236 | "execution_count": null, 237 | "metadata": {}, 238 | "outputs": [], 239 | "source": [ 240 | "# two dimensional symbolic DenseAxisArray, with from/to distance pairs\n", 241 | "distances = JuMP.Containers.DenseAxisArray(\n", 242 | " [2.5 0.5 1.5;\n", 243 | " 0.5 1.5 3.5],\n", 244 | " Symbol.(P),\n", 245 | " Symbol.(M),\n", 246 | ")" 247 | ] 248 | }, 249 | { 250 | "cell_type": "markdown", 251 | "metadata": {}, 252 | "source": [ 253 | "A couple example references to our DenseAxisArray to access parameters..." 254 | ] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "execution_count": null, 259 | "metadata": {}, 260 | "outputs": [], 261 | "source": [ 262 | "distances[:trenton, :newyork] #example of distance references" 263 | ] 264 | }, 265 | { 266 | "cell_type": "code", 267 | "execution_count": null, 268 | "metadata": {}, 269 | "outputs": [], 270 | "source": [ 271 | "distances[:newark, :newyork] #example of distance references" 272 | ] 273 | }, 274 | { 275 | "cell_type": "code", 276 | "execution_count": null, 277 | "metadata": {}, 278 | "outputs": [], 279 | "source": [ 280 | "distances[Symbol(P[2]),Symbol(M[1])] # another way to find distance from newark to trenton" 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": null, 286 | "metadata": {}, 287 | "outputs": [], 288 | "source": [ 289 | "distances[Symbol(\"newark\"), Symbol(\"newyork\")] # and a third..." 290 | ] 291 | }, 292 | { 293 | "cell_type": "markdown", 294 | "metadata": {}, 295 | "source": [ 296 | "***Costs of transport***" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "execution_count": null, 302 | "metadata": {}, 303 | "outputs": [], 304 | "source": [ 305 | "freight_cost = 90 # Cost of freight shipment per unit of distance" 306 | ] 307 | }, 308 | { 309 | "cell_type": "markdown", 310 | "metadata": {}, 311 | "source": [ 312 | "### Create model\n", 313 | "(and specify the HiGHS solver)" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": null, 319 | "metadata": {}, 320 | "outputs": [], 321 | "source": [ 322 | "transport = Model(HiGHS.Optimizer);" 323 | ] 324 | }, 325 | { 326 | "cell_type": "markdown", 327 | "metadata": {}, 328 | "source": [ 329 | "### Define variables" 330 | ] 331 | }, 332 | { 333 | "cell_type": "markdown", 334 | "metadata": {}, 335 | "source": [ 336 | "***Quantities of product to transport from plant $p \\in P$ to market $m \\in M$***" 337 | ] 338 | }, 339 | { 340 | "cell_type": "code", 341 | "execution_count": null, 342 | "metadata": {}, 343 | "outputs": [], 344 | "source": [ 345 | "@variable(transport, X[P,M] >= 0)" 346 | ] 347 | }, 348 | { 349 | "cell_type": "markdown", 350 | "metadata": {}, 351 | "source": [ 352 | "Example reference to single quantity decision variable, the quantity shipped from Newark to Philadelphia:" 353 | ] 354 | }, 355 | { 356 | "cell_type": "code", 357 | "execution_count": null, 358 | "metadata": {}, 359 | "outputs": [], 360 | "source": [ 361 | "X[\"newark\",\"philadelphia\"]" 362 | ] 363 | }, 364 | { 365 | "cell_type": "markdown", 366 | "metadata": {}, 367 | "source": [ 368 | "### Define constraints" 369 | ] 370 | }, 371 | { 372 | "cell_type": "markdown", 373 | "metadata": {}, 374 | "source": [ 375 | "***Supply capacity constraint***" 376 | ] 377 | }, 378 | { 379 | "cell_type": "code", 380 | "execution_count": null, 381 | "metadata": {}, 382 | "outputs": [], 383 | "source": [ 384 | "@constraint(transport, cSupply[p in P], \n", 385 | " sum(X[p,m] for m in M) \n", 386 | " <= plants.capacity[plants.plant.==p][1])" 387 | ] 388 | }, 389 | { 390 | "cell_type": "markdown", 391 | "metadata": {}, 392 | "source": [ 393 | "***Demand balance constraint***\n", 394 | "\n", 395 | "Ensure all demand is satisfied at each market" 396 | ] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": null, 401 | "metadata": {}, 402 | "outputs": [], 403 | "source": [ 404 | "@constraint(transport, cDemand[m in M], \n", 405 | " sum(X[p,m] for p in P) \n", 406 | " >= markets.demand[markets.market.==m][1])" 407 | ] 408 | }, 409 | { 410 | "cell_type": "markdown", 411 | "metadata": {}, 412 | "source": [ 413 | "### Define objective function\n", 414 | "\n", 415 | "Minimize total cost of transport to satisfy all demand.\n", 416 | "\n", 417 | "First we'll define an expression for total cost of shipments..." 418 | ] 419 | }, 420 | { 421 | "cell_type": "code", 422 | "execution_count": null, 423 | "metadata": {}, 424 | "outputs": [], 425 | "source": [ 426 | "@expression(transport, eCost, \n", 427 | " sum(freight_cost*distances[Symbol(p),Symbol(m)]*X[p,m] \n", 428 | " for p in P, m in M)\n", 429 | " )" 430 | ] 431 | }, 432 | { 433 | "cell_type": "markdown", 434 | "metadata": {}, 435 | "source": [ 436 | "Now we'll minimize this total cost" 437 | ] 438 | }, 439 | { 440 | "cell_type": "code", 441 | "execution_count": null, 442 | "metadata": {}, 443 | "outputs": [], 444 | "source": [ 445 | "@objective(transport, Min, eCost)" 446 | ] 447 | }, 448 | { 449 | "cell_type": "markdown", 450 | "metadata": {}, 451 | "source": [ 452 | "## Interact with the model" 453 | ] 454 | }, 455 | { 456 | "cell_type": "markdown", 457 | "metadata": {}, 458 | "source": [ 459 | "**(a)** Now let's solve the model. In the blank cell below, enter the command for JuMP to solve a model and run the cell" 460 | ] 461 | }, 462 | { 463 | "cell_type": "code", 464 | "execution_count": null, 465 | "metadata": {}, 466 | "outputs": [], 467 | "source": [] 468 | }, 469 | { 470 | "cell_type": "markdown", 471 | "metadata": {}, 472 | "source": [ 473 | "**(b)** You've got a solution. Now query the objective function in the empty cell below and save it to a variable (name of your choice)" 474 | ] 475 | }, 476 | { 477 | "cell_type": "code", 478 | "execution_count": null, 479 | "metadata": {}, 480 | "outputs": [], 481 | "source": [] 482 | }, 483 | { 484 | "cell_type": "markdown", 485 | "metadata": {}, 486 | "source": [ 487 | "**(c)** Now query and save the optimal solution for X (the decisions about shipment quantities from plant to market) to an Array or DataFrame" 488 | ] 489 | }, 490 | { 491 | "cell_type": "code", 492 | "execution_count": null, 493 | "metadata": {}, 494 | "outputs": [], 495 | "source": [] 496 | }, 497 | { 498 | "cell_type": "markdown", 499 | "metadata": {}, 500 | "source": [ 501 | "**(d)** Please interpret your results by writing an explanation in the markdown cell below. \n", 502 | "\n", 503 | "Which facility or facilities supplies the most demand in New York? Does this result make sense? Why?\n", 504 | "\n", 505 | "Which facility or facilities supplies the most demand in Philadelphia? Does this result make sense? Why?\n", 506 | "\n", 507 | "Which facility or facilities supplies the demand in Princeton? Does this result make sense? Why?" 508 | ] 509 | }, 510 | { 511 | "cell_type": "markdown", 512 | "metadata": {}, 513 | "source": [] 514 | }, 515 | { 516 | "cell_type": "markdown", 517 | "metadata": {}, 518 | "source": [ 519 | "**(e)** A new market in New Brunswick appears, with a demand for 50 units. It is located 1.0 units away from both plants. Add this market to the model and solve again." 520 | ] 521 | }, 522 | { 523 | "cell_type": "code", 524 | "execution_count": null, 525 | "metadata": {}, 526 | "outputs": [], 527 | "source": [] 528 | }, 529 | { 530 | "cell_type": "markdown", 531 | "metadata": {}, 532 | "source": [ 533 | "**(f)** What is new optimal solution? " 534 | ] 535 | }, 536 | { 537 | "cell_type": "code", 538 | "execution_count": null, 539 | "metadata": {}, 540 | "outputs": [], 541 | "source": [] 542 | }, 543 | { 544 | "cell_type": "markdown", 545 | "metadata": {}, 546 | "source": [ 547 | "**(g)** Interpret this result in the markdown cell below. Which facility or facilities supplies the demand in New Brunswick? Does this result make sense? Why?" 548 | ] 549 | }, 550 | { 551 | "cell_type": "markdown", 552 | "metadata": {}, 553 | "source": [] 554 | }, 555 | { 556 | "cell_type": "code", 557 | "execution_count": null, 558 | "metadata": {}, 559 | "outputs": [], 560 | "source": [] 561 | } 562 | ], 563 | "metadata": { 564 | "kernelspec": { 565 | "display_name": "Julia 1.8.1", 566 | "language": "julia", 567 | "name": "julia-1.8" 568 | }, 569 | "language_info": { 570 | "file_extension": ".jl", 571 | "mimetype": "application/julia", 572 | "name": "julia", 573 | "version": "1.8.1" 574 | } 575 | }, 576 | "nbformat": 4, 577 | "nbformat_minor": 4 578 | } 579 | -------------------------------------------------------------------------------- /Homeworks/Homework-02.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Homework 2" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "This Notebook will detail Homework 2, which involves a basic capacity expansion model formulation described in [Notebook 3](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks)\n", 15 | "\n", 16 | "First, load (or install if necessary) a set of packages you'll need for this assignment..." 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": 1, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "# Uncomment and run this first line if you need to install or update packages\n", 26 | "#import Pkg; Pkg.add(\"JuMP\"); Pkg.add(\"HiGHS\"); Pkg.add(\"DataFrames\"); Pkg.add(\"CSV\")\n", 27 | "using JuMP\n", 28 | "using HiGHS\n", 29 | "using DataFrames\n", 30 | "using CSV" 31 | ] 32 | }, 33 | { 34 | "cell_type": "markdown", 35 | "metadata": {}, 36 | "source": [ 37 | "### Question 1 - Build the basic thermal generation expansion model\n", 38 | "\n", 39 | "Using the example model in [Notebook 3](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks) as your guide, input the code to create a basic thermal generator capacity expansion model, including [downloading the data for Notebook 3 here](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks/expansion_data) and loading the appropriate csv files." 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": null, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": {}, 59 | "source": [ 60 | "## Question 2: Analytical solution\n", 61 | "\n", 62 | "**A.** Using the data provided above, sort the demand data from highest to lowest hours to create a load duration curve and save this as a vector/array/DataFrame of your choice." 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": null, 68 | "metadata": {}, 69 | "outputs": [], 70 | "source": [] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": {}, 75 | "source": [ 76 | "**B.** Now using the cost data provided in '/generators_for_expansion.csv' and the load duration curve above, use the formulas provided in Lecture to determine an analytical solution to the optimal thermal generation expansion decisions (e.g. solve it algebraically rather than use an optimization solver to find the solution). \n", 77 | "\n", 78 | "Report the optimal capacity of each generation source and compare to the solution from the optimization model above. \n", 79 | "\n", 80 | "Show your work in cells below, using Julia to perform calculations. Explain your steps using inline code comments (e.g. `# Comment`) or by interspersing Markdown cells. \n", 81 | "\n", 82 | "Tip: round your solutions for the crossover hour between each technology to the nearest integer (as we have discrete hours in the time series)." 83 | ] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": null, 88 | "metadata": {}, 89 | "outputs": [], 90 | "source": [] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": null, 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [] 98 | }, 99 | { 100 | "cell_type": "markdown", 101 | "metadata": {}, 102 | "source": [ 103 | "**C.** Now change the fuel cost of natural gas to \\$8.00/MMBtu, recalculate the variable cost of CCGTs and CTs, and solve again for the optimal generation capacity mix. Describe what changes in your capacity results and what doesn't, and provide an explanation." 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": null, 109 | "metadata": {}, 110 | "outputs": [], 111 | "source": [] 112 | }, 113 | { 114 | "cell_type": "markdown", 115 | "metadata": {}, 116 | "source": [] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "## Question 3 - Expansion with renewables\n", 123 | "\n", 124 | "**A.** Using JuMP/Julia, implement an optimization model based on the formulation for optimal thermal+renewable capacity expansion provided in Section 2 of [Notebook 3](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks). " 125 | ] 126 | }, 127 | { 128 | "cell_type": "code", 129 | "execution_count": null, 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "metadata": {}, 137 | "source": [ 138 | "**B.** Solve the model to determine the optimal capacity when wind and solar are available resources and extract results for generation and capacity." 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": null, 144 | "metadata": { 145 | "scrolled": false 146 | }, 147 | "outputs": [], 148 | "source": [] 149 | }, 150 | { 151 | "cell_type": "markdown", 152 | "metadata": {}, 153 | "source": [ 154 | "**C.** What happens to the total firm generation and maximum MW of non-served energy? What does this imply about the capacity value of solar and/or wind built in the optimal capacity mix?" 155 | ] 156 | }, 157 | { 158 | "cell_type": "markdown", 159 | "metadata": {}, 160 | "source": [] 161 | }, 162 | { 163 | "cell_type": "markdown", 164 | "metadata": {}, 165 | "source": [ 166 | "## Question 4: Brownfield Expansion Model\n", 167 | "\n", 168 | "**A.** Now implement an optimization model based on the formulation for optimal \"brownfield\" thermal+renewable capacity expansion (e.g. with existing generators) provided in Section 3 of [Notebook 3](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks).\n", 169 | "\n", 170 | "Use the following data for fixed and variable costs of existing gas capacity. Note: unlike in the formulation in Notebook 3, there is no existing renewable capacity here to consider (only thermal)." 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": 12, 176 | "metadata": {}, 177 | "outputs": [], 178 | "source": [ 179 | "# Load new generator options\n", 180 | "#path = joinpath([REPLACE THIS WITH PATH TO YOUR power-systems-optimization DIRECTORY HERE],\"Notebooks\",\"expansion_data\")\n", 181 | "path = joinpath(\"/Users/jdj2/Documents/GitHub/power-systems-optimization\",\"Notebooks\",\"expansion_data\")\n", 182 | "generators = DataFrame(CSV.File(joinpath(path,\"generators_for_expansion.csv\")))\n", 183 | "# Add parameters for existing CCGTs, with the set index \"Old\"\n", 184 | "push!(generators, [\"Old_CC\" \"Existing CCGT\" 0 40000 5 7.5 4 0 0 0 0 40000 30])\n", 185 | "# Add parameters for existing CTs, with the set index \"Old\"\n", 186 | "push!(generators, [\"Old_CT\" \"Existing CT\" 0 30000 11 11.0 4 0 0 0 0 30000 55])\n", 187 | "\n", 188 | "# Set installed capacity for existing CCGTs:\n", 189 | "ExistingCap_CCGT = 1260 # Approximate actual existing capacity in SDGE\n", 190 | "ExistingCap_CT = 925 # Approximate actual existing capacity in SDGE\n", 191 | "# Add new column to generators Data Frame\n", 192 | "generators[!,:ExistingCap] = [0,0,0,0,0,0, ExistingCap_CCGT, ExistingCap_CT];" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": null, 198 | "metadata": {}, 199 | "outputs": [], 200 | "source": [] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": null, 205 | "metadata": {}, 206 | "outputs": [], 207 | "source": [] 208 | }, 209 | { 210 | "cell_type": "markdown", 211 | "metadata": {}, 212 | "source": [ 213 | "**B.** Solve the model to determine the optimal capacity when with existing generators and extract results for generation and capacity (including retirements)." 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": null, 219 | "metadata": {}, 220 | "outputs": [], 221 | "source": [] 222 | }, 223 | { 224 | "cell_type": "code", 225 | "execution_count": null, 226 | "metadata": {}, 227 | "outputs": [], 228 | "source": [] 229 | }, 230 | { 231 | "cell_type": "code", 232 | "execution_count": null, 233 | "metadata": {}, 234 | "outputs": [], 235 | "source": [] 236 | } 237 | ], 238 | "metadata": { 239 | "@webio": { 240 | "lastCommId": null, 241 | "lastKernelId": null 242 | }, 243 | "kernelspec": { 244 | "display_name": "Julia 1.8.1", 245 | "language": "julia", 246 | "name": "julia-1.8" 247 | }, 248 | "language_info": { 249 | "file_extension": ".jl", 250 | "mimetype": "application/julia", 251 | "name": "julia", 252 | "version": "1.8.1" 253 | } 254 | }, 255 | "nbformat": 4, 256 | "nbformat_minor": 4 257 | } 258 | -------------------------------------------------------------------------------- /Homeworks/Homework-03.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Homework 3" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "This Notebook builds on the unit commitment model introduced in [Notebook 5](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks) and the storage model introduced in [Notebook 2](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks).\n", 15 | "\n", 16 | "First, load (or install if necessary) a set of packages you'll need for this assignment..." 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": null, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "# Uncomment and run this first line if you need to install or update packages\n", 26 | "#import Pkg; Pkg.add(\"JuMP\"); Pkg.add(\"HiGHS\"); Pkg.add(\"DataFrames\"); Pkg.add(\"CSV\"); Pkg.add(\"Plots\"); Pkg.add(\"VegaLite\")\n", 27 | "using JuMP\n", 28 | "using HiGHS\n", 29 | "using DataFrames\n", 30 | "using CSV\n", 31 | "using Plots; plotly();\n", 32 | "using VegaLite # to make some nice plots\n", 33 | "\n", 34 | "#=\n", 35 | "Function to convert JuMP outputs (technically, AxisArrays) with two-indexes to a dataframe\n", 36 | "Inputs:\n", 37 | " var -- JuMP AxisArray (e.g., value.(GEN))\n", 38 | "Reference: https://jump.dev/JuMP.jl/v0.19/containers/\n", 39 | "=#\n", 40 | "function value_to_df_2dim(var)\n", 41 | " solution = DataFrame(var.data, :auto)\n", 42 | " ax1 = var.axes[1]\n", 43 | " ax2 = var.axes[2]\n", 44 | " cols = names(solution)\n", 45 | " insertcols!(solution, 1, :r_id => ax1)\n", 46 | " solution = stack(solution, Not(:r_id), variable_name=:hour)\n", 47 | " solution.hour = foldl(replace, [cols[i] => ax2[i] for i in 1:length(ax2)], init=solution.hour)\n", 48 | " rename!(solution, :value => :gen)\n", 49 | " solution.hour = convert.(Int64,solution.hour)\n", 50 | " return solution\n", 51 | "end" 52 | ] 53 | }, 54 | { 55 | "cell_type": "markdown", 56 | "metadata": {}, 57 | "source": [ 58 | "## Question 1 - Compare startup costs in unit commitment\n", 59 | "\n", 60 | "**A. Code and run basic model.**\n", 61 | "\n", 62 | "Data for this problem is stored in [`Homeworks/hw3_data`](hw3_data/).\n", 63 | "\n", 64 | "Following the `unit_commitment_simple` modeling formulation in [Notebook 5](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks), load the above data and create a unit commitment solver function with the following set of constraints:\n", 65 | "\n", 66 | "- Demand balance\n", 67 | "- Minimum / maximum generator constraints (non-committed)\n", 68 | "- Minimum / maximum generator constraints (committed)\n", 69 | "- Three-variable commitment formulation\n", 70 | "\n", 71 | "Note: the data (with hours 1-24) is already in local time. Hence, do not convert from GMT to GMT-8.\n", 72 | "\n", 73 | "Run the UC for the given day and plot a stacked area chart of generation using `@vlplot` from the `VegaLite` package.\n", 74 | "\n", 75 | "Throughout this assignment, please use a relative MIP gap of 1% for all questions. (If you are having difficulty getting this to solve on your computer in a reasonble amount of time, you can relax the gap but please then specify clearly in your comments that you have done so.)" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": null, 81 | "metadata": {}, 82 | "outputs": [], 83 | "source": [] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": {}, 88 | "source": [ 89 | "**B. Zero startup costs sensitivity**\n", 90 | "\n", 91 | "Next, create a modified version of the generator dataframe (`gen_df_sens = copy(gen_df)`) and set the startup costs for all generators to be 0.\n", 92 | "\n", 93 | "Rerun the UC and compare with the first solution. What are the main differences and why?" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "## Question 2: Implement pumped hydropower storage\n", 108 | "\n", 109 | "In the data, we have a generator `hydroelectric_pumped_storage` which is a pumped hydro storage (PHS) facility. We have been treating it as a free resource, but in fact, it's a battery. \n", 110 | "\n", 111 | "The PHS equations for stored water are identical to the state of charge for the battery in Notebook 2:\n", 112 | "\n", 113 | "\\begin{align*} \n", 114 | "SOC_t = SOC_{t-1} + \\big(CHARGE_t * battery\\_eff - \\frac{DISCHARGE_t}{battery\\_eff}\\big) \\quad \\forall t \\in T\n", 115 | "\\end{align*}\n", 116 | "\n", 117 | "In addition, the PHS has a power capacity constraint given in the dataframe's `existing_cap_mw` variable. You will also need to implement an energy capacity constraint. \n", 118 | "\n", 119 | "**A. Code pumped hydropower storage constraints.**\n", 120 | "\n", 121 | "Copy the `unit_commitment_simple` code above into a new cell below and rename the function `unit_commitment_storage`.\n", 122 | "\n", 123 | "Reviewing [Notebook 2](https://github.com/east-winds/power-systems-optimization/tree/master/Notebooks), add in relevant constraints for charging and discharging pumped hydropower. Assume the following parameters:\n", 124 | "\n", 125 | "- One-way efficiency is $battery_{eff} = 0.84$ (i.e., round-trip efficiency = $0.7$)\n", 126 | "- Energy capacity = 4 x Power capacity\n", 127 | "- Stored energy starts and ends the day at 50% capacity (you will need to code these constraints)\n", 128 | "\n", 129 | "Indicate which equations and variables you have added and explain your steps using inline code comments (e.g. `# Comment`)." 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": null, 135 | "metadata": {}, 136 | "outputs": [], 137 | "source": [] 138 | }, 139 | { 140 | "cell_type": "markdown", 141 | "metadata": {}, 142 | "source": [ 143 | "**B. Solve the new UC with PHS and plot.**\n", 144 | "\n", 145 | "Using the above formulation, solve for the same parameters in Problem 1 and plot. For the purposes of plotting, you will want to create two resources—PHS_charge and PHS_discharge. By convention, you could put PHS_charge on top to indicate this is increasing system load." 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": null, 151 | "metadata": {}, 152 | "outputs": [], 153 | "source": [] 154 | }, 155 | { 156 | "cell_type": "markdown", 157 | "metadata": {}, 158 | "source": [ 159 | "**C. Interpret results**\n", 160 | "\n", 161 | "Answer with a few sentences each of the following:\n", 162 | "\n", 163 | "1. Compare your results to `unit_commitment_simple`. Have any commitments changed?\n", 164 | "\n", 165 | "2. Interpret what is happening with the PHS facility during the day in terms of charging and discharging.\n", 166 | "\n", 167 | "3. Has curtailment reduced? (Explain this in the context of the PHS operation.)" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": null, 173 | "metadata": {}, 174 | "outputs": [], 175 | "source": [] 176 | } 177 | ], 178 | "metadata": { 179 | "@webio": { 180 | "lastCommId": null, 181 | "lastKernelId": null 182 | }, 183 | "kernelspec": { 184 | "display_name": "Julia 1.8.1", 185 | "language": "julia", 186 | "name": "julia-1.8" 187 | }, 188 | "language_info": { 189 | "file_extension": ".jl", 190 | "mimetype": "application/julia", 191 | "name": "julia", 192 | "version": "1.8.1" 193 | } 194 | }, 195 | "nbformat": 4, 196 | "nbformat_minor": 4 197 | } 198 | -------------------------------------------------------------------------------- /Homeworks/Homework-05.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Homework 5\n", 8 | "\n", 9 | "### Complex capacity expansion planning" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "In this homework assignment, we will explore the workings of a complex electricity system capacity expansion planning model that includes chronologically sequential operational decisions with time coupling constraints and transport flow constraints to represent power transmission limits between multiple geospatial regions.\n", 17 | "\n", 18 | "The 'core' model and data we will use are provided in [Notebooks/extra_labs/Lab1.jl](https://github.com/Power-Systems-Optimization-Course/power-systems-optimization/blob/master/Notebooks/extra_labs/Lab1.jl), [Notebooks/extra_labs/Lab1_code.jl](https://github.com/Power-Systems-Optimization-Course/power-systems-optimization/blob/master/Notebooks/extra_labs/Lab1_code.jl) and the [complex_expansion_data](https://github.com/Power-Systems-Optimization-Course/power-systems-optimization/tree/master/Notebooks/complex_expansion_data) folder. This core model includes economic dispatch decisions with ramp constraints for thermal generators and storage constraints (**but no thermal unit commitment constraints/decisions**). It uses a simplified capacitated transport flow constraint to represent inter-regional electricity transmission between three regions (rather than DC OPF constraints), with data representing the Electricity Reliability Corporation of Texas (ERCOT) region." 19 | ] 20 | }, 21 | { 22 | "cell_type": "markdown", 23 | "metadata": {}, 24 | "source": [ 25 | "### Part 1: Time domain reduction methods\n", 26 | "\n", 27 | "To reduce dimensionality and keep runtimes manageable for a tutorial assignment running on a desktop or laptop computer, we provide a set of *N* representative time periods of *Y* consecutive hourly periods (here either 24 hour days or 168 hour weeks) selected via a clustering method adapted from Mallapragada et al. (2018), \"[Impact of model resolution on scenario outcomes for electricity sector system expansion](https://doi.org/10.1016/j.energy.2018.08.015)\" Energy 163). \n", 28 | "\n", 29 | "This method creates clusters of representative periods by trying to minimize variation between time series for wind, solar, and demand in each of the within-cluster periods (days or weeks). It also always includes the period containing the peak demand hour, if this period was not already selected as a cluster centroid. \n", 30 | "\n", 31 | "To represent a full year of hourly operations, hours within each time period are weighted by a multiplier equal to the total number of periods (days or weeks) within the cluster represented by each representative period. In the objective function of the model, variable costs incurred in each hour are thus multiplied by this hourly weight to represent the cost of a full year of operation, as shown in the following two expressions, which make up the variable cost related part of the model objective function: " 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "# @expression(Expansion_Model, eVariableCosts,\n", 41 | "# # Variable costs for generation, weighted by hourly sample weight\n", 42 | "# sum(sample_weight[t]*generators.Var_Cost[g]*vGEN[t,g] for t in T, g in G)\n", 43 | "# )\n", 44 | "# @expression(Expansion_Model, eNSECosts,\n", 45 | "# # Non-served energy costs\n", 46 | "# sum(sample_weight[t]*nse.NSE_Cost[s]*vNSE[t,s,z] for t in T, s in S, z in Z)\n", 47 | "# )" 48 | ] 49 | }, 50 | { 51 | "cell_type": "markdown", 52 | "metadata": {}, 53 | "source": [ 54 | "For example, if a representative day represents a cluster with 8 total days, variable costs incurred in each hour in that representative period are multiplied by a `sample_weight` of 8, to represent repeated similar operational patterns in the clustered days. \n", 55 | "\n", 56 | "While time sampling methods like this can significantly reduce computational time, they also introduce abstraction errors that can bias model results. In this part of the assignment, we will explore these tradeoffs." 57 | ] 58 | }, 59 | { 60 | "cell_type": "markdown", 61 | "metadata": {}, 62 | "source": [ 63 | "#### Question 1(a)\n", 64 | "\n", 65 | "Copy the package commands and methods from `Lab1_code.jl` (except for `solve_cap_expansion_uc` which is not needed here).\n", 66 | "\n", 67 | "In addition, copy the commands from `Lab1.jl` (load inputs, solve model, write results, etc.).\n", 68 | "\n", 69 | "The model provided uses 10 representative days of data, and also records the solution time to a file in the output directory. \n", 70 | "\n", 71 | "However in the data folder (`Notebooks/complex_expansion_data`) there is also data for 4 weeks, 8 weeks, 16 weeks, and 52 weeks of representative periods.\n", 72 | "\n", 73 | "**Run the model for four of these temporal resolutions.** Each time you run the model, (a) record the solution time, and (b) save your outputs to a different folder named `/10_days_Your_Name`, `/4_weeks_Your_Name`, `8_weeks_Your_Name`, and `16_weeks_Your_Name`.\n", 74 | "\n", 75 | "Create and save a scatter plot that shows the solution time in seconds (y axis) and the number of hours included in the model for the 10 days (240 hours), 4 weeks (672 hours), 8 weeks (1344 hours), and 16 weeks (2688) iterations. What do you notice about the increase in solution time? How does the computational performance of the model appear to scale as the number of time steps in the model (hours) increases?" 76 | ] 77 | }, 78 | { 79 | "cell_type": "markdown", 80 | "metadata": {}, 81 | "source": [ 82 | "#### Question 1(b)\n", 83 | "\n", 84 | "Now let's see how the results of the model compare. Compile tables that compare (i) total cost results, (ii) total final capacity (MW) results by resource, and (iii) the total generation (GWh) results for all four iterations of the model. \n", 85 | "\n", 86 | "What are the largest differences in results in each category? What do you think accounts for these differences? How would you measure or assess the accuracy of this model? How might this change, depending on the type of question are you are considering? " 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "#### Question 1(c)\n", 94 | "\n", 95 | "The above experiment includes very little new wind or solar capacity additions. Let's try another case, which includes a **carbon tax of $50/tCO2**. \n", 96 | "\n", 97 | "The `generators` dataset contains information on the CO2 emissions per MWh (tCO2/MWh) in the column `CO2_Rate`.\n", 98 | "\n", 99 | "Create a copy of the capacity expansion function below, name it `solve_cap_expansion_co2`, and modify the following:\n", 100 | "- add a new parameter to the function `CO2_Price`\n", 101 | "- add an additional expression `eCO2Costs` given by the following expression\n", 102 | "- add this new cost to Total Costs" 103 | ] 104 | }, 105 | { 106 | "cell_type": "code", 107 | "execution_count": null, 108 | "metadata": {}, 109 | "outputs": [], 110 | "source": [ 111 | "# @expression(Expansion_Model, eCO2Costs,\n", 112 | "# # Carbon tax costs: variable only\n", 113 | "# sum(sample_weight[t]*generators.CO2_Rate[g]*vGEN[t,g]*CO2_Price for t in T, g in G)\n", 114 | "# )" 115 | ] 116 | }, 117 | { 118 | "cell_type": "markdown", 119 | "metadata": {}, 120 | "source": [ 121 | "Now repeat the experiment in Question 1(a-b) above with the CO2 price, recording solution time and results for 10 days, 4 weeks, 8 weeks, and 16 weeks time series inputs. Save the results to `10_days_CO2_Your_Name`, etc.\n", 122 | "\n", 123 | "Answer the following questions:\n", 124 | "\n", 125 | "How have the capacity and energy results changed overall with addition of the carbon price to fuel costs (relative to the original cases? \n", 126 | "\n", 127 | "How does the variation in the cost, capacity, and energy ouputs change now as you consider different number/duration of sample periods?\n", 128 | "\n", 129 | "What does the overall experiment in Question 1 tell you about the generalizability of time sampling methods?" 130 | ] 131 | }, 132 | { 133 | "cell_type": "markdown", 134 | "metadata": {}, 135 | "source": [ 136 | "#### Bonus\n", 137 | "\n", 138 | "As a bonus question: you can run the full 52 week time series and compare to the sample time series for Question 1(b-c) and/or 1(d) above. This case may take up to an hour or more to solve depending on your CPU. How do the full year results differ from your reduced time sample cases? Anything surprising? What might running this tell you about extrapolating the performance of time sampling methods based on a reduced time series rather than a full year (e.g. comparing 10 days or 4 weeks to 16 weeks vs 52 weeks)? \n", 139 | "\n", 140 | "This is not a required question and is not worth additional credit, but do this if you're motivated/curious..." 141 | ] 142 | }, 143 | { 144 | "cell_type": "markdown", 145 | "metadata": {}, 146 | "source": [ 147 | "### Part 2: Clean electricity standard policy\n", 148 | "\n", 149 | "For this question, in a new function `solve_cap_expansion_ces`, implement a clean electricity standard (CES) policy--a constraint that requires a certain share of generation from clean sources. Eligibility for a clean electricity standard is also recorded in the `generators.CES[g]` parameter and includes wind, solar, nuclear, generators with CCS, and hydro (not present).\n", 150 | "\n", 151 | "Take care in your implementation to consider the role of time weights when using a reduced time series as we are here (not all hours are created equal!).\n", 152 | "\n", 153 | "Run your capacity planning model with 8 weeks of data and under increasing stringency (e.g. at 0%, 20%, 40%, 60%, 80% and 100% clean energy requirement), and record and discuss results of each case. \n", 154 | "\n", 155 | "What do you notice about solution time and results as you change the stringency of the policy? How much does the policy increase costs at each level of stringency, relative to no policy? How much does it reduce CO$_2$ emissions? (You will need to add a calculation of CO$_2$ emissions to the model outputs recorded using `CO2_Rate`.)" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": null, 161 | "metadata": {}, 162 | "outputs": [], 163 | "source": [] 164 | } 165 | ], 166 | "metadata": { 167 | "@webio": { 168 | "lastCommId": null, 169 | "lastKernelId": null 170 | }, 171 | "kernelspec": { 172 | "display_name": "Julia 1.9.3", 173 | "language": "julia", 174 | "name": "julia-1.9" 175 | }, 176 | "language_info": { 177 | "file_extension": ".jl", 178 | "mimetype": "application/julia", 179 | "name": "julia", 180 | "version": "1.9.3" 181 | } 182 | }, 183 | "nbformat": 4, 184 | "nbformat_minor": 4 185 | } 186 | -------------------------------------------------------------------------------- /Homeworks/hw3_data/Demand.csv: -------------------------------------------------------------------------------- 1 | Hour,Demand 2 | 1,1082.05 3 | 2,1040.51 4 | 3,1017.06 5 | 4,1046.54 6 | 5,1161.11 7 | 6,1323.92 8 | 7,1523.58 9 | 8,1739.99 10 | 9,1901.46 11 | 10,2025.41 12 | 11,2093.75 13 | 12,1985.21 14 | 13,1837.81 15 | 14,1786.22 16 | 15,1727.26 17 | 16,1662.94 18 | 17,1780.19 19 | 18,1688.4 20 | 19,1673.66 21 | 20,1739.99 22 | 21,1717.88 23 | 22,1530.95 24 | 23,1313.87 25 | 24,1136.99 -------------------------------------------------------------------------------- /Homeworks/hw3_data/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu 2 | None,0,0 3 | pacific_naturalgas,2.57,0.05306 4 | pacific_naturalgas_ccs90,3.04,0.00531 5 | pacific_naturalgas_ccs100,3.1,0 -------------------------------------------------------------------------------- /Homeworks/hw3_data/Generators_data.csv: -------------------------------------------------------------------------------- 1 | R_ID,Resource,region,Existing_Cap_MW,num_units,Cap_size,Var_OM_cost_per_MWh,Var_OM_cost_per_MWh_in,Fuel,Heat_rate_MMBTU_per_MWh,heat_rate_mmbtu_mwh_iqr,heat_rate_mmbtu_mwh_std,Min_power,Ramp_Up_percentage,Ramp_Dn_percentage,Start_cost_per_MW,Start_fuel_MMBTU_per_MW,Up_time,Down_time,Self_disch,Eff_up,Eff_down,Ratio_power_to_energy,Min_Duration,Max_Duration,cluster,zone,voltage_level,CapRes,THERM,DISP,NDISP,STOR,DR,HEAT,NACC,TRADER,HYDRO,RPS,CES,Commit,Min_Share,Max_Share,Existing_Cap_MWh,unmodified_existing_cap_mw,New_Build,Min_Cap_MW,Max_Cap_MW,Min_Share_percent,Max_Share_percent,capex,Inv_cost_per_MWyr,Fixed_OM_cost_per_MWyr,capex_mwh,Inv_cost_per_MWhyr,Fixed_OM_cost_per_MWhyr,NACC_Eff,NACC_Peak_to_Base,Reg_Up,Reg_Dn,Rsv_Up,Rsv_Dn,Reg_Cost,Rsv_Cost,spur_miles,spur_capex,offshore_spur_miles,offshore_spur_capex,tx_miles,tx_capex,interconnect_annuity,Max_DSM_delay 2 | 1,biomass,WEC_SDGE,21.4,20,1.07,5.234,0,None,12.76,1.471,4.147,0.71,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,32.8,-1,0,0,0,0,0,0,111708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3 | 2,hydroelectric_pumped_storage,WEC_SDGE,100,2,21,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.866,0.866,0.25,0,0,1,1,trans,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,42,1,0,0,0,0,0,0,38460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 4 | 3,natural_gas_fired_combined_cycle,WEC_SDGE,600,1,607.1,3.4,0,pacific_naturalgas,7.52,0,0,0.362,0.4,0.4,87,2,6,6,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,607.1,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 5 | 4,natural_gas_fired_combined_cycle,WEC_SDGE,500,1,570,3.4,0,pacific_naturalgas,7.15,0,0,0.351,0.4,0.4,87,2,6,6,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,570,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 6 | 5,natural_gas_fired_combined_cycle,WEC_SDGE,336,3,112,10.8,0,pacific_naturalgas,10.03,0,0,0.446,3.78,3.78,113,3.5,6,6,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 7 | 6,natural_gas_fired_combustion_turbine,WEC_SDGE,91.6,2,45.8,10.8,0,pacific_naturalgas,10.69,0,0,0.8,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,91.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8 | 7,natural_gas_fired_combustion_turbine,WEC_SDGE,49.9,1,49.9,10.8,0,pacific_naturalgas,10.48,0,0,0.487,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 9 | 8,natural_gas_fired_combustion_turbine,WEC_SDGE,48.1,1,48.1,10.8,0,pacific_naturalgas,11.04,0,0,0.437,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.1,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 10 | 9,natural_gas_fired_combustion_turbine,WEC_SDGE,34.6,1,34.6,10.8,0,pacific_naturalgas,16.86,0,0,0.954,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,34.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 11 | 10,natural_gas_fired_combustion_turbine,WEC_SDGE,96.6,3,32.2,10.8,0,pacific_naturalgas,10.5,0,0,0.932,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,96.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 12 | 11,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,11.15,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,6,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 13 | 12,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,11.2,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,7,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 14 | 13,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.22,0,0,0.654,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,8,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 15 | 14,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.3,0,0,0.654,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,9,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 16 | 15,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.08,0,0,0.409,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,10,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 17 | 16,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.12,0,0,0.409,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,11,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 18 | 17,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,12,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 19 | 18,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,13,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 20 | 19,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,14,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 21 | 20,onshore_wind_turbine,WEC_SDGE,200,3,64.67,0,0,None,9.12,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,194.001,0,0,0,0,0,0,0,43205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 22 | 21,small_hydroelectric,WEC_SDGE,50,6,1.22,0,0,None,9.12,0.002,0.001,0.385,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,13.5,-1,0,0,0,0,0,0,44560,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 23 | 22,solar_photovoltaic,WEC_SDGE,2500,20,8.48,0,0,None,9.16,0,0.021,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,169.6,0,0,0,0,0,0,0,17943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24 | 23,naturalgas_ccccsavgcf,WEC_SDGE,0,0,500,7.2,0,pacific_naturalgas_ccs90,7.52,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,2215517.79,229065,33620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25 | 24,naturalgas_ccs100,WEC_SDGE,0,0,500,7.7,0,pacific_naturalgas_ccs100,7.88,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,-1,0,0,2331517.79,241058,43290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -------------------------------------------------------------------------------- /Homeworks/hw3_data/Generators_variability.csv: -------------------------------------------------------------------------------- 1 | Hour,WEC_SDGE_biomass_1.0,WEC_SDGE_hydroelectric_pumped_storage_1.0,WEC_SDGE_natural_gas_fired_combined_cycle_1.0,WEC_SDGE_natural_gas_fired_combined_cycle_2.0,WEC_SDGE_natural_gas_fired_combined_cycle_3.0,WEC_SDGE_natural_gas_fired_combined_cycle_4.0,WEC_SDGE_natural_gas_fired_combustion_turbine_1.0,WEC_SDGE_natural_gas_fired_combustion_turbine_2.0,WEC_SDGE_natural_gas_fired_combustion_turbine_3.0,WEC_SDGE_natural_gas_fired_combustion_turbine_4.0,WEC_SDGE_natural_gas_fired_combustion_turbine_5.0,WEC_SDGE_natural_gas_fired_combustion_turbine_6.0,WEC_SDGE_natural_gas_fired_combustion_turbine_7.0,WEC_SDGE_natural_gas_fired_combustion_turbine_8.0,WEC_SDGE_natural_gas_fired_combustion_turbine_9.0,WEC_SDGE_natural_gas_fired_combustion_turbine_10.0,WEC_SDGE_natural_gas_fired_combustion_turbine_11.0,WEC_SDGE_natural_gas_fired_combustion_turbine_12.0,WEC_SDGE_onshore_wind_turbine_1.0,WEC_SDGE_small_hydroelectric_1.0,WEC_SDGE_solar_photovoltaic_1.0,WEC_SDGE_naturalgas_ccccsavgcf_0.0,WEC_SDGE_naturalgas_ccavgcf_0.0,WEC_SDGE_naturalgas_ctavgcf_0.0,WEC_SDGE_battery_0.0,WEC_SDGE_naturalgas_ccs100_0.0,WEC_SDGE_landbasedwind_ltrg1_1.0,WEC_SDGE_landbasedwind_ltrg1_2.0,WEC_SDGE_utilitypv_losangeles_1.0,WEC_SDGE_utilitypv_losangeles_2.0 2 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7505,0.4351,0,1,1,1,1,1,0.861670911,0.769474864,0,0 3 | 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7803,0.4351,0,1,1,1,1,1,0.811289549,0.804333448,0,0 4 | 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.529,0.4351,0,1,1,1,1,1,0.621719241,0.587355316,0,0 5 | 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.4621,0.4351,0,1,1,1,1,1,0.534332454,0.566414058,0,0 6 | 5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.3703,0.4351,0,1,1,1,1,1,0.469521701,0.451619923,0,0 7 | 6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.6396,0.4351,0,1,1,1,1,1,0.648310304,0.745926023,0,0 8 | 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.3409,0.4351,0.0553,1,1,1,1,1,0.450812787,0.35501039,0.013967711,0.035925724 9 | 8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.2269,0.4351,0.2211,1,1,1,1,1,0.277320772,0.172246754,0.067933641,0.132562026 10 | 9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7691,0.4351,0.4776,1,1,1,1,1,0.791600108,0.779795885,0.436028361,0.529464602 11 | 10,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.6046,0.4351,0.5757,1,1,1,1,1,0.695997953,0.63216567,0.602751851,0.72357893 12 | 11,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.511,0.4351,0.6039,1,1,1,1,1,0.728941619,0.560297012,0.666458726,0.735147357 13 | 12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.4233,0.4351,0.6139,1,1,1,1,1,0.665786088,0.446913362,0.737981737,0.772878051 14 | 13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.2394,0.4351,0.6446,1,1,1,1,1,0.449626267,0.249397844,0.822409153,0.783650994 15 | 14,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.2973,0.4351,0.6455,1,1,1,1,1,0.619330287,0.32043615,0.794866443,0.817884505 16 | 15,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.2262,0.4351,0.6241,1,1,1,1,1,0.354134321,0.234894454,0.753308773,0.766182065 17 | 16,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.3006,0.4351,0.5695,1,1,1,1,1,0.482802153,0.30224362,0.690914631,0.74317646 18 | 17,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.5386,0.4351,0.543,1,1,1,1,1,0.511658132,0.517104685,0.811519802,0.819672287 19 | 18,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.5878,0.4351,0.3342,1,1,1,1,1,0.667218268,0.565893114,0.550071239,0.561239719 20 | 19,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7645,0.4351,0.055,1,1,1,1,1,0.839089751,0.788183868,0.092749879,0.083774574 21 | 20,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7787,0.4351,0,1,1,1,1,1,0.893368006,0.813245773,0,0 22 | 21,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.8244,0.4351,0,1,1,1,1,1,0.885333896,0.851173103,0,0 23 | 22,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.6983,0.4351,0,1,1,1,1,1,0.889701962,0.706717014,0,0 24 | 23,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.7444,0.4351,0,1,1,1,1,1,0.897126198,0.785994887,0,0 25 | 24,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.6714,0.4351,0,1,1,1,1,1,0.848014593,0.707199693,0,0 -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Michael Davidson and Jesse Jenkins 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Licensing and copyright information 2 | - 3 | 4 | The course material is licensed under the 5 | [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/) 6 | and the course code is licensed under a [MIT License](LICENSE-MIT) 7 | by Michael Davidson and Jesse Jenkins. 8 | 9 | In addition to our own developed material, we have modified material from other courses and workshops, including: 10 | 11 | Name | Author(s) | Links 12 | ------- | ------- | ------ 13 | ESD.865 Modeling of Electric Power Systems | [Mort Webster](https://www.eme.psu.edu/directory/mort-d-webster) | Taught Spring 2013, MIT 14 | Grid Science Winter School Julia Tutorial 2019 | [Carleton Coffrin](https://github.com/ccoffrin), [Oscar Dowson](https://github.com/odow) | [github](https://github.com/lanl-ansi/tutorial-grid-science-2019) 15 | -------------------------------------------------------------------------------- /Notebooks/00-Getting-Started-w-DataFrames.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Working with tabular data in Julia. ([DataFrames.jl](https://github.com/JuliaData/DataFrames.jl/tree/main)).\n", 8 | "\n", 9 | "## What this notebook covers:\n", 10 | "\n", 11 | "- **Creating** a DataFrame from scratch.\n", 12 | "- **Reading** data from a CSV file.\n", 13 | "- **Basic information** about the DataFrame.\n", 14 | "- **Selecting specific columns** using `select`.\n", 15 | "- **Filtering rows** based on conditions.\n", 16 | "- **Subsetting rows** by index.\n", 17 | "- **Adding a new column**.\n", 18 | "- **Deleting** a column.\n", 19 | "- **Renaming columns**.\n", 20 | "- **Sorting** the DataFrame by a specific column.\n", 21 | "- **Grouping by a column** and performing aggregation.\n", 22 | "- **Looping** through groups and printing details.\n", 23 | "- **Writing** the DataFrame to a CSV file." 24 | ] 25 | }, 26 | { 27 | "cell_type": "markdown", 28 | "metadata": {}, 29 | "source": [ 30 | "#### 1. Install necessary packages" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": null, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "using Pkg\n", 40 | "Pkg.add(\"DataFrames\")\n", 41 | "Pkg.add(\"CSV\")" 42 | ] 43 | }, 44 | { 45 | "cell_type": "markdown", 46 | "metadata": {}, 47 | "source": [ 48 | "#### 2. Import the required packages" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": null, 54 | "metadata": {}, 55 | "outputs": [], 56 | "source": [ 57 | "using DataFrames\n", 58 | "using CSV" 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "metadata": {}, 64 | "source": [ 65 | "#### 3. Create a DataFrame" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [ 74 | "df = DataFrame(\n", 75 | " Resource = [\"solar\", \"wind\", \"hydro\", \"nuclear\", \"coal\", \"natural gas\", \"biofuel\"],\n", 76 | " Capacity = [500, 200, 10, 1000, 500, 5000, 50],\n", 77 | " Fuel_type = [\"None\", \"None\", \"None\", \"Uranium\", \"Coal\", \"Natural Gas\", \"None\"],\n", 78 | " Location = [\"California\", \"California\", \"Oregon\", \"Georgia\", \"Virginia\", \"Texas\", \"California\"]\n", 79 | ")" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "#### 4. Load a CSV file into a DataFrame" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [ 95 | "filepath = \"uc_data/Demand.csv\"\n", 96 | "df = CSV.read(filepath, DataFrame)\n", 97 | "# df = DataFrame(CSV.File(filepath))\n", 98 | "# df = CSV.File(filepath) |> DataFrame" 99 | ] 100 | }, 101 | { 102 | "cell_type": "markdown", 103 | "metadata": {}, 104 | "source": [ 105 | "#### 5. Work with DataFrames" 106 | ] 107 | }, 108 | { 109 | "cell_type": "code", 110 | "execution_count": null, 111 | "metadata": {}, 112 | "outputs": [], 113 | "source": [ 114 | "# Load the CSV file into a DataFrame\n", 115 | "df = CSV.read(\"uc_data/Generators_data.csv\", DataFrame)\n", 116 | "# Display the DataFrame\n", 117 | "display(df)" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": {}, 123 | "source": [ 124 | "To extract the columns of a `DataFrame` directly (i.e. without copying) you can use one of the following syntaxes: `df.T`, `df.\"T\"`, `df[!, :T]` or `df[!, \"T\"]` (a copy is made when usign `df[:,T]`):" 125 | ] 126 | }, 127 | { 128 | "cell_type": "code", 129 | "execution_count": null, 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [ 133 | "df.\"Existing_Cap_MW\"" 134 | ] 135 | }, 136 | { 137 | "cell_type": "markdown", 138 | "metadata": {}, 139 | "source": [ 140 | "You can obtain a vector of column names of the `DataFrames` as `Strings` using the `names` function:" 141 | ] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "execution_count": null, 146 | "metadata": {}, 147 | "outputs": [], 148 | "source": [ 149 | "names(df)" 150 | ] 151 | }, 152 | { 153 | "cell_type": "markdown", 154 | "metadata": {}, 155 | "source": [ 156 | "If you were interested in element types of the columns, you can use the `eachcol` function to iterate over the columns, and `eltype` function to get the desired output:" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": null, 162 | "metadata": {}, 163 | "outputs": [], 164 | "source": [ 165 | "eltype.(eachcol(df))" 166 | ] 167 | }, 168 | { 169 | "cell_type": "markdown", 170 | "metadata": {}, 171 | "source": [ 172 | "Other useful functions:" 173 | ] 174 | }, 175 | { 176 | "cell_type": "code", 177 | "execution_count": null, 178 | "metadata": {}, 179 | "outputs": [], 180 | "source": [ 181 | "@show size(df) # dataframe dimensions\n", 182 | "@show size(df, 1) # dataframe dimension along first axis\n", 183 | "@show size(df, 2) # dataframe dimension along second axis\n", 184 | "@show nrow(df) # number of rows\n", 185 | "@show ncol(df) # number of columns" 186 | ] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": {}, 191 | "source": [ 192 | "Get basis statistcs of the `DataFrame`:" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": null, 198 | "metadata": {}, 199 | "outputs": [], 200 | "source": [ 201 | "describe(df) " 202 | ] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "metadata": {}, 207 | "source": [ 208 | "Visualize the first/last few rows of the `DataFrame`:" 209 | ] 210 | }, 211 | { 212 | "cell_type": "code", 213 | "execution_count": null, 214 | "metadata": {}, 215 | "outputs": [], 216 | "source": [ 217 | "first(df,6) # first 6 rows" 218 | ] 219 | }, 220 | { 221 | "cell_type": "code", 222 | "execution_count": null, 223 | "metadata": {}, 224 | "outputs": [], 225 | "source": [ 226 | "last(df,6) # last 6 rows" 227 | ] 228 | }, 229 | { 230 | "cell_type": "markdown", 231 | "metadata": {}, 232 | "source": [ 233 | "Select subsets of a `DataFrame` (Ref: [Indexing](https://dataframes.juliadata.org/stable/lib/indexing/)):" 234 | ] 235 | }, 236 | { 237 | "cell_type": "code", 238 | "execution_count": null, 239 | "metadata": {}, 240 | "outputs": [], 241 | "source": [ 242 | "df[1:2, [1,3]]" 243 | ] 244 | }, 245 | { 246 | "cell_type": "code", 247 | "execution_count": null, 248 | "metadata": {}, 249 | "outputs": [], 250 | "source": [ 251 | "df[1:3, 1:4]" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": null, 257 | "metadata": {}, 258 | "outputs": [], 259 | "source": [ 260 | "df[1:3, [:Resource, :Existing_Cap_MW, :region]]" 261 | ] 262 | }, 263 | { 264 | "cell_type": "code", 265 | "execution_count": null, 266 | "metadata": {}, 267 | "outputs": [], 268 | "source": [ 269 | "df_selected = select(df, Not([:Fuel, :region, :num_units, :Existing_Cap_MW]))\n", 270 | "display(df_selected)\n" 271 | ] 272 | }, 273 | { 274 | "cell_type": "markdown", 275 | "metadata": {}, 276 | "source": [ 277 | "Filter rows based on a condition:" 278 | ] 279 | }, 280 | { 281 | "cell_type": "code", 282 | "execution_count": null, 283 | "metadata": {}, 284 | "outputs": [], 285 | "source": [ 286 | "df_filtered = filter(row -> row.Existing_Cap_MW > 200, df)\n", 287 | "display(df_filtered)" 288 | ] 289 | }, 290 | { 291 | "cell_type": "markdown", 292 | "metadata": {}, 293 | "source": [ 294 | "Change the data stored in a `DataFrame`:" 295 | ] 296 | }, 297 | { 298 | "cell_type": "code", 299 | "execution_count": null, 300 | "metadata": {}, 301 | "outputs": [], 302 | "source": [ 303 | "new_val = zeros(Int, nrow(df))\n", 304 | "df1 = copy(df)\n", 305 | "df1.Cap_size = new_val\n", 306 | "df1" 307 | ] 308 | }, 309 | { 310 | "cell_type": "markdown", 311 | "metadata": {}, 312 | "source": [ 313 | "Add a new column to the `DataFrame`:" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": null, 319 | "metadata": {}, 320 | "outputs": [], 321 | "source": [ 322 | "df.Existing_Cap_GW = df.Existing_Cap_MW ./ 1000\n", 323 | "display(df)\n" 324 | ] 325 | }, 326 | { 327 | "cell_type": "markdown", 328 | "metadata": {}, 329 | "source": [ 330 | "Delete a column:" 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": null, 336 | "metadata": {}, 337 | "outputs": [], 338 | "source": [ 339 | "select!(df, Not(:zone))\n", 340 | "display(df)" 341 | ] 342 | }, 343 | { 344 | "cell_type": "markdown", 345 | "metadata": {}, 346 | "source": [ 347 | "Rename a column:" 348 | ] 349 | }, 350 | { 351 | "cell_type": "code", 352 | "execution_count": null, 353 | "metadata": {}, 354 | "outputs": [], 355 | "source": [ 356 | "rename!(df, :region => :Location)\n", 357 | "display(df)" 358 | ] 359 | }, 360 | { 361 | "cell_type": "markdown", 362 | "metadata": {}, 363 | "source": [ 364 | "Sort the `DataFrame` by the column `Existing_Cap_MW` in descending order:" 365 | ] 366 | }, 367 | { 368 | "cell_type": "code", 369 | "execution_count": null, 370 | "metadata": {}, 371 | "outputs": [], 372 | "source": [ 373 | "df_sorted = sort(df, :Existing_Cap_MW, rev=true)\n", 374 | "display(df_sorted)" 375 | ] 376 | }, 377 | { 378 | "cell_type": "markdown", 379 | "metadata": {}, 380 | "source": [ 381 | "Group by `Location` and calculate mean capacity per location:" 382 | ] 383 | }, 384 | { 385 | "cell_type": "code", 386 | "execution_count": null, 387 | "metadata": {}, 388 | "outputs": [], 389 | "source": [ 390 | "Pkg.add(\"Statistics\")\n", 391 | "using Statistics" 392 | ] 393 | }, 394 | { 395 | "cell_type": "code", 396 | "execution_count": null, 397 | "metadata": {}, 398 | "outputs": [], 399 | "source": [ 400 | "df_grouped = combine(groupby(df, :Fuel), :Inv_cost_per_MWyr => mean => :Avg_Inv_cost_per_MWyr)\n", 401 | "display(df_grouped)" 402 | ] 403 | }, 404 | { 405 | "cell_type": "markdown", 406 | "metadata": {}, 407 | "source": [ 408 | "Use a loop to print the details of each group:" 409 | ] 410 | }, 411 | { 412 | "cell_type": "code", 413 | "execution_count": null, 414 | "metadata": {}, 415 | "outputs": [], 416 | "source": [ 417 | "for fuel in unique(df.Fuel)\n", 418 | " println(\"Fuel: $fuel\")\n", 419 | " fuel_rows = filter(row -> row.Fuel == fuel, df)\n", 420 | " display(fuel_rows)\n", 421 | "end" 422 | ] 423 | }, 424 | { 425 | "cell_type": "markdown", 426 | "metadata": {}, 427 | "source": [ 428 | "Loop through `DataFrame` rows:" 429 | ] 430 | }, 431 | { 432 | "cell_type": "code", 433 | "execution_count": null, 434 | "metadata": {}, 435 | "outputs": [], 436 | "source": [ 437 | "cap_therm = Float64[]\n", 438 | "for row in eachrow(df)\n", 439 | " if row.THERM == 1\n", 440 | " push!(cap_therm, row.Existing_Cap_MW)\n", 441 | " end\n", 442 | "end\n", 443 | "cap_therm" 444 | ] 445 | }, 446 | { 447 | "cell_type": "code", 448 | "execution_count": null, 449 | "metadata": {}, 450 | "outputs": [], 451 | "source": [ 452 | "cap_therm = [resource.Existing_Cap_MW for resource in eachrow(df) if resource.THERM == 1]" 453 | ] 454 | }, 455 | { 456 | "cell_type": "code", 457 | "execution_count": null, 458 | "metadata": {}, 459 | "outputs": [], 460 | "source": [ 461 | "df[df.THERM .== 1, :Existing_Cap_MW]" 462 | ] 463 | }, 464 | { 465 | "cell_type": "markdown", 466 | "metadata": {}, 467 | "source": [ 468 | "#### 6. Write the updated DataFrame to a CSV file" 469 | ] 470 | }, 471 | { 472 | "cell_type": "code", 473 | "execution_count": null, 474 | "metadata": {}, 475 | "outputs": [], 476 | "source": [ 477 | "CSV.write(\"generators_data_modified.csv\", df, writeheader=true)" 478 | ] 479 | }, 480 | { 481 | "cell_type": "markdown", 482 | "metadata": {}, 483 | "source": [ 484 | "### Exercise 1\n", 485 | "Read data stored in a gzip-compressed file `example8.csv.gz` into a `DataFrame` called `df`." 486 | ] 487 | }, 488 | { 489 | "cell_type": "code", 490 | "execution_count": null, 491 | "metadata": {}, 492 | "outputs": [], 493 | "source": [ 494 | "# write your solution here" 495 | ] 496 | }, 497 | { 498 | "cell_type": "markdown", 499 | "metadata": {}, 500 | "source": [ 501 | "
\n", 502 | "Solution\n", 503 | "\n", 504 | "```julia\n", 505 | "using CSV\n", 506 | "using DataFrames\n", 507 | "\n", 508 | "df = CSV.read(\"example8.csv.gz\", DataFrame)\n", 509 | "```" 510 | ] 511 | }, 512 | { 513 | "cell_type": "markdown", 514 | "metadata": {}, 515 | "source": [ 516 | "### Exercise 2\n", 517 | "Get number of rows, columns, column names and summary statistics of the `df` data frame from exercise 10." 518 | ] 519 | }, 520 | { 521 | "cell_type": "code", 522 | "execution_count": null, 523 | "metadata": {}, 524 | "outputs": [], 525 | "source": [ 526 | "# write your solution here" 527 | ] 528 | }, 529 | { 530 | "cell_type": "markdown", 531 | "metadata": {}, 532 | "source": [ 533 | "
\n", 534 | "Solution\n", 535 | "\n", 536 | "```julia\n", 537 | "julia> nrow(df)\n", 538 | "4\n", 539 | "```\n", 540 | "```julia\n", 541 | "julia> ncol(df)\n", 542 | "2\n", 543 | "```\n", 544 | "```julia\n", 545 | "julia> names(df)\n", 546 | "2-element Vector{String}:\n", 547 | " \"number\"\n", 548 | " \"square\"\n", 549 | " ```\n", 550 | "```julia\n", 551 | "julia> describe(df)\n", 552 | "2×7 DataFrame\n", 553 | " Row │ variable mean min median max nmissing eltype\n", 554 | " │ Symbol Float64 Int64 Float64 Int64 Int64 DataType\n", 555 | "─────┼──────────────────────────────────────────────────────────────\n", 556 | " 1 │ number 2.5 1 2.5 4 0 Int64\n", 557 | " 2 │ square 7.75 2 6.5 16 0 Int64\n", 558 | "```\n" 559 | ] 560 | }, 561 | { 562 | "cell_type": "markdown", 563 | "metadata": {}, 564 | "source": [ 565 | "### Exercise 3\n", 566 | "Add a column to `df` data frame with label \"name_string\" containing string representation of numbers in column number, i.e. [\"one\", \"two\", \"three\", \"four\"]." 567 | ] 568 | }, 569 | { 570 | "cell_type": "code", 571 | "execution_count": null, 572 | "metadata": {}, 573 | "outputs": [], 574 | "source": [ 575 | "# write your solution here" 576 | ] 577 | }, 578 | { 579 | "cell_type": "markdown", 580 | "metadata": {}, 581 | "source": [ 582 | "
\n", 583 | "Solution\n", 584 | "\n", 585 | "```bash\n", 586 | "julia> df.\"name string\" = [\"one\", \"two\", \"three\", \"four\"]\n", 587 | "4-element Vector{String}:\n", 588 | " \"one\"\n", 589 | " \"two\"\n", 590 | " \"three\"\n", 591 | " \"four\"\n", 592 | "```\n", 593 | "\n", 594 | "```bash\n", 595 | "julia> df\n", 596 | "4×3 DataFrame\n", 597 | " Row │ number square name string\n", 598 | " │ Int64 Int64 String\n", 599 | "─────┼─────────────────────────────\n", 600 | " 1 │ 1 2 one\n", 601 | " 2 │ 2 4 two\n", 602 | " 3 │ 3 9 three\n", 603 | " 4 │ 4 16 four\n", 604 | "```" 605 | ] 606 | }, 607 | { 608 | "cell_type": "markdown", 609 | "metadata": {}, 610 | "source": [ 611 | "### Exercise 4\n", 612 | "Check if `df` contains column `square2`." 613 | ] 614 | }, 615 | { 616 | "cell_type": "code", 617 | "execution_count": null, 618 | "metadata": {}, 619 | "outputs": [], 620 | "source": [ 621 | "# write your solution here" 622 | ] 623 | }, 624 | { 625 | "cell_type": "markdown", 626 | "metadata": {}, 627 | "source": [ 628 | "
\n", 629 | "Solution\n", 630 | "\n", 631 | "\n", 632 | "```bash\n", 633 | "hasproperty(df, :square2)\n", 634 | "```" 635 | ] 636 | }, 637 | { 638 | "cell_type": "markdown", 639 | "metadata": {}, 640 | "source": [] 641 | } 642 | ], 643 | "metadata": { 644 | "kernelspec": { 645 | "display_name": "Julia 1.10.5", 646 | "language": "julia", 647 | "name": "julia-1.10" 648 | }, 649 | "language_info": { 650 | "file_extension": ".jl", 651 | "mimetype": "application/julia", 652 | "name": "julia", 653 | "version": "1.10.5" 654 | } 655 | }, 656 | "nbformat": 4, 657 | "nbformat_minor": 4 658 | } 659 | -------------------------------------------------------------------------------- /Notebooks/Benders-Complex-Capacity-Expansion.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Solving a Complex Capacity Expansion Model with Benders decomposition\n", 8 | "\n", 9 | "_**[Power Systems Optimization](https://github.com/east-winds/power-systems-optimization)**_\n", 10 | "\n", 11 | "We demonstrate the application of Benders Decomposition to solve the capacity expansion model illustrated in [Complex Capacity Expanion](07-Complex-Capacity-Expansion.ipynb).\n", 12 | "\n", 13 | "In the `complex_expansion_data/` path, we provide several different sets of inputs using different sample time periods, for your use and experimentation, including 10 days (used as default below), 4 weeks, 8 weeks, 16 weeks, and 52 weeks (full 8760 hours). Note that the open-source solver HiGHS may struggle to solve models with more than 10 days. Alter the `inputs_path` parameter below to select a different time series if desired." 14 | ] 15 | }, 16 | { 17 | "cell_type": "markdown", 18 | "metadata": {}, 19 | "source": [ 20 | "## LOAD PACKAGES" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "# Ensure these packages are installed; if not, use the Pkg package and Pkg.add() function to install\n", 30 | "using JuMP\n", 31 | "using HiGHS\n", 32 | "using Plots\n", 33 | "using DataFrames, CSV\n", 34 | "import Printf\n", 35 | "\n", 36 | "include(\"benders_cems.jl\")" 37 | ] 38 | }, 39 | { 40 | "cell_type": "markdown", 41 | "metadata": {}, 42 | "source": [ 43 | "## SELECT INPUTS PATH" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": null, 49 | "metadata": {}, 50 | "outputs": [], 51 | "source": [ 52 | "# Read input data for a case with 10 sample days of data\n", 53 | "inputs_path = \"complex_expansion_data/10_days/\"\n" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": {}, 59 | "source": [ 60 | "## LOAD INPUTS" 61 | ] 62 | }, 63 | { 64 | "cell_type": "code", 65 | "execution_count": null, 66 | "metadata": {}, 67 | "outputs": [], 68 | "source": [ 69 | "inputs = load_inputs(inputs_path);" 70 | ] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": {}, 75 | "source": [ 76 | "Scale inputs to improve numerics:" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "metadata": {}, 83 | "outputs": [], 84 | "source": [ 85 | "\n", 86 | "scaling!(inputs)" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "## GENERATE MONOLITHIC MODEL" 94 | ] 95 | }, 96 | { 97 | "cell_type": "code", 98 | "execution_count": null, 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [ 102 | "Expansion_Model = generate_monolithic_model(inputs)" 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "metadata": {}, 108 | "source": [ 109 | "### RUN MODEL" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": null, 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "@time optimize!(Expansion_Model)" 119 | ] 120 | }, 121 | { 122 | "cell_type": "markdown", 123 | "metadata": {}, 124 | "source": [ 125 | "## GENERATE PLANNING MODEL" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "execution_count": null, 131 | "metadata": {}, 132 | "outputs": [], 133 | "source": [ 134 | "planning_model = generate_planning_model(inputs);" 135 | ] 136 | }, 137 | { 138 | "cell_type": "markdown", 139 | "metadata": {}, 140 | "source": [ 141 | "## GENERATE OPERATION MODELS" 142 | ] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": null, 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [ 150 | "operation_models = generate_decomposed_operation_models(inputs);" 151 | ] 152 | }, 153 | { 154 | "cell_type": "code", 155 | "execution_count": null, 156 | "metadata": {}, 157 | "outputs": [], 158 | "source": [ 159 | "@time benders_solution = benders_iterations(100,planning_model,operation_models);" 160 | ] 161 | } 162 | ], 163 | "metadata": { 164 | "@webio": { 165 | "lastCommId": null, 166 | "lastKernelId": null 167 | }, 168 | "kernelspec": { 169 | "display_name": "Julia 1.11.1", 170 | "language": "julia", 171 | "name": "julia-1.11" 172 | }, 173 | "language_info": { 174 | "file_extension": ".jl", 175 | "mimetype": "application/julia", 176 | "name": "julia", 177 | "version": "1.11.1" 178 | } 179 | }, 180 | "nbformat": 4, 181 | "nbformat_minor": 4 182 | } 183 | -------------------------------------------------------------------------------- /Notebooks/Benders-Decomposition.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "In these notes, we consider a simple mixed integer linear program (MILP) and derive a Benders decomposition scheme to solve it." 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": null, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "# Ensure these packages are installed; if not, use the Pkg package and Pkg.add() function to install\n", 17 | "using JuMP\n", 18 | "using HiGHS" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "f = [1, 4];\n", 28 | "c = [2, 3];\n", 29 | "e = [-2; -3];\n", 30 | "A = [1 -3; -1 -3];\n", 31 | "E = [1 -2; -1 -1];" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "metadata": {}, 37 | "source": [ 38 | "The full monolithic model is as follows:" 39 | ] 40 | }, 41 | { 42 | "cell_type": "code", 43 | "execution_count": null, 44 | "metadata": {}, 45 | "outputs": [], 46 | "source": [ 47 | "monolithic_model = Model(HiGHS.Optimizer);\n", 48 | "@variable(monolithic_model, x[1:2] >= 0, Int);\n", 49 | "@variable(monolithic_model, y[1:2] >= 0);\n", 50 | "@constraint(monolithic_model, A*x + E*y .<= e);\n", 51 | "@objective(monolithic_model,Min, f'*x + c'*y);\n", 52 | "latex_formulation(monolithic_model)" 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [ 61 | "optimize!(monolithic_model)" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "value.(monolithic_model[:x])" 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "Because we are considering a small example problem, the solver was able to quickly compute a solution. However, real-life mixed integer linear programs involve tens of thousands of integer decisions, pushing even the best commercial solvers to their computational limits. \n", 78 | "\n", 79 | "Note that if we fix the values of integer variables $x_1$ and $x_2$, we obtain a continuous linear program which can be easily solved. For this reason, Benders decomposition is often implemented to solve MILPs, considering integer decisions as complicating variables. " 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "Let's initialize the master (or planning) problem:" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [ 95 | "master = Model(HiGHS.Optimizer);\n", 96 | "@variable(master, x[1:2] >= 0, Int);\n", 97 | "@variable(master,θ>=-1000) #### Initial lower bound on the operational cost (if operational cost is always positive, this can be set to 0)\n", 98 | "@objective(master,Min, f'*x + θ);\n", 99 | "\n", 100 | "latex_formulation(master)" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "Then, the subproblem is defined including auxiliary variables $z$ that act as local copies of the master variables:" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [ 116 | "subprob = Model(HiGHS.Optimizer);\n", 117 | "@variable(subprob, z[1:2] >= 0);\n", 118 | "@variable(subprob, y[1:2] >= 0);\n", 119 | "@constraint(subprob,A*z + E*y .<= e);\n", 120 | "@objective(subprob, Min, c'*y);\n", 121 | "latex_formulation(subprob)" 122 | ] 123 | }, 124 | { 125 | "cell_type": "markdown", 126 | "metadata": {}, 127 | "source": [ 128 | "The Benders decomposition algorithm, starts from solving the master problem:" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": null, 134 | "metadata": {}, 135 | "outputs": [], 136 | "source": [ 137 | "optimize!(master)" 138 | ] 139 | }, 140 | { 141 | "cell_type": "markdown", 142 | "metadata": {}, 143 | "source": [ 144 | "Using the solution of the master, we define a lower bound to the optimal value of our original MILP:" 145 | ] 146 | }, 147 | { 148 | "cell_type": "code", 149 | "execution_count": null, 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [ 153 | "LB = objective_value(master)" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "and also guesses for the master variables:" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": null, 166 | "metadata": {}, 167 | "outputs": [], 168 | "source": [ 169 | "xk = value.(master[:x])" 170 | ] 171 | }, 172 | { 173 | "cell_type": "markdown", 174 | "metadata": {}, 175 | "source": [ 176 | "We fix these guesses in the subproblem adding the constraints:" 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": null, 182 | "metadata": {}, 183 | "outputs": [], 184 | "source": [ 185 | "fix.(subprob[:z],xk;force=true)\n", 186 | "FixRef.(subprob[:z])" 187 | ] 188 | }, 189 | { 190 | "cell_type": "markdown", 191 | "metadata": {}, 192 | "source": [ 193 | "And solve it:" 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "execution_count": null, 199 | "metadata": {}, 200 | "outputs": [], 201 | "source": [ 202 | "optimize!(subprob)" 203 | ] 204 | }, 205 | { 206 | "cell_type": "markdown", 207 | "metadata": {}, 208 | "source": [ 209 | "We can now compute an upper bound to the optimal value of the original MILP as: " 210 | ] 211 | }, 212 | { 213 | "cell_type": "code", 214 | "execution_count": null, 215 | "metadata": {}, 216 | "outputs": [], 217 | "source": [ 218 | "UB = f'*xk + objective_value(subprob)" 219 | ] 220 | }, 221 | { 222 | "cell_type": "markdown", 223 | "metadata": {}, 224 | "source": [ 225 | "With lower and upper bounds, we can compute the optimality gap, which gives a conserative estimate of the degree of sub-optimality of our current best guess:" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": null, 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "gap = (UB-LB)/abs(UB)" 235 | ] 236 | }, 237 | { 238 | "cell_type": "markdown", 239 | "metadata": {}, 240 | "source": [ 241 | "To improve our guesses, we need to include additional information into the master problem. \n", 242 | "\n", 243 | "Hence, we derive the so called optimality cuts, which are based on the dual solutions associated with the constraints fixing the values of the master variables in the subproblems:" 244 | ] 245 | }, 246 | { 247 | "cell_type": "code", 248 | "execution_count": null, 249 | "metadata": {}, 250 | "outputs": [], 251 | "source": [ 252 | "λ = dual.(FixRef.(subprob[:z]))" 253 | ] 254 | }, 255 | { 256 | "cell_type": "markdown", 257 | "metadata": {}, 258 | "source": [ 259 | "Having only one subproblem, we add one optimality cut per iteration to the master problem, which is given by:" 260 | ] 261 | }, 262 | { 263 | "cell_type": "markdown", 264 | "metadata": {}, 265 | "source": [ 266 | "$$\\theta \\geq f_k + \\lambda^T(x - x_k)$$" 267 | ] 268 | }, 269 | { 270 | "cell_type": "markdown", 271 | "metadata": {}, 272 | "source": [ 273 | "where $f_k$ is the objective value of the subproblem obtained fixing variables $z$ to the value $x_k$." 274 | ] 275 | }, 276 | { 277 | "cell_type": "markdown", 278 | "metadata": {}, 279 | "source": [ 280 | "Update the master problem by implementing the optimality cut above:" 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": null, 286 | "metadata": {}, 287 | "outputs": [], 288 | "source": [] 289 | }, 290 | { 291 | "cell_type": "markdown", 292 | "metadata": {}, 293 | "source": [ 294 | "Then, repeat the above steps until you reach a zero gap. \n", 295 | "\n", 296 | "At each iteration: \n", 297 | "\n", 298 | "- Solve the upadted master problem\n", 299 | "- Fix the values of the master variables in the subproblem\n", 300 | "- Solve the subproblem to obtain an upper bound and compute the gap \n", 301 | "- If it is zero, then you are done! \n", 302 | "- If not zero, compute new optimality gaps and add them to the master problem, then repeat." 303 | ] 304 | }, 305 | { 306 | "cell_type": "markdown", 307 | "metadata": {}, 308 | "source": [ 309 | "Then submit the optimal value you get and the final solution for vector $x$. Report also on how many iterations it took, and write out the cuts computed along the way." 310 | ] 311 | }, 312 | { 313 | "cell_type": "markdown", 314 | "metadata": {}, 315 | "source": [ 316 | "**Bonus**: try to visualize the progression of the Benders algorithm by making a 3d plot of the cuts in $(\\theta, x_1, x_2)$ coordinates. The total objective function value should appear as a surface, while the optimality cuts should be planes. Then illustrate the guesses for $x$ for each iteration by showing points $(\\theta, x_1, x_2)$ on the surface." 317 | ] 318 | }, 319 | { 320 | "cell_type": "markdown", 321 | "metadata": {}, 322 | "source": [] 323 | } 324 | ], 325 | "metadata": { 326 | "kernelspec": { 327 | "display_name": "Julia 1.11.1", 328 | "language": "julia", 329 | "name": "julia-1.11" 330 | }, 331 | "language_info": { 332 | "file_extension": ".jl", 333 | "mimetype": "application/julia", 334 | "name": "julia", 335 | "version": "1.11.1" 336 | } 337 | }, 338 | "nbformat": 4, 339 | "nbformat_minor": 2 340 | } 341 | -------------------------------------------------------------------------------- /Notebooks/anatomy_data/solar_battery_data.csv: -------------------------------------------------------------------------------- 1 | T,Hour,Interval,Price,Solar 2 | 1,1,1,12.77,0 3 | 2,1,2,11.82,0 4 | 3,1,3,12.39,0 5 | 4,1,4,10.17,0 6 | 5,2,1,5.86,0 7 | 6,2,2,2.69,0 8 | 7,2,3,1.46,0 9 | 8,2,4,1.41,0 10 | 9,3,1,0.03,0 11 | 10,3,2,-0.19,0 12 | 11,3,3,-0.72,0 13 | 12,3,4,-0.54,0 14 | 13,4,1,-0.45,0 15 | 14,4,2,-0.60,0 16 | 15,4,3,-0.72,0 17 | 16,4,4,-0.63,0 18 | 17,5,1,-0.72,0 19 | 18,5,2,-1.19,0 20 | 19,5,3,-1.04,0 21 | 20,5,4,-0.76,0 22 | 21,6,1,-0.47,0 23 | 22,6,2,0.68,0 24 | 23,6,3,0.78,0 25 | 24,6,4,0.09,0 26 | 25,7,1,5.51,0 27 | 26,7,2,4.66,0.077 28 | 27,7,3,4.52,0.154 29 | 28,7,4,5.89,0.232 30 | 29,8,1,8.83,0.309 31 | 30,8,2,8.83,7.94 32 | 31,8,3,10.47,15.571 33 | 32,8,4,10.97,23.202 34 | 33,9,1,12.45,30.833 35 | 34,9,2,13.44,33.823 36 | 35,9,3,13.51,36.812 37 | 36,9,4,13.19,39.801 38 | 37,10,1,12.77,42.791 39 | 38,10,2,12.65,44.029 40 | 39,10,3,12.18,45.268 41 | 40,10,4,12.45,46.507 42 | 41,11,1,12.42,47.746 43 | 42,11,2,13.25,48.298 44 | 43,11,3,13.61,48.85 45 | 44,11,4,13.85,49.401 46 | 45,12,1,15.19,49.953 47 | 46,12,2,16.55,49.965 48 | 47,12,3,17.25,49.977 49 | 48,12,4,17.20,49.988 50 | 49,13,1,17.97,50 51 | 50,13,2,17.96,49.778 52 | 51,13,3,17.90,49.556 53 | 52,13,4,18.12,49.335 54 | 53,14,1,18.07,49.113 55 | 54,14,2,18.21,48.549 56 | 55,14,3,18.08,47.985 57 | 56,14,4,18.10,47.422 58 | 57,15,1,17.98,46.858 59 | 58,15,2,18.35,45.588 60 | 59,15,3,18.05,44.319 61 | 60,15,4,18.32,43.049 62 | 61,16,1,17.96,41.779 63 | 62,16,2,18.12,39.388 64 | 63,16,3,18.18,36.996 65 | 64,16,4,17.97,34.604 66 | 65,17,1,18.44,32.213 67 | 66,17,2,18.75,27.218 68 | 67,17,3,17.60,22.223 69 | 68,17,4,18.20,17.228 70 | 69,18,1,19.42,12.233 71 | 70,18,2,20.45,9.175 72 | 71,18,3,35.79,6.116 73 | 72,18,4,37.50,3.058 74 | 73,19,1,71.02,0 75 | 74,19,2,73.86,0 76 | 75,19,3,35.35,0 77 | 76,19,4,31.40,0 78 | 77,20,1,30.89,0 79 | 78,20,2,37.58,0 80 | 79,20,3,77.85,0 81 | 80,20,4,71.52,0 82 | 81,21,1,23.24,0 83 | 82,21,2,15.52,0 84 | 83,21,3,16.63,0 85 | 84,21,4,16.14,0 86 | 85,22,1,16.86,0 87 | 86,22,2,14.43,0 88 | 87,22,3,12.47,0 89 | 88,22,4,13.11,0 90 | 89,23,1,17.61,0 91 | 90,23,2,16.16,0 92 | 91,23,3,15.30,0 93 | 92,23,4,15.18,0 94 | 93,24,1,13.61,0 95 | 94,24,2,11.89,0 96 | 95,24,3,14.23,0 97 | 96,24,4,14.09,0 -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/10_days/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,9 3 | 2,4 4 | 3,3 5 | 4,8 6 | 5,2 7 | 6,3 8 | 7,4 9 | 8,2 10 | 9,9 11 | 10,9 12 | 11,6 13 | 12,9 14 | 13,2 15 | 14,7 16 | 15,6 17 | 16,6 18 | 17,9 19 | 18,2 20 | 19,8 21 | 20,9 22 | 21,2 23 | 22,6 24 | 23,2 25 | 24,9 26 | 25,9 27 | 26,8 28 | 27,3 29 | 28,4 30 | 29,2 31 | 30,3 32 | 31,8 33 | 32,1 34 | 33,2 35 | 34,6 36 | 35,6 37 | 36,9 38 | 37,1 39 | 38,2 40 | 39,4 41 | 40,8 42 | 41,2 43 | 42,9 44 | 43,2 45 | 44,8 46 | 45,5 47 | 46,8 48 | 47,1 49 | 48,4 50 | 49,9 51 | 50,2 52 | 51,3 53 | 52,2 54 | 53,6 55 | 54,6 56 | 55,9 57 | 56,6 58 | 57,3 59 | 58,2 60 | 59,6 61 | 60,6 62 | 61,6 63 | 62,9 64 | 63,4 65 | 64,7 66 | 65,3 67 | 66,6 68 | 67,6 69 | 68,6 70 | 69,9 71 | 70,1 72 | 71,2 73 | 72,7 74 | 73,3 75 | 74,5 76 | 75,5 77 | 76,6 78 | 77,6 79 | 78,6 80 | 79,9 81 | 80,4 82 | 81,8 83 | 82,8 84 | 83,1 85 | 84,7 86 | 85,7 87 | 86,3 88 | 87,5 89 | 88,2 90 | 89,5 91 | 90,7 92 | 91,7 93 | 92,3 94 | 93,5 95 | 94,2 96 | 95,1 97 | 96,1 98 | 97,3 99 | 98,5 100 | 99,1 101 | 100,1 102 | 101,7 103 | 102,7 104 | 103,6 105 | 104,6 106 | 105,6 107 | 106,9 108 | 107,4 109 | 108,7 110 | 109,3 111 | 110,3 112 | 111,8 113 | 112,4 114 | 113,7 115 | 114,7 116 | 115,5 117 | 116,5 118 | 117,5 119 | 118,5 120 | 119,5 121 | 120,5 122 | 121,5 123 | 122,3 124 | 123,3 125 | 124,7 126 | 125,7 127 | 126,5 128 | 127,3 129 | 128,2 130 | 129,1 131 | 130,1 132 | 131,9 133 | 132,1 134 | 133,1 135 | 134,1 136 | 135,1 137 | 136,1 138 | 137,7 139 | 138,7 140 | 139,3 141 | 140,3 142 | 141,1 143 | 142,1 144 | 143,7 145 | 144,6 146 | 145,5 147 | 146,6 148 | 147,6 149 | 148,3 150 | 149,7 151 | 150,7 152 | 151,5 153 | 152,5 154 | 153,7 155 | 154,5 156 | 155,5 157 | 156,7 158 | 157,1 159 | 158,1 160 | 159,1 161 | 160,1 162 | 161,3 163 | 162,5 164 | 163,5 165 | 164,2 166 | 165,7 167 | 166,5 168 | 167,5 169 | 168,1 170 | 169,7 171 | 170,3 172 | 171,6 173 | 172,3 174 | 173,1 175 | 174,7 176 | 175,7 177 | 176,7 178 | 177,10 179 | 178,7 180 | 179,7 181 | 180,7 182 | 181,7 183 | 182,7 184 | 183,2 185 | 184,5 186 | 185,5 187 | 186,5 188 | 187,7 189 | 188,7 190 | 189,1 191 | 190,1 192 | 191,1 193 | 192,1 194 | 193,1 195 | 194,1 196 | 195,1 197 | 196,1 198 | 197,7 199 | 198,7 200 | 199,7 201 | 200,7 202 | 201,7 203 | 202,7 204 | 203,1 205 | 204,1 206 | 205,7 207 | 206,3 208 | 207,3 209 | 208,4 210 | 209,1 211 | 210,7 212 | 211,7 213 | 212,7 214 | 213,7 215 | 214,7 216 | 215,7 217 | 216,7 218 | 217,7 219 | 218,1 220 | 219,7 221 | 220,1 222 | 221,1 223 | 222,1 224 | 223,1 225 | 224,7 226 | 225,7 227 | 226,1 228 | 227,7 229 | 228,5 230 | 229,7 231 | 230,1 232 | 231,1 233 | 232,1 234 | 233,1 235 | 234,1 236 | 235,7 237 | 236,3 238 | 237,7 239 | 238,5 240 | 239,1 241 | 240,1 242 | 241,1 243 | 242,1 244 | 243,1 245 | 244,1 246 | 245,7 247 | 246,7 248 | 247,7 249 | 248,7 250 | 249,7 251 | 250,1 252 | 251,7 253 | 252,8 254 | 253,1 255 | 254,7 256 | 255,3 257 | 256,5 258 | 257,2 259 | 258,1 260 | 259,1 261 | 260,1 262 | 261,1 263 | 262,1 264 | 263,7 265 | 264,7 266 | 265,7 267 | 266,7 268 | 267,7 269 | 268,3 270 | 269,3 271 | 270,5 272 | 271,1 273 | 272,1 274 | 273,9 275 | 274,4 276 | 275,2 277 | 276,1 278 | 277,3 279 | 278,9 280 | 279,2 281 | 280,8 282 | 281,4 283 | 282,2 284 | 283,8 285 | 284,4 286 | 285,2 287 | 286,5 288 | 287,6 289 | 288,8 290 | 289,2 291 | 290,3 292 | 291,9 293 | 292,1 294 | 293,2 295 | 294,5 296 | 295,5 297 | 296,5 298 | 297,3 299 | 298,3 300 | 299,3 301 | 300,9 302 | 301,4 303 | 302,2 304 | 303,7 305 | 304,1 306 | 305,1 307 | 306,7 308 | 307,3 309 | 308,4 310 | 309,1 311 | 310,8 312 | 311,4 313 | 312,1 314 | 313,9 315 | 314,6 316 | 315,6 317 | 316,9 318 | 317,4 319 | 318,4 320 | 319,4 321 | 320,1 322 | 321,4 323 | 322,2 324 | 323,8 325 | 324,1 326 | 325,1 327 | 326,2 328 | 327,8 329 | 328,8 330 | 329,4 331 | 330,8 332 | 331,2 333 | 332,4 334 | 333,1 335 | 334,8 336 | 335,8 337 | 336,8 338 | 337,2 339 | 338,8 340 | 339,8 341 | 340,4 342 | 341,8 343 | 342,4 344 | 343,2 345 | 344,6 346 | 345,4 347 | 346,4 348 | 347,3 349 | 348,3 350 | 349,6 351 | 350,9 352 | 351,8 353 | 352,2 354 | 353,5 355 | 354,6 356 | 355,9 357 | 356,2 358 | 357,9 359 | 358,9 360 | 359,4 361 | 360,6 362 | 361,4 363 | 362,8 364 | 363,4 365 | 364,4 366 | 365,3 367 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/10_days/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/10_days/Load_data.csv: -------------------------------------------------------------------------------- 1 | Voll,Demand_segment,Cost_of_demand_curtailment_perMW,Max_demand_curtailment,$/MWh,Subperiods,Hours_per_period,Sub_Weights,Time_index,Load_MW_z1,Load_MW_z2,Load_MW_z3 2 | 9000.0,1.0,1.0,1.0,9000.0,10.0,24.0,1704.0,1,0.0,48533.0,3326.0 3 | ,2.0,0.067,0.075,603.0,,,840.0,2,0.0,47358.0,3298.0 4 | ,,,,,,,888.0,3,0.0,47219.0,3311.0 5 | ,,,,,,,720.0,4,0.0,47812.0,3363.0 6 | ,,,,,,,864.0,5,0.0,48069.0,3377.0 7 | ,,,,,,,768.0,6,0.0,51247.0,3531.0 8 | ,,,,,,,1656.0,7,0.0,55670.0,3745.0 9 | ,,,,,,,648.0,8,0.0,60008.0,3926.0 10 | ,,,,,,,648.0,9,0.0,63731.0,4120.0 11 | ,,,,,,,24.0,10,0.0,66749.0,4300.0 12 | ,,,,,,,,11,0.0,68622.0,4460.0 13 | ,,,,,,,,12,0.0,68573.0,4586.0 14 | ,,,,,,,,13,0.0,67421.0,4668.0 15 | ,,,,,,,,14,0.0,65777.0,4687.0 16 | ,,,,,,,,15,0.0,64150.0,4622.0 17 | ,,,,,,,,16,0.0,61630.0,4557.0 18 | ,,,,,,,,17,0.0,59297.0,4436.0 19 | ,,,,,,,,18,0.0,58372.0,4332.0 20 | ,,,,,,,,19,0.0,56714.0,4240.0 21 | ,,,,,,,,20,0.0,53526.0,4045.0 22 | ,,,,,,,,21,0.0,49918.0,3843.0 23 | ,,,,,,,,22,0.0,46651.0,3671.0 24 | ,,,,,,,,23,0.0,44257.0,3528.0 25 | ,,,,,,,,24,0.0,42380.0,3426.0 26 | ,,,,,,,,25,0.0,32226.0,2990.0 27 | ,,,,,,,,26,0.0,32524.0,3043.0 28 | ,,,,,,,,27,0.0,33857.0,3144.0 29 | ,,,,,,,,28,0.0,37449.0,3341.0 30 | ,,,,,,,,29,0.0,43532.0,3683.0 31 | ,,,,,,,,30,0.0,45779.0,3825.0 32 | ,,,,,,,,31,0.0,44689.0,3715.0 33 | ,,,,,,,,32,0.0,44291.0,3626.0 34 | ,,,,,,,,33,0.0,44247.0,3535.0 35 | ,,,,,,,,34,0.0,43706.0,3412.0 36 | ,,,,,,,,35,0.0,43000.0,3314.0 37 | ,,,,,,,,36,0.0,42536.0,3263.0 38 | ,,,,,,,,37,0.0,41986.0,3209.0 39 | ,,,,,,,,38,0.0,41578.0,3197.0 40 | ,,,,,,,,39,0.0,41516.0,3217.0 41 | ,,,,,,,,40,0.0,42392.0,3224.0 42 | ,,,,,,,,41,0.0,45874.0,3391.0 43 | ,,,,,,,,42,0.0,46323.0,3485.0 44 | ,,,,,,,,43,0.0,45779.0,3493.0 45 | ,,,,,,,,44,0.0,44180.0,3456.0 46 | ,,,,,,,,45,0.0,41129.0,3321.0 47 | ,,,,,,,,46,0.0,38083.0,3184.0 48 | ,,,,,,,,47,0.0,36146.0,3104.0 49 | ,,,,,,,,48,0.0,35275.0,3083.0 50 | ,,,,,,,,49,0.0,35008.0,2976.0 51 | ,,,,,,,,50,0.0,35430.0,2980.0 52 | ,,,,,,,,51,0.0,37982.0,3051.0 53 | ,,,,,,,,52,0.0,42738.0,3252.0 54 | ,,,,,,,,53,0.0,44270.0,3346.0 55 | ,,,,,,,,54,0.0,45009.0,3327.0 56 | ,,,,,,,,55,0.0,47710.0,3379.0 57 | ,,,,,,,,56,0.0,50708.0,3463.0 58 | ,,,,,,,,57,0.0,53736.0,3557.0 59 | ,,,,,,,,58,0.0,56827.0,3631.0 60 | ,,,,,,,,59,0.0,60000.0,3731.0 61 | ,,,,,,,,60,0.0,62616.0,3822.0 62 | ,,,,,,,,61,0.0,64510.0,3900.0 63 | ,,,,,,,,62,0.0,65538.0,3958.0 64 | ,,,,,,,,63,0.0,64492.0,3913.0 65 | ,,,,,,,,64,0.0,61981.0,3816.0 66 | ,,,,,,,,65,0.0,61829.0,3763.0 67 | ,,,,,,,,66,0.0,60886.0,3774.0 68 | ,,,,,,,,67,0.0,57697.0,3640.0 69 | ,,,,,,,,68,0.0,52707.0,3427.0 70 | ,,,,,,,,69,0.0,47474.0,3212.0 71 | ,,,,,,,,70,0.0,43370.0,3068.0 72 | ,,,,,,,,71,0.0,40618.0,2983.0 73 | ,,,,,,,,72,0.0,39018.0,2927.0 74 | ,,,,,,,,73,0.0,32801.0,3119.0 75 | ,,,,,,,,74,0.0,33025.0,3164.0 76 | ,,,,,,,,75,0.0,33872.0,3217.0 77 | ,,,,,,,,76,0.0,35382.0,3297.0 78 | ,,,,,,,,77,0.0,37212.0,3405.0 79 | ,,,,,,,,78,0.0,38614.0,3466.0 80 | ,,,,,,,,79,0.0,39475.0,3465.0 81 | ,,,,,,,,80,0.0,39261.0,3396.0 82 | ,,,,,,,,81,0.0,38697.0,3330.0 83 | ,,,,,,,,82,0.0,38404.0,3296.0 84 | ,,,,,,,,83,0.0,38041.0,3257.0 85 | ,,,,,,,,84,0.0,37585.0,3224.0 86 | ,,,,,,,,85,0.0,37448.0,3210.0 87 | ,,,,,,,,86,0.0,37516.0,3211.0 88 | ,,,,,,,,87,0.0,37847.0,3216.0 89 | ,,,,,,,,88,0.0,38901.0,3215.0 90 | ,,,,,,,,89,0.0,42082.0,3390.0 91 | ,,,,,,,,90,0.0,41793.0,3402.0 92 | ,,,,,,,,91,0.0,40442.0,3340.0 93 | ,,,,,,,,92,0.0,37887.0,3209.0 94 | ,,,,,,,,93,0.0,35067.0,3080.0 95 | ,,,,,,,,94,0.0,33253.0,3009.0 96 | ,,,,,,,,95,0.0,32499.0,2981.0 97 | ,,,,,,,,96,0.0,32428.0,2979.0 98 | ,,,,,,,,97,0.0,33731.0,2789.0 99 | ,,,,,,,,98,0.0,33785.0,2795.0 100 | ,,,,,,,,99,0.0,35362.0,2860.0 101 | ,,,,,,,,100,0.0,38456.0,2991.0 102 | ,,,,,,,,101,0.0,40565.0,3118.0 103 | ,,,,,,,,102,0.0,41280.0,3156.0 104 | ,,,,,,,,103,0.0,43066.0,3230.0 105 | ,,,,,,,,104,0.0,45109.0,3315.0 106 | ,,,,,,,,105,0.0,46586.0,3358.0 107 | ,,,,,,,,106,0.0,47591.0,3358.0 108 | ,,,,,,,,107,0.0,48624.0,3378.0 109 | ,,,,,,,,108,0.0,49409.0,3388.0 110 | ,,,,,,,,109,0.0,49961.0,3395.0 111 | ,,,,,,,,110,0.0,49820.0,3399.0 112 | ,,,,,,,,111,0.0,48738.0,3332.0 113 | ,,,,,,,,112,0.0,46975.0,3289.0 114 | ,,,,,,,,113,0.0,46915.0,3281.0 115 | ,,,,,,,,114,0.0,47730.0,3373.0 116 | ,,,,,,,,115,0.0,46430.0,3318.0 117 | ,,,,,,,,116,0.0,43999.0,3230.0 118 | ,,,,,,,,117,0.0,40956.0,3090.0 119 | ,,,,,,,,118,0.0,37994.0,2955.0 120 | ,,,,,,,,119,0.0,35832.0,2869.0 121 | ,,,,,,,,120,0.0,34282.0,2807.0 122 | ,,,,,,,,121,0.0,33228.0,2767.0 123 | ,,,,,,,,122,0.0,32671.0,2757.0 124 | ,,,,,,,,123,0.0,32916.0,2773.0 125 | ,,,,,,,,124,0.0,33730.0,2815.0 126 | ,,,,,,,,125,0.0,34840.0,2885.0 127 | ,,,,,,,,126,0.0,35997.0,2928.0 128 | ,,,,,,,,127,0.0,38254.0,3017.0 129 | ,,,,,,,,128,0.0,40193.0,3101.0 130 | ,,,,,,,,129,0.0,41754.0,3170.0 131 | ,,,,,,,,130,0.0,43173.0,3250.0 132 | ,,,,,,,,131,0.0,43961.0,3286.0 133 | ,,,,,,,,132,0.0,44421.0,3309.0 134 | ,,,,,,,,133,0.0,44660.0,3330.0 135 | ,,,,,,,,134,0.0,44798.0,3350.0 136 | ,,,,,,,,135,0.0,44975.0,3386.0 137 | ,,,,,,,,136,0.0,44980.0,3385.0 138 | ,,,,,,,,137,0.0,46341.0,3398.0 139 | ,,,,,,,,138,0.0,47948.0,3493.0 140 | ,,,,,,,,139,0.0,46791.0,3444.0 141 | ,,,,,,,,140,0.0,43976.0,3291.0 142 | ,,,,,,,,141,0.0,40193.0,3045.0 143 | ,,,,,,,,142,0.0,37129.0,2830.0 144 | ,,,,,,,,143,0.0,35164.0,2755.0 145 | ,,,,,,,,144,0.0,34076.0,2715.0 146 | ,,,,,,,,145,0.0,46832.0,3392.0 147 | ,,,,,,,,146,0.0,45655.0,3314.0 148 | ,,,,,,,,147,0.0,45430.0,3286.0 149 | ,,,,,,,,148,0.0,45337.0,3289.0 150 | ,,,,,,,,149,0.0,45886.0,3310.0 151 | ,,,,,,,,150,0.0,49802.0,3517.0 152 | ,,,,,,,,151,0.0,55347.0,3785.0 153 | ,,,,,,,,152,0.0,61323.0,4066.0 154 | ,,,,,,,,153,0.0,66727.0,4391.0 155 | ,,,,,,,,154,0.0,71307.0,4623.0 156 | ,,,,,,,,155,0.0,74578.0,4785.0 157 | ,,,,,,,,156,0.0,76875.0,4914.0 158 | ,,,,,,,,157,0.0,77129.0,4997.0 159 | ,,,,,,,,158,0.0,74525.0,5028.0 160 | ,,,,,,,,159,0.0,71189.0,5025.0 161 | ,,,,,,,,160,0.0,67429.0,4996.0 162 | ,,,,,,,,161,0.0,64402.0,4890.0 163 | ,,,,,,,,162,0.0,62346.0,4699.0 164 | ,,,,,,,,163,0.0,61158.0,4586.0 165 | ,,,,,,,,164,0.0,57635.0,4352.0 166 | ,,,,,,,,165,0.0,53557.0,4102.0 167 | ,,,,,,,,166,0.0,49791.0,3839.0 168 | ,,,,,,,,167,0.0,46685.0,3659.0 169 | ,,,,,,,,168,0.0,44666.0,3528.0 170 | ,,,,,,,,169,0.0,33037.0,2913.0 171 | ,,,,,,,,170,0.0,32278.0,2893.0 172 | ,,,,,,,,171,0.0,31944.0,2895.0 173 | ,,,,,,,,172,0.0,32225.0,2927.0 174 | ,,,,,,,,173,0.0,33091.0,2976.0 175 | ,,,,,,,,174,0.0,33804.0,3037.0 176 | ,,,,,,,,175,0.0,36279.0,3125.0 177 | ,,,,,,,,176,0.0,39175.0,3185.0 178 | ,,,,,,,,177,0.0,41668.0,3240.0 179 | ,,,,,,,,178,0.0,43694.0,3272.0 180 | ,,,,,,,,179,0.0,45513.0,3318.0 181 | ,,,,,,,,180,0.0,46870.0,3357.0 182 | ,,,,,,,,181,0.0,47815.0,3391.0 183 | ,,,,,,,,182,0.0,48148.0,3419.0 184 | ,,,,,,,,183,0.0,47732.0,3416.0 185 | ,,,,,,,,184,0.0,48912.0,3452.0 186 | ,,,,,,,,185,0.0,51358.0,3621.0 187 | ,,,,,,,,186,0.0,50700.0,3620.0 188 | ,,,,,,,,187,0.0,48928.0,3563.0 189 | ,,,,,,,,188,0.0,46643.0,3473.0 190 | ,,,,,,,,189,0.0,42910.0,3309.0 191 | ,,,,,,,,190,0.0,38814.0,3145.0 192 | ,,,,,,,,191,0.0,35644.0,3018.0 193 | ,,,,,,,,192,0.0,33863.0,2948.0 194 | ,,,,,,,,193,0.0,35527.0,3264.0 195 | ,,,,,,,,194,0.0,35485.0,3272.0 196 | ,,,,,,,,195,0.0,35963.0,3306.0 197 | ,,,,,,,,196,0.0,37252.0,3373.0 198 | ,,,,,,,,197,0.0,39054.0,3467.0 199 | ,,,,,,,,198,0.0,41129.0,3579.0 200 | ,,,,,,,,199,0.0,43730.0,3683.0 201 | ,,,,,,,,200,0.0,45771.0,3734.0 202 | ,,,,,,,,201,0.0,46580.0,3704.0 203 | ,,,,,,,,202,0.0,46526.0,3635.0 204 | ,,,,,,,,203,0.0,46197.0,3586.0 205 | ,,,,,,,,204,0.0,45449.0,3543.0 206 | ,,,,,,,,205,0.0,44671.0,3493.0 207 | ,,,,,,,,206,0.0,44122.0,3460.0 208 | ,,,,,,,,207,0.0,43925.0,3463.0 209 | ,,,,,,,,208,0.0,44476.0,3476.0 210 | ,,,,,,,,209,0.0,46983.0,3573.0 211 | ,,,,,,,,210,0.0,47832.0,3659.0 212 | ,,,,,,,,211,0.0,47683.0,3661.0 213 | ,,,,,,,,212,0.0,47858.0,3705.0 214 | ,,,,,,,,213,0.0,45720.0,3582.0 215 | ,,,,,,,,214,0.0,42849.0,3439.0 216 | ,,,,,,,,215,0.0,40874.0,3348.0 217 | ,,,,,,,,216,0.0,40134.0,3307.0 218 | ,,,,,,,,217,0.0,47630.0,3349.0 219 | ,,,,,,,,218,0.0,46887.0,3287.0 220 | ,,,,,,,,219,0.0,47959.0,3302.0 221 | ,,,,,,,,220,0.0,49801.0,3377.0 222 | ,,,,,,,,221,0.0,51932.0,3467.0 223 | ,,,,,,,,222,0.0,56197.0,3679.0 224 | ,,,,,,,,223,0.0,62042.0,3951.0 225 | ,,,,,,,,224,0.0,68850.0,4265.0 226 | ,,,,,,,,225,0.0,75152.0,4619.0 227 | ,,,,,,,,226,0.0,80343.0,4887.0 228 | ,,,,,,,,227,0.0,84553.0,5115.0 229 | ,,,,,,,,228,0.0,87069.0,5297.0 230 | ,,,,,,,,229,0.0,88057.0,5428.0 231 | ,,,,,,,,230,0.0,88086.0,5497.0 232 | ,,,,,,,,231,0.0,87685.0,5447.0 233 | ,,,,,,,,232,0.0,86248.0,5357.0 234 | ,,,,,,,,233,0.0,83180.0,5246.0 235 | ,,,,,,,,234,0.0,80567.0,5064.0 236 | ,,,,,,,,235,0.0,77898.0,4920.0 237 | ,,,,,,,,236,0.0,72185.0,4627.0 238 | ,,,,,,,,237,0.0,65807.0,4276.0 239 | ,,,,,,,,238,0.0,60284.0,3990.0 240 | ,,,,,,,,239,0.0,56387.0,3792.0 241 | ,,,,,,,,240,0.0,53384.0,3641.0 242 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/10_days/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/16_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,8 3 | 2,14 4 | 3,9 5 | 4,8 6 | 5,7 7 | 6,8 8 | 7,15 9 | 8,10 10 | 9,13 11 | 10,13 12 | 11,1 13 | 12,3 14 | 13,3 15 | 14,3 16 | 15,1 17 | 16,11 18 | 17,1 19 | 18,3 20 | 19,15 21 | 20,2 22 | 21,1 23 | 22,6 24 | 23,5 25 | 24,3 26 | 25,3 27 | 26,16 28 | 27,3 29 | 28,5 30 | 29,6 31 | 30,6 32 | 31,6 33 | 32,5 34 | 33,6 35 | 34,2 36 | 35,5 37 | 36,6 38 | 37,6 39 | 38,2 40 | 39,6 41 | 40,2 42 | 41,7 43 | 42,6 44 | 43,11 45 | 44,2 46 | 45,7 47 | 46,4 48 | 47,15 49 | 48,15 50 | 49,15 51 | 50,12 52 | 51,14 53 | 52,8 54 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/16_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/16_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/4_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,3 3 | 2,3 4 | 3,3 5 | 4,3 6 | 5,3 7 | 6,3 8 | 7,3 9 | 8,1 10 | 9,1 11 | 10,1 12 | 11,1 13 | 12,3 14 | 13,2 15 | 14,3 16 | 15,1 17 | 16,3 18 | 17,1 19 | 18,2 20 | 19,3 21 | 20,2 22 | 21,1 23 | 22,2 24 | 23,2 25 | 24,2 26 | 25,2 27 | 26,4 28 | 27,2 29 | 28,2 30 | 29,2 31 | 30,2 32 | 31,2 33 | 32,2 34 | 33,2 35 | 34,2 36 | 35,2 37 | 36,2 38 | 37,2 39 | 38,2 40 | 39,2 41 | 40,2 42 | 41,3 43 | 42,2 44 | 43,3 45 | 44,2 46 | 45,3 47 | 46,3 48 | 47,3 49 | 48,3 50 | 49,3 51 | 50,3 52 | 51,1 53 | 52,3 54 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/4_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/4_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/52_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/52_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/8_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,6 3 | 2,3 4 | 3,7 5 | 4,6 6 | 5,2 7 | 6,6 8 | 7,5 9 | 8,4 10 | 9,4 11 | 10,4 12 | 11,4 13 | 12,7 14 | 13,3 15 | 14,7 16 | 15,2 17 | 16,7 18 | 17,4 19 | 18,7 20 | 19,5 21 | 20,1 22 | 21,4 23 | 22,3 24 | 23,1 25 | 24,7 26 | 25,3 27 | 26,8 28 | 27,3 29 | 28,1 30 | 29,3 31 | 30,3 32 | 31,3 33 | 32,1 34 | 33,3 35 | 34,1 36 | 35,1 37 | 36,3 38 | 37,3 39 | 38,1 40 | 39,3 41 | 40,3 42 | 41,2 43 | 42,3 44 | 43,7 45 | 44,2 46 | 45,2 47 | 46,5 48 | 47,5 49 | 48,5 50 | 49,5 51 | 50,7 52 | 51,4 53 | 52,6 54 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/8_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Notebooks/complex_expansion_data/8_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Notebooks/ed_data/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu 2 | None,0,0 3 | pacific_naturalgas,2.57,0.05306 4 | pacific_naturalgas_ccs90,3.04,0.00531 5 | pacific_naturalgas_ccs100,3.1,0 -------------------------------------------------------------------------------- /Notebooks/ed_data/Generators_data.csv: -------------------------------------------------------------------------------- 1 | R_ID,Resource,region,Existing_Cap_MW,num_units,Cap_size,Var_OM_cost_per_MWh,Var_OM_cost_per_MWh_in,Fuel,Heat_rate_MMBTU_per_MWh,heat_rate_mmbtu_mwh_iqr,heat_rate_mmbtu_mwh_std,Min_power,Ramp_Up_percentage,Ramp_Dn_percentage,Start_cost_per_MW,Start_fuel_MMBTU_per_MW,Up_time,Down_time,Self_disch,Eff_up,Eff_down,Ratio_power_to_energy,Min_Duration,Max_Duration,cluster,zone,voltage_level,CapRes,THERM,DISP,NDISP,STOR,DR,HEAT,NACC,TRADER,HYDRO,RPS,CES,Commit,Min_Share,Max_Share,Existing_Cap_MWh,unmodified_existing_cap_mw,New_Build,Min_Cap_MW,Max_Cap_MW,Min_Share_percent,Max_Share_percent,capex,Inv_cost_per_MWyr,Fixed_OM_cost_per_MWyr,capex_mwh,Inv_cost_per_MWhyr,Fixed_OM_cost_per_MWhyr,NACC_Eff,NACC_Peak_to_Base,Reg_Up,Reg_Dn,Rsv_Up,Rsv_Dn,Reg_Cost,Rsv_Cost,spur_miles,spur_capex,offshore_spur_miles,offshore_spur_capex,tx_miles,tx_capex,interconnect_annuity,Max_DSM_delay 2 | 1,biomass,WEC_SDGE,21.4,20,1.07,5.234,0,None,12.76,1.471,4.147,0.71,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,32.8,-1,0,0,0,0,0,0,111708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3 | 2,hydroelectric_pumped_storage,WEC_SDGE,42,2,21,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.866,0.866,0.0063,0,0,1,1,trans,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,42,1,0,0,0,0,0,0,38460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 4 | 3,natural_gas_fired_combined_cycle,WEC_SDGE,607.1,1,607.1,3.4,0,pacific_naturalgas,7.52,0,0,0.362,0.4,0.4,87,2,6,6,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,607.1,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 5 | 4,natural_gas_fired_combined_cycle,WEC_SDGE,30,1,30,4.3,0,pacific_naturalgas,10.05,0,0,0.55,0.4,0.4,87,2,6,6,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,30,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 6 | 5,natural_gas_fired_combined_cycle,WEC_SDGE,49.4,1,49.4,4.3,0,pacific_naturalgas,9.73,0,0,0.5,0.4,0.4,87,2,6,6,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.4,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 7 | 6,natural_gas_fired_combined_cycle,WEC_SDGE,570,1,570,3.4,0,pacific_naturalgas,7.15,0,0,0.351,0.4,0.4,87,2,6,6,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,570,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8 | 7,natural_gas_fired_combined_cycle,WEC_SDGE,336,3,112,10.8,0,pacific_naturalgas,10.03,0,0,0.446,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 9 | 8,natural_gas_fired_combined_cycle,WEC_SDGE,336,3,112,10.8,0,pacific_naturalgas,10.1,0,0,0.446,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,6,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 10 | 9,natural_gas_fired_combustion_turbine,WEC_SDGE,91.6,2,45.8,10.8,0,pacific_naturalgas,10.69,0,0,0.8,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,91.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 11 | 10,natural_gas_fired_combustion_turbine,WEC_SDGE,49.9,1,49.9,10.8,0,pacific_naturalgas,10.48,0,0,0.487,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 12 | 11,natural_gas_fired_combustion_turbine,WEC_SDGE,48.1,1,48.1,10.8,0,pacific_naturalgas,11.04,0,0,0.437,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.1,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 13 | 12,natural_gas_fired_combustion_turbine,WEC_SDGE,34.6,1,34.6,10.8,0,pacific_naturalgas,16.86,0,0,0.954,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,34.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 14 | 13,natural_gas_fired_combustion_turbine,WEC_SDGE,96.6,3,32.2,10.8,0,pacific_naturalgas,10.5,0,0,0.932,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,96.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 15 | 14,natural_gas_fired_combustion_turbine,WEC_SDGE,4.8,1,4.8,10.8,0,pacific_naturalgas,12.13,0,0,0.583,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,6,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4.8,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 16 | 15,natural_gas_fired_combustion_turbine,WEC_SDGE,17.3,2,8.65,10.8,0,pacific_naturalgas,13.57,0,0,0.809,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,7,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,17.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 17 | 16,natural_gas_fired_combustion_turbine,WEC_SDGE,48.7,1,48.7,10.8,0,pacific_naturalgas,11.46,0,0,0.329,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,8,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.7,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 18 | 17,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,11.15,0,0,0,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,9,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 19 | 18,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,11.2,0,0,0,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,10,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 20 | 19,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.22,0,0,0.654,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,11,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 21 | 20,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.3,0,0,0.654,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,12,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 22 | 21,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.08,0,0,0.409,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,13,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 23 | 22,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.12,0,0,0.409,3.78,3.78,113,3.5,1,1,0,1,1,1,0,0,14,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24 | 23,onshore_wind_turbine,WEC_SDGE,217.6,3,64.67,0,0,None,9.12,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,194.001,0,0,0,0,0,0,0,43205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25 | 24,small_hydroelectric,WEC_SDGE,7.32,6,1.22,0,0,None,9.12,0.002,0.001,0.385,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,13.5,-1,0,0,0,0,0,0,44560,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 26 | 25,solar_photovoltaic,WEC_SDGE,500,20,8.48,0,0,None,9.16,0,0.021,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,169.6,0,0,0,0,0,0,0,17943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 27 | 26,naturalgas_ccccsavgcf,WEC_SDGE,0,0,500,7.2,0,pacific_naturalgas_ccs90,7.52,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,2215517.785,229065,33620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 28 | 27,naturalgas_ccavgcf,WEC_SDGE,0,0,500,2,0,pacific_naturalgas,6.28,0,0,0.2,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,804772.856,114863,10032,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 29 | 28,naturalgas_ctavgcf,WEC_SDGE,0,0,100,10.8,0,pacific_naturalgas,9.35,0,0,0.3,3.78,3.78,123,3.5,1,1,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,699302.872,90151,6848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 30 | 29,battery,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.92,0.92,1,1,10,0,1,trans,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,-1,0,0,578000,74501,14450,177000,22814,4425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 31 | 30,naturalgas_ccs100,WEC_SDGE,0,0,500,7.7,0,pacific_naturalgas_ccs100,7.88,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,-1,0,0,2331517.785,241058,43290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 32 | 31,landbasedwind_ltrg1,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1401.08,0,0,1539971.684,288081.069,42496,0,0,0,0,0,0,0,0,0,0,0,21.732,190698.767,0,0,13.194,40075.854,17627.069,0 33 | 32,landbasedwind_ltrg1,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,2,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,391.319,0,0,1539971.684,288189.734,42496,0,0,0,0,0,0,0,0,0,0,0,12.474,109463.738,0,0,40.406,122733.529,17735.734,0 34 | 33,utilitypv_losangeles,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,3828.575,0,0,1072583.692,130391.362,16536,0,0,0,0,0,0,0,0,0,0,0,8.598,75444.817,0,0,2.891,8781.109,6433.362,0 35 | 34,utilitypv_losangeles,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,2,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,6262.648,0,0,1072583.692,135738.331,16536,0,0,0,0,0,0,0,0,0,0,0,13.09,114863.841,0,0,12.96,39364.821,11780.331,0 -------------------------------------------------------------------------------- /Notebooks/expansion_data/generators_for_expansion.csv: -------------------------------------------------------------------------------- 1 | G,Description,Capex,FixedOM,VarOM,HeatRate,FuelCost,WACC,AssetLife,CRF,Annuity,FixedCost,VarCost 2 | Geo,Geothermal,7500000,130000,0,28.4,0,0.04,30,0.0578,433500,563500,0 3 | Coal,Supercritical Coal,2600000,120000,8,8.1,2,0.04,30,0.0578,150280,270280,24.2 4 | CCGT,Natural gas CCGT,1000000,28000,2,6.4,4,0.035,30,0.0544,54400,82400,27.6 5 | CT,Natural gas CT,770000,21000,5,9.7,4,0.035,30,0.0544,41888,62888,43.8 6 | Wind,Onshore wind,1000000,40000,0,1,0,0.03,30,0.051,51000,91000,0 7 | Solar,Tracking solar PV,750000,15000,0,1,0,0.025,30,0.0478,35850,50850,0 -------------------------------------------------------------------------------- /Notebooks/extra_labs/Lab 1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/extra_labs/Lab 1.pdf -------------------------------------------------------------------------------- /Notebooks/extra_labs/Lab1.jl: -------------------------------------------------------------------------------- 1 | using Gurobi 2 | include("Lab1_code.jl") 3 | 4 | # REPLACE THIS WITH YOUR PATH TO INPUT DATA: 5 | inputs_directory = "/Users/gabrielmantegna/Documents/GitHub/power-systems-optimization/Notebooks/complex_expansion_data" 6 | inputs_path = joinpath(inputs_directory, "10_days") 7 | 8 | # REPLACE THIS WITH YOUR PATH TO WHERE YOU WANT TO OUTPUT DATA: 9 | outputs_directory = "/Users/gabrielmantegna/Documents/GitHub/power-systems-optimization/Notebooks/Lab1_results" 10 | if !(isdir(outputs_directory)) 11 | mkdir(outputs_directory) 12 | end 13 | 14 | ### STANDARD MODEL ########### 15 | 16 | # load inputs 17 | (generators, G) = load_input_generator(inputs_path) 18 | (demand, nse, sample_weight, hours_per_period, P, S, W, T, Z) = load_input_demand(inputs_path) 19 | variability = load_input_variability(inputs_path) 20 | (lines, L) = load_input_network(inputs_path); 21 | 22 | # solve model 23 | (generator_results, 24 | storage_results, 25 | transmission_results, 26 | nse_results, 27 | cost_results, 28 | time_10_days) = solve_cap_expansion(generators, G, 29 | demand, S, T, Z, 30 | nse, 31 | sample_weight, hours_per_period, 32 | lines, L, 33 | variability, Gurobi.Optimizer) 34 | 35 | # report time 36 | time_10_days = round(time_10_days, digits = 2) 37 | "Time elapsed to solve with 10 sample days: $time_10_days seconds" 38 | 39 | # write results 40 | write_results(generator_results, 41 | storage_results, 42 | transmission_results, 43 | nse_results, 44 | cost_results, 45 | time_10_days, 46 | joinpath(outputs_directory, "10_days_Solution")) 47 | 48 | #################### 49 | 50 | #### MODEL WITH UNIT COMMITMENT ##### 51 | 52 | # # solve model with UC 53 | # (generator_results, 54 | # storage_results, 55 | # transmission_results, 56 | # nse_results, 57 | # cost_results, 58 | # time_10_days_UC) = solve_cap_expansion_uc(generators, G, 59 | # demand, S, T, Z, 60 | # nse, 61 | # sample_weight, hours_per_period, 62 | # lines, L, 63 | # variability, Gurobi.Optimizer, 0.01) 64 | 65 | # # report time 66 | # time_10_days_UC = round(time_10_days_UC, digits = 2) 67 | # "Time elapsed to solve with 10 sample days: $time_10_days_UC seconds" 68 | 69 | # # write results 70 | # write_results(generator_results, 71 | # storage_results, 72 | # transmission_results, 73 | # nse_results, 74 | # cost_results, 75 | # time_10_days_UC, 76 | # joinpath(outputs_directory, "10_days_Solution_UC")) 77 | 78 | ######### -------------------------------------------------------------------------------- /Notebooks/extra_labs/Lab2_data/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu 2 | None,0,0 3 | pacific_naturalgas,2.57,0.05306 -------------------------------------------------------------------------------- /Notebooks/extra_labs/Lab2_data/Generators_data.csv: -------------------------------------------------------------------------------- 1 | R_ID,Resource,region,Existing_Cap_MW,num_units,Cap_size,Var_OM_cost_per_MWh,Var_OM_cost_per_MWh_in,Fuel,Heat_rate_MMBTU_per_MWh,heat_rate_mmbtu_mwh_iqr,heat_rate_mmbtu_mwh_std,Min_power,Ramp_Up_percentage,Ramp_Dn_percentage,Start_cost_per_MW,Start_fuel_MMBTU_per_MW,Up_time,Down_time,Self_disch,Eff_up,Eff_down,Ratio_power_to_energy,Min_Duration,Max_Duration,cluster,zone,voltage_level,CapRes,THERM,DISP,NDISP,STOR,DR,HEAT,NACC,TRADER,HYDRO,RPS,CES,Commit,Min_Share,Max_Share,Existing_Cap_MWh,unmodified_existing_cap_mw,New_Build,Min_Cap_MW,Max_Cap_MW,Min_Share_percent,Max_Share_percent,capex,Inv_cost_per_MWyr,Fixed_OM_cost_per_MWyr,capex_mwh,Inv_cost_per_MWhyr,Fixed_OM_cost_per_MWhyr,NACC_Eff,NACC_Peak_to_Base,Reg_Up,Reg_Dn,Rsv_Up,Rsv_Dn,Reg_Cost,Rsv_Cost,spur_miles,spur_capex,offshore_spur_miles,offshore_spur_capex,tx_miles,tx_capex,interconnect_annuity,Max_DSM_delay 2 | 1,biomass,WEC_SDGE,21.4,20,1.07,5.234,0,None,12.76,1.471,4.147,0.71,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,32.8,-1,0,0,0,0,0,0,111708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3 | 2,hydroelectric_pumped_storage,WEC_SDGE,42,2,21,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.866,0.866,0.0063,0,0,1,1,trans,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,42,1,0,0,0,0,0,0,38460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 4 | 3,natural_gas_fired_combined_cycle,WEC_SDGE,607.1,1,607.1,3.4,0,pacific_naturalgas,7.52,0,0,0.362,0.4,0.4,80,2,6,6,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,607.1,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 5 | 4,natural_gas_fired_combined_cycle,WEC_SDGE,100,1,30,4.3,0,pacific_naturalgas,7.5,0,0,0.55,0.4,0.4,80,2,6,6,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,30,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 6 | 5,natural_gas_fired_combined_cycle,WEC_SDGE,100,1,49.4,4.3,0,pacific_naturalgas,7.5,0,0,0.5,0.4,0.4,80,2,6,6,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.4,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 7 | 6,natural_gas_fired_combined_cycle,WEC_SDGE,1000,1,570,3.4,0,pacific_naturalgas,7.15,0,0,0.351,0.4,0.4,80,2,6,6,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,570,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8 | 7,natural_gas_fired_combined_cycle,WEC_SDGE,500,3,112,10.8,0,pacific_naturalgas,8,0,0,0.446,3.78,3.78,80,3.5,6,6,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 9 | 8,natural_gas_fired_combined_cycle,WEC_SDGE,500,3,112,10.8,0,pacific_naturalgas,8.1,0,0,0.446,3.78,3.78,80,3.5,6,6,0,1,1,1,0,0,6,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 10 | 9,natural_gas_fired_combustion_turbine,WEC_SDGE,500,2,45.8,10.8,0,pacific_naturalgas,10.69,0,0,0.8,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,91.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 11 | 10,natural_gas_fired_combustion_turbine,WEC_SDGE,49.9,1,49.9,10.8,0,pacific_naturalgas,10.48,0,0,0.487,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 12 | 11,natural_gas_fired_combustion_turbine,WEC_SDGE,48.1,1,48.1,10.8,0,pacific_naturalgas,11.04,0,0,0.437,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.1,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 13 | 12,natural_gas_fired_combustion_turbine,WEC_SDGE,34.6,1,34.6,10.8,0,pacific_naturalgas,16.86,0,0,0.954,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,34.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 14 | 13,natural_gas_fired_combustion_turbine,WEC_SDGE,96.6,3,32.2,10.8,0,pacific_naturalgas,10.5,0,0,0.932,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,96.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 15 | 20,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.3,0,0,0.654,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,12,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 16 | 21,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.08,0,0,0.409,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,13,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 17 | 22,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.12,0,0,0.409,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,14,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 18 | 23,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.329,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,15,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 19 | 24,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.33,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,16,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 20 | 25,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.34,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,17,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 21 | 26,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.35,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,18,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 22 | 27,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.36,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,19,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 23 | 28,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.37,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,20,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24 | 29,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.65,0,0,0.38,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,21,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25 | 30,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.65,0,0,0.39,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,22,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 26 | 31,onshore_wind_turbine,WEC_SDGE,217.6,3,64.67,0,0,None,9.12,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,194.001,0,0,0,0,0,0,0,43205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 27 | 32,small_hydroelectric,WEC_SDGE,7.32,6,1.22,0,0,None,9.12,0.002,0.001,0.385,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,13.5,-1,0,0,0,0,0,0,44560,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 28 | 33,solar_photovoltaic,WEC_SDGE,500,20,8.48,0,0,None,9.16,0,0.021,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,169.6,0,0,0,0,0,0,0,17943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -------------------------------------------------------------------------------- /Notebooks/ieee_test_cases/Gen14.csv: -------------------------------------------------------------------------------- 1 | connnode,c2,c1,c0,PgMax,PgMin,RgMax,RgMin,PgPrev 2 | "1 ","0.0430293 ",20,0,300,0,100,-100,161.62 3 | "2 ",0.25,25,0,140,0,100,-100,97.47 -------------------------------------------------------------------------------- /Notebooks/ieee_test_cases/IEEE14BusTestSystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/ieee_test_cases/IEEE14BusTestSystem.png -------------------------------------------------------------------------------- /Notebooks/ieee_test_cases/Load14.csv: -------------------------------------------------------------------------------- 1 | ConnNode Interval-1_Load Interval-2_Load 2 | 2 -21.7 -16.7 3 | 3 -94.2 -89.2 4 | 4 -47.8 -42.8 5 | 5 -7.6 -2.6 6 | 6 -11.2 -6.2 7 | 9 -29.5 -24.5 8 | 10 -9 -4 9 | 11 -3.5 -1.5 10 | 12 -6.1 -1.1 11 | 13 -13.5 -8.5 12 | 14 -14.9 -9.9 13 | -------------------------------------------------------------------------------- /Notebooks/ieee_test_cases/Tran14.csv: -------------------------------------------------------------------------------- 1 | fromNode toNode Resistance Reactance ContingencyMarked Capacity 2 | 1 2 0.01938 0.05917 1 10000 3 | 1 5 0.05403 0.22304 1 10000 4 | 2 3 0.04699 0.19797 1 10000 5 | 2 4 0.05811 0.17632 1 10000 6 | 2 5 0.05695 0.17388 1 10000 7 | 3 4 0.06701 0.17103 1 10000 8 | 4 5 0.01335 0.04211 1 10000 9 | 4 7 0 0.20912 1 10000 10 | 4 9 0 0.55618 1 10000 11 | 5 6 0 0.25202 1 10000 12 | 6 11 0.09498 0.1989 1 10000 13 | 6 12 0.12291 0.25581 1 10000 14 | 6 13 0.06615 0.13027 1 10000 15 | 7 8 0 0.17615 1 10000 16 | 7 9 0 0.11001 1 10000 17 | 9 10 0.03181 0.0845 1 10000 18 | 9 14 0.12711 0.27038 1 10000 19 | 10 11 0.08205 0.19207 1 10000 20 | 12 13 0.22092 0.19988 1 10000 21 | 13 14 0.17093 0.34802 1 10000 22 | -------------------------------------------------------------------------------- /Notebooks/ieee_test_cases/Tran14_b.csv: -------------------------------------------------------------------------------- 1 | fromnode,tonode,resistance,reactance,contingencymarked,capacity,id,b 2 | 1,2,0.01938,0.05917,1,10000,1,0.0528 3 | 1,5,0.05403,0.22304,1,10000,2,0.0492 4 | 2,3,0.04699,0.19797,1,10000,3,0.0438 5 | 2,4,0.05811,0.17632,1,10000,4,0.034 6 | 2,5,0.05695,0.17388,1,10000,5,0.0346 7 | 3,4,0.06701,0.17103,1,10000,6,0.0128 8 | 4,5,0.01335,0.04211,1,10000,7,0 9 | 4,7,0,0.20912,1,10000,8,0 10 | 4,9,0,0.55618,1,10000,9,0 11 | 5,6,0,0.25202,1,10000,10,0 12 | 6,11,0.09498,0.1989,1,10000,11,0 13 | 6,12,0.12291,0.25581,1,10000,12,0 14 | 6,13,0.06615,0.13027,1,10000,13,0 15 | 7,8,0,0.17615,1,10000,14,0 16 | 7,9,0,0.11001,1,10000,15,0 17 | 9,10,0.03181,0.0845,1,10000,16,0 18 | 9,14,0.12711,0.27038,1,10000,17,0 19 | 10,11,0.08205,0.19207,1,10000,18,0 20 | 12,13,0.22092,0.19988,1,10000,19,0 21 | 13,14,0.17093,0.34802,1,10000,20,0 -------------------------------------------------------------------------------- /Notebooks/img/brownfield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/brownfield.png -------------------------------------------------------------------------------- /Notebooks/img/dimensionality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/dimensionality.png -------------------------------------------------------------------------------- /Notebooks/img/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/factory.png -------------------------------------------------------------------------------- /Notebooks/img/jump_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/jump_logo.png -------------------------------------------------------------------------------- /Notebooks/img/net_demand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/net_demand.png -------------------------------------------------------------------------------- /Notebooks/img/opf_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/opf_network.png -------------------------------------------------------------------------------- /Notebooks/img/phase_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/phase_shift.png -------------------------------------------------------------------------------- /Notebooks/img/renewables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/renewables.png -------------------------------------------------------------------------------- /Notebooks/img/reserves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/reserves.png -------------------------------------------------------------------------------- /Notebooks/img/reserves_taxonomy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/reserves_taxonomy.png -------------------------------------------------------------------------------- /Notebooks/img/solar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/solar.png -------------------------------------------------------------------------------- /Notebooks/img/thermal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Notebooks/img/thermal.png -------------------------------------------------------------------------------- /Notebooks/opf_data/branch.csv: -------------------------------------------------------------------------------- 1 | fbus,tbus,r,x,b,rateA,rateB,rateC,ratio,angle,status,angmin,angmax 2 | 1,3,0.00281,0.0281,0.00712,500,500,500,0,0,1,-360,360 3 | 1,2,0.00281,0.0281,0.00712,500,500,500,0,0,1,-360,360 4 | 2,3,0.00281,0.0281,0.00712,500,500,500,0,0,1,-360,360 -------------------------------------------------------------------------------- /Notebooks/opf_data/bus.csv: -------------------------------------------------------------------------------- 1 | bus_i,type,Pd,Qd,Gs,Bs,area,Vm,Va,baseKV,zone,Vmax,Vmin 2 | 1,2,0,0,0,0,1,1,0,230,1,1.1,0.9 3 | 2,2,0,0,0,0,1,1,0,230,1,1.1,0.9 4 | 3,1,600,98.61,0,0,1,1,0,230,1,1.1,0.9 -------------------------------------------------------------------------------- /Notebooks/opf_data/gen.csv: -------------------------------------------------------------------------------- 1 | bus,Pg,Qg,Qmax,Qmin,Vg,mBase,status,Pmax,Pmin,Pc1,Pc2,Qc1min,Qc1max,Qc2min,Qc2max,ramp_agc,ramp_10,ramp_30,ramp_q,apf 2 | 1,40,0,30,-30,1,100,1,1000,0,0,0,0,0,0,0,0,0,0,0,0 3 | 2,170,0,127.5,-127.5,1,100,1,1000,0,0,0,0,0,0,0,0,0,0,0,0 -------------------------------------------------------------------------------- /Notebooks/opf_data/gencost.csv: -------------------------------------------------------------------------------- 1 | model,startup,shutdown,n,x1,y1 2 | 2,0,0,2,50,0 3 | 2,0,0,2,100,0 -------------------------------------------------------------------------------- /Notebooks/uc_data/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu 2 | None,0,0 3 | pacific_naturalgas,2.57,0.05306 4 | pacific_naturalgas_ccs90,3.04,0.00531 5 | pacific_naturalgas_ccs100,3.1,0 -------------------------------------------------------------------------------- /Notebooks/uc_data/Generators_data.csv: -------------------------------------------------------------------------------- 1 | R_ID,Resource,region,Existing_Cap_MW,num_units,Cap_size,Var_OM_cost_per_MWh,Var_OM_cost_per_MWh_in,Fuel,Heat_rate_MMBTU_per_MWh,heat_rate_mmbtu_mwh_iqr,heat_rate_mmbtu_mwh_std,Min_power,Ramp_Up_percentage,Ramp_Dn_percentage,Start_cost_per_MW,Start_fuel_MMBTU_per_MW,Up_time,Down_time,Self_disch,Eff_up,Eff_down,Ratio_power_to_energy,Min_Duration,Max_Duration,cluster,zone,voltage_level,CapRes,THERM,DISP,NDISP,STOR,DR,HEAT,NACC,TRADER,HYDRO,RPS,CES,Commit,Min_Share,Max_Share,Existing_Cap_MWh,unmodified_existing_cap_mw,New_Build,Min_Cap_MW,Max_Cap_MW,Min_Share_percent,Max_Share_percent,capex,Inv_cost_per_MWyr,Fixed_OM_cost_per_MWyr,capex_mwh,Inv_cost_per_MWhyr,Fixed_OM_cost_per_MWhyr,NACC_Eff,NACC_Peak_to_Base,Reg_Up,Reg_Dn,Rsv_Up,Rsv_Dn,Reg_Cost,Rsv_Cost,spur_miles,spur_capex,offshore_spur_miles,offshore_spur_capex,tx_miles,tx_capex,interconnect_annuity,Max_DSM_delay 2 | 1,biomass,WEC_SDGE,21.4,20,1.07,5.234,0,None,12.76,1.471,4.147,0.71,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,1,0,1,0,0,0,0,0,0,1,1,1,0,0,0,32.8,-1,0,0,0,0,0,0,111708,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 3 | 2,hydroelectric_pumped_storage,WEC_SDGE,42,2,21,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.866,0.866,0.0063,0,0,1,1,trans,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,42,1,0,0,0,0,0,0,38460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 4 | 3,natural_gas_fired_combined_cycle,WEC_SDGE,607.1,1,607.1,3.4,0,pacific_naturalgas,7.52,0,0,0.362,0.4,0.4,80,2,6,6,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,607.1,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 5 | 4,natural_gas_fired_combined_cycle,WEC_SDGE,30,1,30,4.3,0,pacific_naturalgas,7.5,0,0,0.55,0.4,0.4,80,2,6,6,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,30,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 6 | 5,natural_gas_fired_combined_cycle,WEC_SDGE,49.4,1,49.4,4.3,0,pacific_naturalgas,7.5,0,0,0.5,0.4,0.4,80,2,6,6,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.4,1,0,0,0,0,0,0,15620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 7 | 6,natural_gas_fired_combined_cycle,WEC_SDGE,570,1,570,3.4,0,pacific_naturalgas,7.15,0,0,0.351,0.4,0.4,80,2,6,6,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,570,1,0,0,0,0,0,0,9270,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 8 | 7,natural_gas_fired_combined_cycle,WEC_SDGE,336,3,112,10.8,0,pacific_naturalgas,8,0,0,0.446,3.78,3.78,80,3.5,6,6,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 9 | 8,natural_gas_fired_combined_cycle,WEC_SDGE,336,3,112,10.8,0,pacific_naturalgas,8.1,0,0,0.446,3.78,3.78,80,3.5,6,6,0,1,1,1,0,0,6,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,336,1,0,0,0,0,0,0,7162,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 10 | 9,natural_gas_fired_combustion_turbine,WEC_SDGE,91.6,2,45.8,10.8,0,pacific_naturalgas,10.69,0,0,0.8,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,1,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,91.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 11 | 10,natural_gas_fired_combustion_turbine,WEC_SDGE,49.9,1,49.9,10.8,0,pacific_naturalgas,10.48,0,0,0.487,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,2,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,49.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 12 | 11,natural_gas_fired_combustion_turbine,WEC_SDGE,48.1,1,48.1,10.8,0,pacific_naturalgas,11.04,0,0,0.437,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,3,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.1,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 13 | 12,natural_gas_fired_combustion_turbine,WEC_SDGE,34.6,1,34.6,10.8,0,pacific_naturalgas,16.86,0,0,0.954,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,4,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,34.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 14 | 13,natural_gas_fired_combustion_turbine,WEC_SDGE,96.6,3,32.2,10.8,0,pacific_naturalgas,10.5,0,0,0.932,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,5,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,96.6,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 15 | 20,natural_gas_fired_combustion_turbine,WEC_SDGE,48.9,1,48.9,10.8,0,pacific_naturalgas,11.3,0,0,0.654,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,12,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,48.9,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 16 | 21,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.08,0,0,0.409,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,13,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 17 | 22,natural_gas_fired_combustion_turbine,WEC_SDGE,51.3,1,51.3,10.8,0,pacific_naturalgas,11.12,0,0,0.409,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,14,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,51.3,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 18 | 23,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.329,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,15,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 19 | 24,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.33,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,16,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 20 | 25,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.55,0,0,0.34,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,17,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 21 | 26,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.35,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,18,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 22 | 27,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.36,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,19,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 23 | 28,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.6,0,0,0.37,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,20,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 24 | 29,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.65,0,0,0.38,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,21,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 25 | 30,natural_gas_fired_combustion_turbine,WEC_SDGE,98.2,2,49.1,10.8,0,pacific_naturalgas,10.65,0,0,0.39,3.78,3.78,40,3.5,1,1,0,1,1,1,0,0,22,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,98.2,1,0,0,0,0,0,0,11182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 26 | 31,onshore_wind_turbine,WEC_SDGE,217.6,3,64.67,0,0,None,9.12,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,194.001,0,0,0,0,0,0,0,43205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 27 | 32,small_hydroelectric,WEC_SDGE,7.32,6,1.22,0,0,None,9.12,0.002,0.001,0.385,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,13.5,-1,0,0,0,0,0,0,44560,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 28 | 33,solar_photovoltaic,WEC_SDGE,500,20,8.48,0,0,None,9.16,0,0.021,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,169.6,0,0,0,0,0,0,0,17943,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 29 | 34,naturalgas_ccccsavgcf,WEC_SDGE,0,0,500,7.2,0,pacific_naturalgas_ccs90,7.52,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,2215517.785,229065,33620,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 30 | 35,naturalgas_ccavgcf,WEC_SDGE,0,0,500,2,0,pacific_naturalgas,6.28,0,0,0.2,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,804772.856,114863,10032,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 31 | 36,naturalgas_ctavgcf,WEC_SDGE,0,0,100,10.8,0,pacific_naturalgas,9.35,0,0,0.3,3.78,3.78,123,3.5,1,1,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,-1,0,0,699302.872,90151,6848,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 32 | 37,battery,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,0.92,0.92,1,1,10,0,1,trans,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,-1,0,0,578000,74501,14450,177000,22814,4425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 33 | 38,naturalgas_ccs100,WEC_SDGE,0,0,500,7.7,0,pacific_naturalgas_ccs100,7.88,0,0,0.6,0.64,0.64,95,3.5,6,6,0,1,1,1,0,0,0,1,trans,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,-1,0,0,2331517.785,241058,43290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 34 | 39,landbasedwind_ltrg1,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1401.08,0,0,1539971.684,288081.069,42496,0,0,0,0,0,0,0,0,0,0,0,21.732,190698.767,0,0,13.194,40075.854,17627.069,0 35 | 40,landbasedwind_ltrg1,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,2,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,391.319,0,0,1539971.684,288189.734,42496,0,0,0,0,0,0,0,0,0,0,0,12.474,109463.738,0,0,40.406,122733.529,17735.734,0 36 | 41,utilitypv_losangeles,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,1,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,3828.575,0,0,1072583.692,130391.362,16536,0,0,0,0,0,0,0,0,0,0,0,8.598,75444.817,0,0,2.891,8781.109,6433.362,0 37 | 42,utilitypv_losangeles,WEC_SDGE,0,0,1,0,0,None,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,2,1,trans,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,6262.648,0,0,1072583.692,135738.331,16536,0,0,0,0,0,0,0,0,0,0,0,13.09,114863.841,0,0,12.96,39364.821,11780.331,0 -------------------------------------------------------------------------------- /Project.toml: -------------------------------------------------------------------------------- 1 | [compat] 2 | julia = "1.9" 3 | -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Flexible_demand_data.csv: -------------------------------------------------------------------------------- 1 | ID,Zone_name,Zone,Load_type,Max_Capacity_MW,Max_Delay_Hrs 2 | 1,WECC_PNW,5,ev_load_shifting,10860.8,5 3 | 2,CA_N,1,ev_load_shifting,6123.8,5 4 | 3,CA_S,2,ev_load_shifting,9580.2,5 5 | 4,WECC_N,3,ev_load_shifting,4653.6,5 6 | 5,WECC_WYCO,6,ev_load_shifting,6312,5 7 | 6,WECC_NMAZ,4,ev_load_shifting,6926.8,5 -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,CO2_content_tons_per_MMBtu,Cost_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | pacific_naturalgas,0.05306,4.79,2 4 | pacific_coal,0.09552,2.19,3 5 | mountain_coal,0.09552,1.63,4 6 | mountain_naturalgas,0.05306,4.98,5 7 | mountain_uranium,0,0.84,6 8 | pacific_uranium,0,0.84,7 9 | pacific_naturalgas_ccs90,0.00531,4.79,8 10 | mountain_naturalgas_ccs90,0.00531,4.98,9 -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Network.csv: -------------------------------------------------------------------------------- 1 | Network_Lines,z1,z2,z3,z4,z5,z6,Line_Max_Flow_MW,Line_Min_Flow_MW,transmission_path_name,Line_Reinforcement_Cost_per_MWyr,Line_Reinforcement_Cost_per_MW,Line_Loss_Percentage,Line_Max_Reinforcement_MW 2 | 1,1,-1,0,0,0,0,3675,3675,CA_N_to_CA_S,62614,1292626,0.0703,3675 3 | 2,1,0,-1,0,0,0,100,100,CA_N_to_WECC_N,65614,1354568,0.0848,400 4 | 3,1,0,0,0,-1,0,3675,3675,CA_N_to_WECC_PNW,86810,1792151,0.0987,3675 5 | 4,0,1,-1,0,0,0,1400,1400,CA_S_to_WECC_N,57095,1178706,0.0718,1400 6 | 5,0,1,0,-1,0,0,10464,10464,CA_S_to_WECC_NMAZ,58441,1206490,0.0789,10464 7 | 6,0,1,0,0,-1,0,2858,2858,CA_S_to_WECC_PNW,101490,2095201,0.1221,2858 8 | 7,0,0,1,-1,0,0,740,740,WECC_N_to_WECC_NMAZ,59115,1220396,0.0737,740 9 | 8,0,0,1,0,-1,0,5150,5150,WECC_N_to_WECC_PNW,81159,1675493,0.0894,5150 10 | 9,0,0,1,0,0,-1,4150,4150,WECC_N_to_WECC_WYCO,41216,850879,0.047,4150 11 | 10,0,0,0,1,0,-1,664,664,WECC_NMAZ_to_WECC_WYCO,75071,1549797,0.1131,664 -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Period_map.csv: -------------------------------------------------------------------------------- 1 | Period_Index,Rep_Period_Index,Month,Rep_Period 2 | 1,5,1,1 3 | 2,6,1,2 4 | 3,8,1,3 5 | 4,12,1,9 6 | 5,6,2,2 7 | 6,11,2,6 8 | 7,13,2,52 9 | 8,12,2,9 10 | 9,12,3,9 11 | 10,1,3,10 12 | 11,10,3,11 13 | 12,13,3,52 14 | 13,10,4,11 15 | 14,2,4,16 16 | 15,15,4,15 17 | 16,2,4,16 18 | 17,15,4,15 19 | 18,9,5,22 20 | 19,4,5,28 21 | 20,9,5,22 22 | 21,9,5,22 23 | 22,9,6,22 24 | 23,9,6,22 25 | 24,4,6,28 26 | 25,9,6,22 27 | 26,9,7,22 28 | 27,4,7,28 29 | 28,4,7,28 30 | 29,4,7,28 31 | 30,4,7,28 32 | 31,4,8,28 33 | 32,16,8,32 34 | 33,3,8,36 35 | 34,4,8,28 36 | 35,4,9,28 37 | 36,3,9,36 38 | 37,3,9,36 39 | 38,2,9,16 40 | 39,3,9,36 41 | 40,3,10,36 42 | 41,3,10,36 43 | 42,1,10,10 44 | 43,7,10,44 45 | 44,7,11,44 46 | 45,14,11,46 47 | 46,14,11,46 48 | 47,7,11,44 49 | 48,11,12,6 50 | 49,5,12,1 51 | 50,14,12,46 52 | 51,8,12,3 53 | 52,13,12,52 54 | -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Representative_Period.csv: -------------------------------------------------------------------------------- 1 | slot 2 | p10 3 | p16 4 | p36 5 | p28 6 | p1 7 | p2 8 | p44 9 | p3 10 | p22 11 | p11 12 | p6 13 | p9 14 | p52 15 | p46 16 | p15 17 | p32 18 | -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Reserves.csv: -------------------------------------------------------------------------------- 1 | Reg_Req_Percent_Load,Reg_Req_Percent_VRE,Rsv_Req_Percent_Load,Rsv_Req_Percent_VRE,Unmet_Rsv_Penalty_Dollar_per_MW,Dynamic_Contingency,Static_Contingency_MW 2 | 0.01,0.0032,0.033,0.0795,1000,0,0 -------------------------------------------------------------------------------- /Project/WECC_6zone_2035/Zones.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones 2 | WECC_PNW,z5 3 | CA_N,z1 4 | CA_S,z2 5 | WECC_N,z3 6 | WECC_WYCO,z6 7 | WECC_NMAZ,z4 -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Flexible_demand_data.csv: -------------------------------------------------------------------------------- 1 | ID,Zone_name,Zone,Load_type,Max_Capacity_MW,Max_Delay_Hrs 2 | 1,WECC_PNW,5,ev_load_shifting,31120.8,5 3 | 2,CA_N,1,ev_load_shifting,16573.1,5 4 | 3,CA_S,2,ev_load_shifting,25927.5,5 5 | 4,WECC_N,3,ev_load_shifting,16502.4,5 6 | 5,WECC_WYCO,6,ev_load_shifting,19054.7,5 7 | 6,WECC_NMAZ,4,ev_load_shifting,24002.7,5 -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | pacific_naturalgas,4.97,0.05306,2 4 | pacific_coal,2.11,0.09552,3 5 | mountain_coal,1.55,0.09552,4 6 | mountain_naturalgas,5.21,0.05306,5 7 | mountain_uranium,0.87,0,6 8 | pacific_uranium,0.87,0,7 9 | pacific_naturalgas_ccs90,4.97,0.00531,8 10 | mountain_naturalgas_ccs90,5.21,0.00531,9 -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Network.csv: -------------------------------------------------------------------------------- 1 | Network_Lines,z1,z2,z3,z4,z5,z6,Line_Max_Flow_MW,Line_Min_Flow_MW,transmission_path_name,Line_Reinforcement_Cost_per_MWyr,Line_Reinforcement_Cost_per_MW,Line_Loss_Percentage,Line_Max_Reinforcement_MW 2 | 1,1,-1,0,0,0,0,3675,3675,CA_N_to_CA_S,62614,1292626,0.0703,3675 3 | 2,1,0,-1,0,0,0,100,100,CA_N_to_WECC_N,65614,1354568,0.0848,400 4 | 3,1,0,0,0,-1,0,3675,3675,CA_N_to_WECC_PNW,86810,1792151,0.0987,3675 5 | 4,0,1,-1,0,0,0,1400,1400,CA_S_to_WECC_N,57095,1178706,0.0718,1400 6 | 5,0,1,0,-1,0,0,10464,10464,CA_S_to_WECC_NMAZ,58441,1206490,0.0789,10464 7 | 6,0,1,0,0,-1,0,2858,2858,CA_S_to_WECC_PNW,101490,2095201,0.1221,2858 8 | 7,0,0,1,-1,0,0,740,740,WECC_N_to_WECC_NMAZ,59115,1220396,0.0737,740 9 | 8,0,0,1,0,-1,0,5150,5150,WECC_N_to_WECC_PNW,81159,1675493,0.0894,5150 10 | 9,0,0,1,0,0,-1,4150,4150,WECC_N_to_WECC_WYCO,41216,850879,0.047,4150 11 | 10,0,0,0,1,0,-1,664,664,WECC_NMAZ_to_WECC_WYCO,75071,1549797,0.1131,664 -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Period_map.csv: -------------------------------------------------------------------------------- 1 | Period_Index,Rep_Period_Index,Month,Rep_Period 2 | 1,5,1,1 3 | 2,6,1,2 4 | 3,8,1,3 5 | 4,12,1,9 6 | 5,6,2,2 7 | 6,11,2,6 8 | 7,13,2,52 9 | 8,12,2,9 10 | 9,12,3,9 11 | 10,1,3,10 12 | 11,10,3,11 13 | 12,13,3,52 14 | 13,10,4,11 15 | 14,2,4,16 16 | 15,15,4,15 17 | 16,2,4,16 18 | 17,15,4,15 19 | 18,9,5,22 20 | 19,4,5,28 21 | 20,9,5,22 22 | 21,9,5,22 23 | 22,9,6,22 24 | 23,9,6,22 25 | 24,4,6,28 26 | 25,9,6,22 27 | 26,9,7,22 28 | 27,4,7,28 29 | 28,4,7,28 30 | 29,4,7,28 31 | 30,4,7,28 32 | 31,4,8,28 33 | 32,16,8,32 34 | 33,3,8,36 35 | 34,4,8,28 36 | 35,4,9,28 37 | 36,3,9,36 38 | 37,3,9,36 39 | 38,2,9,16 40 | 39,3,9,36 41 | 40,3,10,36 42 | 41,3,10,36 43 | 42,1,10,10 44 | 43,7,10,44 45 | 44,7,11,44 46 | 45,14,11,46 47 | 46,14,11,46 48 | 47,7,11,44 49 | 48,11,12,6 50 | 49,5,12,1 51 | 50,14,12,46 52 | 51,8,12,3 53 | 52,13,12,52 54 | -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Representative_Period.csv: -------------------------------------------------------------------------------- 1 | slot 2 | p10 3 | p16 4 | p36 5 | p28 6 | p1 7 | p2 8 | p44 9 | p3 10 | p22 11 | p11 12 | p6 13 | p9 14 | p52 15 | p46 16 | p15 17 | p32 18 | -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Reserves.csv: -------------------------------------------------------------------------------- 1 | Reg_Req_Percent_Load,Reg_Req_Percent_VRE,Rsv_Req_Percent_Load,Rsv_Req_Percent_VRE,Unmet_Rsv_Penalty_Dollar_per_MW,Dynamic_Contingency,Static_Contingency_MW 2 | 0.01,0.0032,0.033,0.0795,1000,0,0 -------------------------------------------------------------------------------- /Project/WECC_6zone_2050/Zones.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones 2 | WECC_PNW,z5 3 | CA_N,z1 4 | CA_S,z2 5 | WECC_N,z3 6 | WECC_WYCO,z6 7 | WECC_NMAZ,z4 -------------------------------------------------------------------------------- /Project/ercot_500kV/bus.csv: -------------------------------------------------------------------------------- 1 | bus_agg,zone_id,Pd,Qd 2 | 1079,301,1240.38,351.46 3 | 2002,302,235.15,66.63 4 | 2011,302,58.33,16.52 5 | 2017,302,0,0 6 | 2021,302,141.18,40.02 7 | 2054,302,463.93,131.45 8 | 2096,301,165.21,46.81 9 | 2101,302,680.03,192.64000000000001 10 | 2113,302,155.77,44.13 11 | 2127,302,18.57,5.26 12 | 3048,301,1223.7,346.7 13 | 4195,304,6093.1,1726.43 14 | 5015,305,863.1899999999999,244.57999999999998 15 | 5018,305,86.52,24.51 16 | 5021,305,893.89,253.25 17 | 5033,305,429.06,121.56 18 | 5045,305,107.28999999999999,30.400000000000002 19 | 5047,305,184.54,52.29 20 | 5049,305,347.01,98.31 21 | 5055,302,88.41,25.05 22 | 5063,305,2070.71,586.7 23 | 5083,305,1093.15,309.72 24 | 5102,305,2185.2400000000002,619.15 25 | 5120,305,91.78,26 26 | 5131,305,207.5,58.79 27 | 5137,305,362.72,102.76 28 | 5164,305,841.51,238.43 29 | 5179,305,88.36,25.04 30 | 5192,305,134.77,38.19 31 | 5196,305,64.91000000000001,18.4 32 | 5204,305,37.88,10.74 33 | 5236,302,0,0 34 | 5239,303,135.75,38.47 35 | 5260,305,70.05,19.85 36 | 5279,305,278.46999999999997,78.89 37 | 5295,305,563.26,159.59 38 | 5304,305,1071.39,303.56 39 | 5317,305,146.41,41.48 40 | 5322,305,1259.01,356.71999999999997 41 | 5350,305,919.4300000000001,260.52 42 | 5358,305,93.47,26.490000000000002 43 | 5361,302,137.17,38.87 44 | 5380,305,410.04,116.17 45 | 5384,305,1506.27,426.77 46 | 5388,305,292.79,82.95 47 | 5394,303,284.49,80.59 48 | 5401,305,557.01,157.82 49 | 5410,305,396.89,112.45 50 | 5413,305,54.61,15.47 51 | 5444,305,224.32,63.55 52 | 5448,305,1389.09,393.59 53 | 5451,305,293.35,83.12 54 | 5464,305,776.74,220.07999999999998 55 | 5479,305,1099.25,311.45 56 | 6003,306,203.10000000000002,57.55 57 | 6021,303,269.89,76.47 58 | 6033,306,1301.21,368.67 59 | 6038,306,80.78,22.89 60 | 6045,303,1086.78,307.94 61 | 6056,306,812.94,230.32999999999998 62 | 6062,306,181.27,51.37 63 | 6066,306,107.33,30.41 64 | 6075,306,175.57,49.74 65 | 6101,306,88.38,25.04 66 | 6107,306,143.23999999999998,40.58 67 | 6118,306,344.23,97.53 68 | 6141,306,913.58,258.86 69 | 6161,306,0,0 70 | 6169,303,326.56,92.53999999999999 71 | 6197,306,1191.23,337.52 72 | 6210,303,95.11,26.94 73 | 6228,306,507.66,143.84 74 | 6234,304,579.58,164.22 75 | 6239,304,332.3,94.14999999999999 76 | 6254,306,20.71,5.87 77 | 6292,306,1412.51,400.21 78 | 6298,303,883.54,250.32 79 | 6333,306,703.84,199.42000000000002 80 | 6342,306,833.9300000000001,236.29000000000002 81 | 6349,303,276.09,78.2 82 | 7002,307,2625.96,744.04 83 | 7018,307,75.38,21.36 84 | 7037,307,1630.15,461.88 85 | 7042,304,281.69,79.83 86 | 7047,307,1284.45,363.92 87 | 7058,307,68.8,19.5 88 | 7076,307,394.78,111.85 89 | 7095,307,32.84,9.3 90 | 7104,307,92.07,26.09 91 | 7125,307,297.76,84.37 92 | 7130,307,233.19,66.07 93 | 7159,307,895.7,253.78 94 | 7175,307,624.93,177.07 95 | 7186,307,2677.06,758.48 96 | 7199,307,714.76,202.5 97 | 7204,307,430.9,122.09 98 | 7227,307,1714.89,485.90000000000003 99 | 7263,307,394.07,111.65 100 | 7304,306,225.82999999999998,63.99 101 | 7320,307,78.83,22.330000000000002 102 | 7331,307,126.89000000000001,35.95 103 | 7341,307,185.74,52.63 104 | 7346,307,652.47,184.86 105 | 7366,307,845.02,239.43 106 | 7389,307,667.33,189.07 107 | 7400,307,461.53,130.77 108 | 7406,304,338.23,95.84 109 | 7414,307,0,0 110 | 7422,307,282.78999999999996,80.12 111 | 7428,307,291.95,82.71 112 | 8030,307,456.07,129.22 113 | 8043,308,203.43,57.65 114 | 8057,308,65.36,18.509999999999998 115 | 8067,308,36.35,10.31 116 | 8074,308,126.9,35.949999999999996 117 | 8082,305,89.6,25.4 118 | 8112,308,435.1,123.28 119 | 8126,305,927.0699999999999,262.68 120 | 8155,305,31.450000000000003,8.91 121 | 8158,307,627.48,177.78 122 | -------------------------------------------------------------------------------- /Project/ercot_500kV/readme.md: -------------------------------------------------------------------------------- 1 | ERCOT 120-bus 500kV simulated system 2 | - 3 | 4 | ## Description and usage 5 | 6 | A complete set of generator parameters, buses, branches, loads, and renewable profiles for the year 2016 in a simulated system covering the Electric Reliability Council of Texas (ERCOT). 7 | 8 | Suitable for: 9 | - OPF 10 | - Economic dispatch 11 | 12 | ## Data sources 13 | 14 | The 2016 snapshot of the ERCOT grid is taken from the [U.S. Test System with High Spatial and Temporal Resolution for Renewable Integration Studies](https://zenodo.org/record/3530899#.X6TQ85NKjUK) by Xu et al. The paper describing the methodology: https://arxiv.org/abs/2002.06155 15 | 16 | These data are largely adapted from the [ACTIVSg2000 dataset](https://electricgrids.engr.tamu.edu/electric-grid-test-cases/activsg2000/), a 2000-bus synthetic grid on the footprint of Texas in the Electric Grid Test Case Repository published by Texas A&M University. Some changes made with respect to the TAMU system are described in the above paper. MATPOWER and other file formats of the TAMU data are available at the above link. Load profiles for 2016 were taken directly from the TAMU dataset. 17 | 18 | To reduce dimensionality, all buses (`bus_id`, 2000 in total) were aggregated to the closest 500kV bus (`bus_agg`, 120 in total) according to the number of branches separating the low and high-voltage buses. 19 | 20 | Wind and solar profiles for 2016 were downloaded from [Renewables.ninja](https://www.renewables.ninja/) at the latitude and longitude of a substation connected to the aggregate bus with the largest installed wind and solar capacity, respectively, in each zone. These are stored according to the [zone_id](zone.csv). (Smaller zones with limited wind or solar may not have a profile. In these cases, simply use the nearby zone.) 21 | 22 | 23 | ## License and usage 24 | 25 | **U.S. Test System with High Spatial and Temporal Resolution for Renewable Integration Studies** 26 | - Citation: https://arxiv.org/abs/2002.06155 27 | - [Creative Commons 4.0 Attribution International](https://creativecommons.org/licenses/by/4.0/) 28 | 29 | **ACTIVSg2000 dataset** 30 | - See the [list of references](https://electricgrids.engr.tamu.edu/references/) describing the methodology, and cite accordingly 31 | 32 | **Renewables.ninja** 33 | - [Creative Commons Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/) 34 | -------------------------------------------------------------------------------- /Project/ercot_500kV/zone.csv: -------------------------------------------------------------------------------- 1 | zone_id,zone_name 2 | 301,Far West 3 | 302,North 4 | 303,West 5 | 304,South 6 | 305,North Central 7 | 306,South Central 8 | 307,Coast 9 | 308,East 10 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/10_days/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,9 3 | 2,4 4 | 3,3 5 | 4,8 6 | 5,2 7 | 6,3 8 | 7,4 9 | 8,2 10 | 9,9 11 | 10,9 12 | 11,6 13 | 12,9 14 | 13,2 15 | 14,7 16 | 15,6 17 | 16,6 18 | 17,9 19 | 18,2 20 | 19,8 21 | 20,9 22 | 21,2 23 | 22,6 24 | 23,2 25 | 24,9 26 | 25,9 27 | 26,8 28 | 27,3 29 | 28,4 30 | 29,2 31 | 30,3 32 | 31,8 33 | 32,1 34 | 33,2 35 | 34,6 36 | 35,6 37 | 36,9 38 | 37,1 39 | 38,2 40 | 39,4 41 | 40,8 42 | 41,2 43 | 42,9 44 | 43,2 45 | 44,8 46 | 45,5 47 | 46,8 48 | 47,1 49 | 48,4 50 | 49,9 51 | 50,2 52 | 51,3 53 | 52,2 54 | 53,6 55 | 54,6 56 | 55,9 57 | 56,6 58 | 57,3 59 | 58,2 60 | 59,6 61 | 60,6 62 | 61,6 63 | 62,9 64 | 63,4 65 | 64,7 66 | 65,3 67 | 66,6 68 | 67,6 69 | 68,6 70 | 69,9 71 | 70,1 72 | 71,2 73 | 72,7 74 | 73,3 75 | 74,5 76 | 75,5 77 | 76,6 78 | 77,6 79 | 78,6 80 | 79,9 81 | 80,4 82 | 81,8 83 | 82,8 84 | 83,1 85 | 84,7 86 | 85,7 87 | 86,3 88 | 87,5 89 | 88,2 90 | 89,5 91 | 90,7 92 | 91,7 93 | 92,3 94 | 93,5 95 | 94,2 96 | 95,1 97 | 96,1 98 | 97,3 99 | 98,5 100 | 99,1 101 | 100,1 102 | 101,7 103 | 102,7 104 | 103,6 105 | 104,6 106 | 105,6 107 | 106,9 108 | 107,4 109 | 108,7 110 | 109,3 111 | 110,3 112 | 111,8 113 | 112,4 114 | 113,7 115 | 114,7 116 | 115,5 117 | 116,5 118 | 117,5 119 | 118,5 120 | 119,5 121 | 120,5 122 | 121,5 123 | 122,3 124 | 123,3 125 | 124,7 126 | 125,7 127 | 126,5 128 | 127,3 129 | 128,2 130 | 129,1 131 | 130,1 132 | 131,9 133 | 132,1 134 | 133,1 135 | 134,1 136 | 135,1 137 | 136,1 138 | 137,7 139 | 138,7 140 | 139,3 141 | 140,3 142 | 141,1 143 | 142,1 144 | 143,7 145 | 144,6 146 | 145,5 147 | 146,6 148 | 147,6 149 | 148,3 150 | 149,7 151 | 150,7 152 | 151,5 153 | 152,5 154 | 153,7 155 | 154,5 156 | 155,5 157 | 156,7 158 | 157,1 159 | 158,1 160 | 159,1 161 | 160,1 162 | 161,3 163 | 162,5 164 | 163,5 165 | 164,2 166 | 165,7 167 | 166,5 168 | 167,5 169 | 168,1 170 | 169,7 171 | 170,3 172 | 171,6 173 | 172,3 174 | 173,1 175 | 174,7 176 | 175,7 177 | 176,7 178 | 177,10 179 | 178,7 180 | 179,7 181 | 180,7 182 | 181,7 183 | 182,7 184 | 183,2 185 | 184,5 186 | 185,5 187 | 186,5 188 | 187,7 189 | 188,7 190 | 189,1 191 | 190,1 192 | 191,1 193 | 192,1 194 | 193,1 195 | 194,1 196 | 195,1 197 | 196,1 198 | 197,7 199 | 198,7 200 | 199,7 201 | 200,7 202 | 201,7 203 | 202,7 204 | 203,1 205 | 204,1 206 | 205,7 207 | 206,3 208 | 207,3 209 | 208,4 210 | 209,1 211 | 210,7 212 | 211,7 213 | 212,7 214 | 213,7 215 | 214,7 216 | 215,7 217 | 216,7 218 | 217,7 219 | 218,1 220 | 219,7 221 | 220,1 222 | 221,1 223 | 222,1 224 | 223,1 225 | 224,7 226 | 225,7 227 | 226,1 228 | 227,7 229 | 228,5 230 | 229,7 231 | 230,1 232 | 231,1 233 | 232,1 234 | 233,1 235 | 234,1 236 | 235,7 237 | 236,3 238 | 237,7 239 | 238,5 240 | 239,1 241 | 240,1 242 | 241,1 243 | 242,1 244 | 243,1 245 | 244,1 246 | 245,7 247 | 246,7 248 | 247,7 249 | 248,7 250 | 249,7 251 | 250,1 252 | 251,7 253 | 252,8 254 | 253,1 255 | 254,7 256 | 255,3 257 | 256,5 258 | 257,2 259 | 258,1 260 | 259,1 261 | 260,1 262 | 261,1 263 | 262,1 264 | 263,7 265 | 264,7 266 | 265,7 267 | 266,7 268 | 267,7 269 | 268,3 270 | 269,3 271 | 270,5 272 | 271,1 273 | 272,1 274 | 273,9 275 | 274,4 276 | 275,2 277 | 276,1 278 | 277,3 279 | 278,9 280 | 279,2 281 | 280,8 282 | 281,4 283 | 282,2 284 | 283,8 285 | 284,4 286 | 285,2 287 | 286,5 288 | 287,6 289 | 288,8 290 | 289,2 291 | 290,3 292 | 291,9 293 | 292,1 294 | 293,2 295 | 294,5 296 | 295,5 297 | 296,5 298 | 297,3 299 | 298,3 300 | 299,3 301 | 300,9 302 | 301,4 303 | 302,2 304 | 303,7 305 | 304,1 306 | 305,1 307 | 306,7 308 | 307,3 309 | 308,4 310 | 309,1 311 | 310,8 312 | 311,4 313 | 312,1 314 | 313,9 315 | 314,6 316 | 315,6 317 | 316,9 318 | 317,4 319 | 318,4 320 | 319,4 321 | 320,1 322 | 321,4 323 | 322,2 324 | 323,8 325 | 324,1 326 | 325,1 327 | 326,2 328 | 327,8 329 | 328,8 330 | 329,4 331 | 330,8 332 | 331,2 333 | 332,4 334 | 333,1 335 | 334,8 336 | 335,8 337 | 336,8 338 | 337,2 339 | 338,8 340 | 339,8 341 | 340,4 342 | 341,8 343 | 342,4 344 | 343,2 345 | 344,6 346 | 345,4 347 | 346,4 348 | 347,3 349 | 348,3 350 | 349,6 351 | 350,9 352 | 351,8 353 | 352,2 354 | 353,5 355 | 354,6 356 | 355,9 357 | 356,2 358 | 357,9 359 | 358,9 360 | 359,4 361 | 360,6 362 | 361,4 363 | 362,8 364 | 363,4 365 | 364,4 366 | 365,3 367 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/10_days/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/10_days/Load_data.csv: -------------------------------------------------------------------------------- 1 | Voll,Demand_segment,Cost_of_demand_curtailment_perMW,Max_demand_curtailment,$/MWh,Subperiods,Hours_per_period,Sub_Weights,Time_index,Load_MW_z1,Load_MW_z2,Load_MW_z3 2 | 9000.0,1.0,1.0,1.0,9000.0,10.0,24.0,1704.0,1,0.0,48533.0,3326.0 3 | ,2.0,0.067,0.075,603.0,,,840.0,2,0.0,47358.0,3298.0 4 | ,,,,,,,888.0,3,0.0,47219.0,3311.0 5 | ,,,,,,,720.0,4,0.0,47812.0,3363.0 6 | ,,,,,,,864.0,5,0.0,48069.0,3377.0 7 | ,,,,,,,768.0,6,0.0,51247.0,3531.0 8 | ,,,,,,,1656.0,7,0.0,55670.0,3745.0 9 | ,,,,,,,648.0,8,0.0,60008.0,3926.0 10 | ,,,,,,,648.0,9,0.0,63731.0,4120.0 11 | ,,,,,,,24.0,10,0.0,66749.0,4300.0 12 | ,,,,,,,,11,0.0,68622.0,4460.0 13 | ,,,,,,,,12,0.0,68573.0,4586.0 14 | ,,,,,,,,13,0.0,67421.0,4668.0 15 | ,,,,,,,,14,0.0,65777.0,4687.0 16 | ,,,,,,,,15,0.0,64150.0,4622.0 17 | ,,,,,,,,16,0.0,61630.0,4557.0 18 | ,,,,,,,,17,0.0,59297.0,4436.0 19 | ,,,,,,,,18,0.0,58372.0,4332.0 20 | ,,,,,,,,19,0.0,56714.0,4240.0 21 | ,,,,,,,,20,0.0,53526.0,4045.0 22 | ,,,,,,,,21,0.0,49918.0,3843.0 23 | ,,,,,,,,22,0.0,46651.0,3671.0 24 | ,,,,,,,,23,0.0,44257.0,3528.0 25 | ,,,,,,,,24,0.0,42380.0,3426.0 26 | ,,,,,,,,25,0.0,32226.0,2990.0 27 | ,,,,,,,,26,0.0,32524.0,3043.0 28 | ,,,,,,,,27,0.0,33857.0,3144.0 29 | ,,,,,,,,28,0.0,37449.0,3341.0 30 | ,,,,,,,,29,0.0,43532.0,3683.0 31 | ,,,,,,,,30,0.0,45779.0,3825.0 32 | ,,,,,,,,31,0.0,44689.0,3715.0 33 | ,,,,,,,,32,0.0,44291.0,3626.0 34 | ,,,,,,,,33,0.0,44247.0,3535.0 35 | ,,,,,,,,34,0.0,43706.0,3412.0 36 | ,,,,,,,,35,0.0,43000.0,3314.0 37 | ,,,,,,,,36,0.0,42536.0,3263.0 38 | ,,,,,,,,37,0.0,41986.0,3209.0 39 | ,,,,,,,,38,0.0,41578.0,3197.0 40 | ,,,,,,,,39,0.0,41516.0,3217.0 41 | ,,,,,,,,40,0.0,42392.0,3224.0 42 | ,,,,,,,,41,0.0,45874.0,3391.0 43 | ,,,,,,,,42,0.0,46323.0,3485.0 44 | ,,,,,,,,43,0.0,45779.0,3493.0 45 | ,,,,,,,,44,0.0,44180.0,3456.0 46 | ,,,,,,,,45,0.0,41129.0,3321.0 47 | ,,,,,,,,46,0.0,38083.0,3184.0 48 | ,,,,,,,,47,0.0,36146.0,3104.0 49 | ,,,,,,,,48,0.0,35275.0,3083.0 50 | ,,,,,,,,49,0.0,35008.0,2976.0 51 | ,,,,,,,,50,0.0,35430.0,2980.0 52 | ,,,,,,,,51,0.0,37982.0,3051.0 53 | ,,,,,,,,52,0.0,42738.0,3252.0 54 | ,,,,,,,,53,0.0,44270.0,3346.0 55 | ,,,,,,,,54,0.0,45009.0,3327.0 56 | ,,,,,,,,55,0.0,47710.0,3379.0 57 | ,,,,,,,,56,0.0,50708.0,3463.0 58 | ,,,,,,,,57,0.0,53736.0,3557.0 59 | ,,,,,,,,58,0.0,56827.0,3631.0 60 | ,,,,,,,,59,0.0,60000.0,3731.0 61 | ,,,,,,,,60,0.0,62616.0,3822.0 62 | ,,,,,,,,61,0.0,64510.0,3900.0 63 | ,,,,,,,,62,0.0,65538.0,3958.0 64 | ,,,,,,,,63,0.0,64492.0,3913.0 65 | ,,,,,,,,64,0.0,61981.0,3816.0 66 | ,,,,,,,,65,0.0,61829.0,3763.0 67 | ,,,,,,,,66,0.0,60886.0,3774.0 68 | ,,,,,,,,67,0.0,57697.0,3640.0 69 | ,,,,,,,,68,0.0,52707.0,3427.0 70 | ,,,,,,,,69,0.0,47474.0,3212.0 71 | ,,,,,,,,70,0.0,43370.0,3068.0 72 | ,,,,,,,,71,0.0,40618.0,2983.0 73 | ,,,,,,,,72,0.0,39018.0,2927.0 74 | ,,,,,,,,73,0.0,32801.0,3119.0 75 | ,,,,,,,,74,0.0,33025.0,3164.0 76 | ,,,,,,,,75,0.0,33872.0,3217.0 77 | ,,,,,,,,76,0.0,35382.0,3297.0 78 | ,,,,,,,,77,0.0,37212.0,3405.0 79 | ,,,,,,,,78,0.0,38614.0,3466.0 80 | ,,,,,,,,79,0.0,39475.0,3465.0 81 | ,,,,,,,,80,0.0,39261.0,3396.0 82 | ,,,,,,,,81,0.0,38697.0,3330.0 83 | ,,,,,,,,82,0.0,38404.0,3296.0 84 | ,,,,,,,,83,0.0,38041.0,3257.0 85 | ,,,,,,,,84,0.0,37585.0,3224.0 86 | ,,,,,,,,85,0.0,37448.0,3210.0 87 | ,,,,,,,,86,0.0,37516.0,3211.0 88 | ,,,,,,,,87,0.0,37847.0,3216.0 89 | ,,,,,,,,88,0.0,38901.0,3215.0 90 | ,,,,,,,,89,0.0,42082.0,3390.0 91 | ,,,,,,,,90,0.0,41793.0,3402.0 92 | ,,,,,,,,91,0.0,40442.0,3340.0 93 | ,,,,,,,,92,0.0,37887.0,3209.0 94 | ,,,,,,,,93,0.0,35067.0,3080.0 95 | ,,,,,,,,94,0.0,33253.0,3009.0 96 | ,,,,,,,,95,0.0,32499.0,2981.0 97 | ,,,,,,,,96,0.0,32428.0,2979.0 98 | ,,,,,,,,97,0.0,33731.0,2789.0 99 | ,,,,,,,,98,0.0,33785.0,2795.0 100 | ,,,,,,,,99,0.0,35362.0,2860.0 101 | ,,,,,,,,100,0.0,38456.0,2991.0 102 | ,,,,,,,,101,0.0,40565.0,3118.0 103 | ,,,,,,,,102,0.0,41280.0,3156.0 104 | ,,,,,,,,103,0.0,43066.0,3230.0 105 | ,,,,,,,,104,0.0,45109.0,3315.0 106 | ,,,,,,,,105,0.0,46586.0,3358.0 107 | ,,,,,,,,106,0.0,47591.0,3358.0 108 | ,,,,,,,,107,0.0,48624.0,3378.0 109 | ,,,,,,,,108,0.0,49409.0,3388.0 110 | ,,,,,,,,109,0.0,49961.0,3395.0 111 | ,,,,,,,,110,0.0,49820.0,3399.0 112 | ,,,,,,,,111,0.0,48738.0,3332.0 113 | ,,,,,,,,112,0.0,46975.0,3289.0 114 | ,,,,,,,,113,0.0,46915.0,3281.0 115 | ,,,,,,,,114,0.0,47730.0,3373.0 116 | ,,,,,,,,115,0.0,46430.0,3318.0 117 | ,,,,,,,,116,0.0,43999.0,3230.0 118 | ,,,,,,,,117,0.0,40956.0,3090.0 119 | ,,,,,,,,118,0.0,37994.0,2955.0 120 | ,,,,,,,,119,0.0,35832.0,2869.0 121 | ,,,,,,,,120,0.0,34282.0,2807.0 122 | ,,,,,,,,121,0.0,33228.0,2767.0 123 | ,,,,,,,,122,0.0,32671.0,2757.0 124 | ,,,,,,,,123,0.0,32916.0,2773.0 125 | ,,,,,,,,124,0.0,33730.0,2815.0 126 | ,,,,,,,,125,0.0,34840.0,2885.0 127 | ,,,,,,,,126,0.0,35997.0,2928.0 128 | ,,,,,,,,127,0.0,38254.0,3017.0 129 | ,,,,,,,,128,0.0,40193.0,3101.0 130 | ,,,,,,,,129,0.0,41754.0,3170.0 131 | ,,,,,,,,130,0.0,43173.0,3250.0 132 | ,,,,,,,,131,0.0,43961.0,3286.0 133 | ,,,,,,,,132,0.0,44421.0,3309.0 134 | ,,,,,,,,133,0.0,44660.0,3330.0 135 | ,,,,,,,,134,0.0,44798.0,3350.0 136 | ,,,,,,,,135,0.0,44975.0,3386.0 137 | ,,,,,,,,136,0.0,44980.0,3385.0 138 | ,,,,,,,,137,0.0,46341.0,3398.0 139 | ,,,,,,,,138,0.0,47948.0,3493.0 140 | ,,,,,,,,139,0.0,46791.0,3444.0 141 | ,,,,,,,,140,0.0,43976.0,3291.0 142 | ,,,,,,,,141,0.0,40193.0,3045.0 143 | ,,,,,,,,142,0.0,37129.0,2830.0 144 | ,,,,,,,,143,0.0,35164.0,2755.0 145 | ,,,,,,,,144,0.0,34076.0,2715.0 146 | ,,,,,,,,145,0.0,46832.0,3392.0 147 | ,,,,,,,,146,0.0,45655.0,3314.0 148 | ,,,,,,,,147,0.0,45430.0,3286.0 149 | ,,,,,,,,148,0.0,45337.0,3289.0 150 | ,,,,,,,,149,0.0,45886.0,3310.0 151 | ,,,,,,,,150,0.0,49802.0,3517.0 152 | ,,,,,,,,151,0.0,55347.0,3785.0 153 | ,,,,,,,,152,0.0,61323.0,4066.0 154 | ,,,,,,,,153,0.0,66727.0,4391.0 155 | ,,,,,,,,154,0.0,71307.0,4623.0 156 | ,,,,,,,,155,0.0,74578.0,4785.0 157 | ,,,,,,,,156,0.0,76875.0,4914.0 158 | ,,,,,,,,157,0.0,77129.0,4997.0 159 | ,,,,,,,,158,0.0,74525.0,5028.0 160 | ,,,,,,,,159,0.0,71189.0,5025.0 161 | ,,,,,,,,160,0.0,67429.0,4996.0 162 | ,,,,,,,,161,0.0,64402.0,4890.0 163 | ,,,,,,,,162,0.0,62346.0,4699.0 164 | ,,,,,,,,163,0.0,61158.0,4586.0 165 | ,,,,,,,,164,0.0,57635.0,4352.0 166 | ,,,,,,,,165,0.0,53557.0,4102.0 167 | ,,,,,,,,166,0.0,49791.0,3839.0 168 | ,,,,,,,,167,0.0,46685.0,3659.0 169 | ,,,,,,,,168,0.0,44666.0,3528.0 170 | ,,,,,,,,169,0.0,33037.0,2913.0 171 | ,,,,,,,,170,0.0,32278.0,2893.0 172 | ,,,,,,,,171,0.0,31944.0,2895.0 173 | ,,,,,,,,172,0.0,32225.0,2927.0 174 | ,,,,,,,,173,0.0,33091.0,2976.0 175 | ,,,,,,,,174,0.0,33804.0,3037.0 176 | ,,,,,,,,175,0.0,36279.0,3125.0 177 | ,,,,,,,,176,0.0,39175.0,3185.0 178 | ,,,,,,,,177,0.0,41668.0,3240.0 179 | ,,,,,,,,178,0.0,43694.0,3272.0 180 | ,,,,,,,,179,0.0,45513.0,3318.0 181 | ,,,,,,,,180,0.0,46870.0,3357.0 182 | ,,,,,,,,181,0.0,47815.0,3391.0 183 | ,,,,,,,,182,0.0,48148.0,3419.0 184 | ,,,,,,,,183,0.0,47732.0,3416.0 185 | ,,,,,,,,184,0.0,48912.0,3452.0 186 | ,,,,,,,,185,0.0,51358.0,3621.0 187 | ,,,,,,,,186,0.0,50700.0,3620.0 188 | ,,,,,,,,187,0.0,48928.0,3563.0 189 | ,,,,,,,,188,0.0,46643.0,3473.0 190 | ,,,,,,,,189,0.0,42910.0,3309.0 191 | ,,,,,,,,190,0.0,38814.0,3145.0 192 | ,,,,,,,,191,0.0,35644.0,3018.0 193 | ,,,,,,,,192,0.0,33863.0,2948.0 194 | ,,,,,,,,193,0.0,35527.0,3264.0 195 | ,,,,,,,,194,0.0,35485.0,3272.0 196 | ,,,,,,,,195,0.0,35963.0,3306.0 197 | ,,,,,,,,196,0.0,37252.0,3373.0 198 | ,,,,,,,,197,0.0,39054.0,3467.0 199 | ,,,,,,,,198,0.0,41129.0,3579.0 200 | ,,,,,,,,199,0.0,43730.0,3683.0 201 | ,,,,,,,,200,0.0,45771.0,3734.0 202 | ,,,,,,,,201,0.0,46580.0,3704.0 203 | ,,,,,,,,202,0.0,46526.0,3635.0 204 | ,,,,,,,,203,0.0,46197.0,3586.0 205 | ,,,,,,,,204,0.0,45449.0,3543.0 206 | ,,,,,,,,205,0.0,44671.0,3493.0 207 | ,,,,,,,,206,0.0,44122.0,3460.0 208 | ,,,,,,,,207,0.0,43925.0,3463.0 209 | ,,,,,,,,208,0.0,44476.0,3476.0 210 | ,,,,,,,,209,0.0,46983.0,3573.0 211 | ,,,,,,,,210,0.0,47832.0,3659.0 212 | ,,,,,,,,211,0.0,47683.0,3661.0 213 | ,,,,,,,,212,0.0,47858.0,3705.0 214 | ,,,,,,,,213,0.0,45720.0,3582.0 215 | ,,,,,,,,214,0.0,42849.0,3439.0 216 | ,,,,,,,,215,0.0,40874.0,3348.0 217 | ,,,,,,,,216,0.0,40134.0,3307.0 218 | ,,,,,,,,217,0.0,47630.0,3349.0 219 | ,,,,,,,,218,0.0,46887.0,3287.0 220 | ,,,,,,,,219,0.0,47959.0,3302.0 221 | ,,,,,,,,220,0.0,49801.0,3377.0 222 | ,,,,,,,,221,0.0,51932.0,3467.0 223 | ,,,,,,,,222,0.0,56197.0,3679.0 224 | ,,,,,,,,223,0.0,62042.0,3951.0 225 | ,,,,,,,,224,0.0,68850.0,4265.0 226 | ,,,,,,,,225,0.0,75152.0,4619.0 227 | ,,,,,,,,226,0.0,80343.0,4887.0 228 | ,,,,,,,,227,0.0,84553.0,5115.0 229 | ,,,,,,,,228,0.0,87069.0,5297.0 230 | ,,,,,,,,229,0.0,88057.0,5428.0 231 | ,,,,,,,,230,0.0,88086.0,5497.0 232 | ,,,,,,,,231,0.0,87685.0,5447.0 233 | ,,,,,,,,232,0.0,86248.0,5357.0 234 | ,,,,,,,,233,0.0,83180.0,5246.0 235 | ,,,,,,,,234,0.0,80567.0,5064.0 236 | ,,,,,,,,235,0.0,77898.0,4920.0 237 | ,,,,,,,,236,0.0,72185.0,4627.0 238 | ,,,,,,,,237,0.0,65807.0,4276.0 239 | ,,,,,,,,238,0.0,60284.0,3990.0 240 | ,,,,,,,,239,0.0,56387.0,3792.0 241 | ,,,,,,,,240,0.0,53384.0,3641.0 242 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/10_days/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/16_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,8 3 | 2,14 4 | 3,9 5 | 4,8 6 | 5,7 7 | 6,8 8 | 7,15 9 | 8,10 10 | 9,13 11 | 10,13 12 | 11,1 13 | 12,3 14 | 13,3 15 | 14,3 16 | 15,1 17 | 16,11 18 | 17,1 19 | 18,3 20 | 19,15 21 | 20,2 22 | 21,1 23 | 22,6 24 | 23,5 25 | 24,3 26 | 25,3 27 | 26,16 28 | 27,3 29 | 28,5 30 | 29,6 31 | 30,6 32 | 31,6 33 | 32,5 34 | 33,6 35 | 34,2 36 | 35,5 37 | 36,6 38 | 37,6 39 | 38,2 40 | 39,6 41 | 40,2 42 | 41,7 43 | 42,6 44 | 43,11 45 | 44,2 46 | 45,7 47 | 46,4 48 | 47,15 49 | 48,15 50 | 49,15 51 | 50,12 52 | 51,14 53 | 52,8 54 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/16_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/16_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/4_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,3 3 | 2,3 4 | 3,3 5 | 4,3 6 | 5,3 7 | 6,3 8 | 7,3 9 | 8,1 10 | 9,1 11 | 10,1 12 | 11,1 13 | 12,3 14 | 13,2 15 | 14,3 16 | 15,1 17 | 16,3 18 | 17,1 19 | 18,2 20 | 19,3 21 | 20,2 22 | 21,1 23 | 22,2 24 | 23,2 25 | 24,2 26 | 25,2 27 | 26,4 28 | 27,2 29 | 28,2 30 | 29,2 31 | 30,2 32 | 31,2 33 | 32,2 34 | 33,2 35 | 34,2 36 | 35,2 37 | 36,2 38 | 37,2 39 | 38,2 40 | 39,2 41 | 40,2 42 | 41,3 43 | 42,2 44 | 43,3 45 | 44,2 46 | 45,3 47 | 46,3 48 | 47,3 49 | 48,3 50 | 49,3 51 | 50,3 52 | 51,1 53 | 52,3 54 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/4_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/4_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/52_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/52_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/8_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | slot,cluster 2 | 1,6 3 | 2,3 4 | 3,7 5 | 4,6 6 | 5,2 7 | 6,6 8 | 7,5 9 | 8,4 10 | 9,4 11 | 10,4 12 | 11,4 13 | 12,7 14 | 13,3 15 | 14,7 16 | 15,2 17 | 16,7 18 | 17,4 19 | 18,7 20 | 19,5 21 | 20,1 22 | 21,4 23 | 22,3 24 | 23,1 25 | 24,7 26 | 25,3 27 | 26,8 28 | 27,3 29 | 28,1 30 | 29,3 31 | 30,3 32 | 31,3 33 | 32,1 34 | 33,3 35 | 34,1 36 | 35,1 37 | 36,3 38 | 37,3 39 | 38,1 40 | 39,3 41 | 40,3 42 | 41,2 43 | 42,3 44 | 43,7 45 | 44,2 46 | 45,2 47 | 46,5 48 | 47,5 49 | 48,5 50 | 49,5 51 | 50,7 52 | 51,4 53 | 52,6 54 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/8_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0.0,0.0,1 3 | ercot_coal,1.91,0.09552,2 4 | ercot_naturalgas,3.62,0.05306,3 5 | ercot_uranium,0.71,0.0,4 6 | ercot_naturalgas_ccs90,4.1,0.00531,5 7 | ercot_naturalgas_ccs100,4.15,0.0,6 8 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/8_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones,DistrZones,CES,RPS,CO_2_Max_Mtons,CO_2_Max_ton_MWh,CO_2_Import_ton_MWh,CO_2_Export_ton_MWh,Network_lines,z1,z2,z3,Line_Max_Flow_MW,Line_Min_Flow_MW,Transmission Path Name,distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | ERC_P,z1,0,,,0,-1,0,0,1.0,1.0,0.0,-1.0,3702.0,-3702.0,ERC_P_to_ERC_W,195.5,0.0196,3702.0,21032.0 3 | ERC_R,z2,0,,,0,-1,0,0,2.0,0.0,1.0,-1.0,5529.0,-10555.0,ERC_R_to_ERC_W,256.5,0.0256,5529.0,27595.0 4 | ERC_W,z3,0,,,0,-1,0,0,,,,,,,,,,, 5 | -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/ercot_3_zone_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Project/ercot_brownfield_expansion/ercot_3_zone_map.png -------------------------------------------------------------------------------- /Project/ercot_brownfield_expansion/readme.md: -------------------------------------------------------------------------------- 1 | Notes on this data set: 2 | 3 | This data set provides inputs for a brownfield capacity expansion planning study considering the Electricity Reliability Corporation of Texas (ERCOT) system representing a planning year of 2036. 4 | 5 | All inputs are generated by the open source [PowerGenome data platform](https://github.com/gschivley/PowerGenome#readme) from public data sources. Some PowerGenome output columns are renamed or removed as redundant. 6 | 7 | Existing generators are clustered based on heat rate and fixed O&M cost. 8 | 9 | There are 3 regions (see [accompanying map](ercot_3_zone_map.png) and time series data provided for various representative time periods -- 10 days, 4 weeks, 8 weeks, and 16 weeks (with hourly chronological resolution within each week) -- as well as a full year (52 weeks, 8,760 hours) time series. Each representative period represents 1 or more other days/weeks throughout the time series. The number of hours represented by each sample period is given by the Representative_Period_Weight input column in the Inputs_data.csv file. Representative weeks and weights are determined via K-means clustering to minimize error in wind, solar, hydropower and demand time series within each cluster as per Mallapragada et al. (2018), Impact of model resolution on scenario outcomes for electricity sector system expansion, Energy 163 (DOI: [https://doi.org/10.1016/j.energy.2018.08.015](https://doi.org/10.1016/j.energy.2018.08.015)) and always include the peak demand week. 10 | 11 | Demand profiles are based on historical 2012 profile and increased by a fixed percentage for all hours based on U.S. EIA Annual Energy Outlook 2020 projected demand growth for Texas through 2036. 12 | 13 | Renewables data profiles are from an open source data set available via PowerGenome under open source license from Vibrant Clean Energy, with 13-km continental United States resolution and are for weather year 2012. 14 | 15 | Technology costs are from NREL Annual Technology Baseline 2019 edition and represent the average of costs for the period 2021-2036. 16 | 17 | Transmission transfer limits from EPA IPM model. 18 | 19 | Data is provided without warranty for accuracy. 20 | 21 | Note this is the same data set as provided for [Notebook 07](https://github.com/east-winds/power-systems-optimization/blob/master/Notebooks/07-Complex-Capacity-Expansion.ipynb) and the columns are described in more detail there. A set of code for reading these inputs into Julia is also available there. -------------------------------------------------------------------------------- /Project/readme.md: -------------------------------------------------------------------------------- 1 | Project Datasets 2 | - 3 | 4 | Baseline data for a handful of systems geared toward different problem types are curated and posted here for use in class projects. For sources of these data and relevant license and usage information, please see the readme in each folder. If you find any errors, please notify the maintainers. 5 | 6 | 1. [ERCOT 120-bus 500kV simulated system for optimal power flow and economic dispatch problems](ercot_500kV/) 7 | 8 | 2. [ERCOT 3-zone 2040 brownfield expansion system for capacity expansion planning problems](ercot_brownfield_expansion) - (See [Notebook 7](https://github.com/east-winds/power-systems-optimization/blob/master/Notebooks/07-Complex-Capacity-Expansion.ipynb) for description) 9 | 10 | 3. [WECC 6-zone 2045 brownfield expansion system w/100% clean resources for capacity planning problems](wecc_2045_all_clean_expansion) 11 | 12 | 4. [WECC 12-zone 2020 current capacity for unit commitment and economic dispatch problems](wecc_2020_unit_commitment) -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/Input_descrptions_WECC_UC.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Project/wecc_2020_unit_commitment/Input_descrptions_WECC_UC.xlsx -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_large/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | mountain_reference_coal,1.820655,0.09552,2 4 | mountain_reference_naturalgas,2.686785,0.05306,3 5 | mountain_reference_uranium,0.678339,0,4 6 | pacific_reference_naturalgas,2.677787,0.05306,5 7 | pacific_reference_uranium,0.678339,0,6 8 | pacific_reference_coal,2.169001,0.09552,7 9 | pacific_reference_naturalgas_ccs90,3.155327,0.005306,8 10 | pacific_reference_naturalgas_ccs100,3.208387,0,9 11 | mountain_reference_naturalgas_ccs90,3.164325,0.005306,10 12 | mountain_reference_naturalgas_ccs100,3.217385,0,11 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_large/Network.csv: -------------------------------------------------------------------------------- 1 | Transmission Path Name,Network_lines,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,Line_Max_Flow_MW,Distance_mile,Line_Loss 2 | NorCal_to_SoCal,1,1,-1,0,0,0,0,0,0,0,0,0,0,3675,316.4091305,0.032 3 | NorCal_to_PNW,2,1,0,0,-1,0,0,0,0,0,0,0,0,4200,463.8916297,0.046 4 | NorCal_to_NV,3,1,0,0,0,0,0,-1,0,0,0,0,0,100,258.7420573,0.026 5 | SoCal_to_SD_IID,4,0,1,-1,0,0,0,0,0,0,0,0,0,1873,171.9427443,0.017 6 | SoCal_to_PNW,5,0,1,0,-1,0,0,0,0,0,0,0,0,2858,707.9777694,0.071 7 | SoCal_to_NV,6,0,1,0,0,0,0,-1,0,0,0,0,0,6697,285.1333947,0.029 8 | SoCal_to_AZ,7,0,1,0,0,0,0,0,-1,0,0,0,0,2884,333.3326013,0.033 9 | SoCal_to_UT,8,0,1,0,0,0,0,0,0,0,0,-1,0,1920,421.8766725,0.042 10 | SD_IID_to_AZ,9,0,0,1,0,0,0,0,-1,0,0,0,0,1910,265.5368024,0.027 11 | PNW_to_ID,10,0,0,0,1,-1,0,0,0,0,0,0,0,2850,312.0111856,0.031 12 | PNW_to_MT,11,0,0,0,1,0,-1,0,0,0,0,0,0,2000,451.74325,0.045 13 | PNW_to_NV,12,0,0,0,1,0,0,-1,0,0,0,0,0,300,450.9495824,0.045 14 | ID_to_MT,13,0,0,0,0,1,-1,0,0,0,0,0,0,325,267.8715136,0.027 15 | ID_to_NV,14,0,0,0,0,1,0,-1,0,0,0,0,0,350,330.4035099,0.033 16 | ID_to_WY,15,0,0,0,0,1,0,0,0,0,-1,0,0,3700,363.6135871,0.036 17 | ID_to_UT,16,0,0,0,0,1,0,0,0,0,0,-1,0,775,339.3199719,0.034 18 | MT_to_WY,17,0,0,0,0,0,1,0,0,0,-1,0,0,400,338.1795065,0.034 19 | NV_to_AZ,18,0,0,0,0,0,0,1,-1,0,0,0,0,4785,443.8385844,0.044 20 | NV_to_UT,19,0,0,0,0,0,0,1,0,0,0,-1,0,500,264.7120486,0.026 21 | AZ_to_NM,20,0,0,0,0,0,0,0,1,-1,0,0,0,2400,292.3912327,0.029 22 | AZ_to_UT,21,0,0,0,0,0,0,0,1,0,0,-1,0,250,347.1877847,0.035 23 | NM_to_UT,22,0,0,0,0,0,0,0,0,1,0,-1,0,350,439.3163003,0.044 24 | NM_to_CO,23,0,0,0,0,0,0,0,0,1,0,0,-1,664,319.1407085,0.032 25 | WY_to_UT,24,0,0,0,0,0,0,0,0,0,1,-1,0,1800,348.7511942,0.035 26 | WY_to_CO,25,0,0,0,0,0,0,0,0,0,1,0,-1,1400,291.4711078,0.029 27 | UT_to_CO,26,0,0,0,0,0,0,0,0,0,0,1,-1,650,328.1680237,0.033 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_medium/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | mountain_reference_coal,1.820655,0.09552,2 4 | mountain_reference_naturalgas,2.686785,0.05306,3 5 | mountain_reference_uranium,0.678339,0,4 6 | pacific_reference_naturalgas,2.677787,0.05306,5 7 | pacific_reference_uranium,0.678339,0,6 8 | pacific_reference_coal,2.169001,0.09552,7 9 | pacific_reference_naturalgas_ccs90,3.155327,0.005306,8 10 | pacific_reference_naturalgas_ccs100,3.208387,0,9 11 | mountain_reference_naturalgas_ccs90,3.164325,0.005306,10 12 | mountain_reference_naturalgas_ccs100,3.217385,0,11 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_medium/Network.csv: -------------------------------------------------------------------------------- 1 | Transmission Path Name,Network_lines,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,Line_Max_Flow_MW,Distance_mile,Line_Loss 2 | NorCal_to_SoCal,1,1,-1,0,0,0,0,0,0,0,0,0,0,3675,316.4091305,0.032 3 | NorCal_to_PNW,2,1,0,0,-1,0,0,0,0,0,0,0,0,4200,463.8916297,0.046 4 | NorCal_to_NV,3,1,0,0,0,0,0,-1,0,0,0,0,0,100,258.7420573,0.026 5 | SoCal_to_SD_IID,4,0,1,-1,0,0,0,0,0,0,0,0,0,1873,171.9427443,0.017 6 | SoCal_to_PNW,5,0,1,0,-1,0,0,0,0,0,0,0,0,2858,707.9777694,0.071 7 | SoCal_to_NV,6,0,1,0,0,0,0,-1,0,0,0,0,0,6697,285.1333947,0.029 8 | SoCal_to_AZ,7,0,1,0,0,0,0,0,-1,0,0,0,0,2884,333.3326013,0.033 9 | SoCal_to_UT,8,0,1,0,0,0,0,0,0,0,0,-1,0,1920,421.8766725,0.042 10 | SD_IID_to_AZ,9,0,0,1,0,0,0,0,-1,0,0,0,0,1910,265.5368024,0.027 11 | PNW_to_ID,10,0,0,0,1,-1,0,0,0,0,0,0,0,2850,312.0111856,0.031 12 | PNW_to_MT,11,0,0,0,1,0,-1,0,0,0,0,0,0,2000,451.74325,0.045 13 | PNW_to_NV,12,0,0,0,1,0,0,-1,0,0,0,0,0,300,450.9495824,0.045 14 | ID_to_MT,13,0,0,0,0,1,-1,0,0,0,0,0,0,325,267.8715136,0.027 15 | ID_to_NV,14,0,0,0,0,1,0,-1,0,0,0,0,0,350,330.4035099,0.033 16 | ID_to_WY,15,0,0,0,0,1,0,0,0,0,-1,0,0,3700,363.6135871,0.036 17 | ID_to_UT,16,0,0,0,0,1,0,0,0,0,0,-1,0,775,339.3199719,0.034 18 | MT_to_WY,17,0,0,0,0,0,1,0,0,0,-1,0,0,400,338.1795065,0.034 19 | NV_to_AZ,18,0,0,0,0,0,0,1,-1,0,0,0,0,4785,443.8385844,0.044 20 | NV_to_UT,19,0,0,0,0,0,0,1,0,0,0,-1,0,500,264.7120486,0.026 21 | AZ_to_NM,20,0,0,0,0,0,0,0,1,-1,0,0,0,2400,292.3912327,0.029 22 | AZ_to_UT,21,0,0,0,0,0,0,0,1,0,0,-1,0,250,347.1877847,0.035 23 | NM_to_UT,22,0,0,0,0,0,0,0,0,1,0,-1,0,350,439.3163003,0.044 24 | NM_to_CO,23,0,0,0,0,0,0,0,0,1,0,0,-1,664,319.1407085,0.032 25 | WY_to_UT,24,0,0,0,0,0,0,0,0,0,1,-1,0,1800,348.7511942,0.035 26 | WY_to_CO,25,0,0,0,0,0,0,0,0,0,1,0,-1,1400,291.4711078,0.029 27 | UT_to_CO,26,0,0,0,0,0,0,0,0,0,0,1,-1,650,328.1680237,0.033 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_small/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | mountain_reference_coal,1.820655,0.09552,2 4 | mountain_reference_naturalgas,2.686785,0.05306,3 5 | mountain_reference_uranium,0.678339,0,4 6 | pacific_reference_naturalgas,2.677787,0.05306,5 7 | pacific_reference_uranium,0.678339,0,6 8 | pacific_reference_coal,2.169001,0.09552,7 9 | pacific_reference_naturalgas_ccs90,3.155327,0.005306,8 10 | pacific_reference_naturalgas_ccs100,3.208387,0,9 11 | mountain_reference_naturalgas_ccs90,3.164325,0.005306,10 12 | mountain_reference_naturalgas_ccs100,3.217385,0,11 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/WECC_small/Network.csv: -------------------------------------------------------------------------------- 1 | Transmission Path Name,Network_lines,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,Line_Max_Flow_MW,Distance_mile,Line_Loss_Percentage 2 | NorCal_to_SoCal,1,1,-1,0,0,0,0,0,0,0,0,0,0,3675,316.4091305,0.032 3 | NorCal_to_PNW,2,1,0,0,-1,0,0,0,0,0,0,0,0,4200,463.8916297,0.046 4 | NorCal_to_NV,3,1,0,0,0,0,0,-1,0,0,0,0,0,100,258.7420573,0.026 5 | SoCal_to_SD_IID,4,0,1,-1,0,0,0,0,0,0,0,0,0,1873,171.9427443,0.017 6 | SoCal_to_PNW,5,0,1,0,-1,0,0,0,0,0,0,0,0,2858,707.9777694,0.071 7 | SoCal_to_NV,6,0,1,0,0,0,0,-1,0,0,0,0,0,6697,285.1333947,0.029 8 | SoCal_to_AZ,7,0,1,0,0,0,0,0,-1,0,0,0,0,2884,333.3326013,0.033 9 | SoCal_to_UT,8,0,1,0,0,0,0,0,0,0,0,-1,0,1920,421.8766725,0.042 10 | SD_IID_to_AZ,9,0,0,1,0,0,0,0,-1,0,0,0,0,1910,265.5368024,0.027 11 | PNW_to_ID,10,0,0,0,1,-1,0,0,0,0,0,0,0,2850,312.0111856,0.031 12 | PNW_to_MT,11,0,0,0,1,0,-1,0,0,0,0,0,0,2000,451.74325,0.045 13 | PNW_to_NV,12,0,0,0,1,0,0,-1,0,0,0,0,0,300,450.9495824,0.045 14 | ID_to_MT,13,0,0,0,0,1,-1,0,0,0,0,0,0,325,267.8715136,0.027 15 | ID_to_NV,14,0,0,0,0,1,0,-1,0,0,0,0,0,350,330.4035099,0.033 16 | ID_to_WY,15,0,0,0,0,1,0,0,0,0,-1,0,0,3700,363.6135871,0.036 17 | ID_to_UT,16,0,0,0,0,1,0,0,0,0,0,-1,0,775,339.3199719,0.034 18 | MT_to_WY,17,0,0,0,0,0,1,0,0,0,-1,0,0,400,338.1795065,0.034 19 | NV_to_AZ,18,0,0,0,0,0,0,1,-1,0,0,0,0,4785,443.8385844,0.044 20 | NV_to_UT,19,0,0,0,0,0,0,1,0,0,0,-1,0,500,264.7120486,0.026 21 | AZ_to_NM,20,0,0,0,0,0,0,0,1,-1,0,0,0,2400,292.3912327,0.029 22 | AZ_to_UT,21,0,0,0,0,0,0,0,1,0,0,-1,0,250,347.1877847,0.035 23 | NM_to_UT,22,0,0,0,0,0,0,0,0,1,0,-1,0,350,439.3163003,0.044 24 | NM_to_CO,23,0,0,0,0,0,0,0,0,1,0,0,-1,664,319.1407085,0.032 25 | WY_to_UT,24,0,0,0,0,0,0,0,0,0,1,-1,0,1800,348.7511942,0.035 26 | WY_to_CO,25,0,0,0,0,0,0,0,0,0,1,0,-1,1400,291.4711078,0.029 27 | UT_to_CO,26,0,0,0,0,0,0,0,0,0,0,1,-1,650,328.1680237,0.033 -------------------------------------------------------------------------------- /Project/wecc_2020_unit_commitment/readme.md: -------------------------------------------------------------------------------- 1 | Notes on this data set: 2 | 3 | This data set provides inputs for a unit commitment and/or economic dispatch study considering the existing generation in the Western Interconnection (Western Electricity Coordinating Council or WECC) circa 2020. 4 | 5 | All inputs are generated by the open source [PowerGenome data platform](https://github.com/gschivley/PowerGenome#readme) from public data sources. Some PowerGenome output columns are renamed or removed as redundant. 6 | 7 | Existing generators are clustered at varying levels of resolution (in the Large, Medium, and Small versions) based on heat rate and fixed O&M cost. 8 | 9 | There are 12 regions (see zonal ID list and map in the [Input_descrptions_WECC_UC.xlsx](Input_descrptions_WECC_UC.xlsx) file) and time series data provided for an entire year. 10 | 11 | Demand profiles are based on 2012 weather year and are increased to 2020 values based on EIA Annual Energy Outlook data. 12 | 13 | Renewables data profiles are from an open source data set available via PowerGenome under open source license from Vibrant Clean Energy, with 13-km continental United States resolution and are for weather year 2012 14 | 15 | Technology costs are from NREL Annual Technology Baseline 2019 edition. 16 | 17 | Transmission transfer limits from EPA IPM model. 18 | 19 | Data is provided without warranty for accuracy. -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/Input_descriptions_WECC_expansion.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Project/wecc_2045_all_clean_expansion/Input_descriptions_WECC_expansion.xlsx -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | Index,Cluster 2 | 1,11 3 | 2,13 4 | 3,6 5 | 4,6 6 | 5,13 7 | 6,12 8 | 7,2 9 | 8,7 10 | 9,7 11 | 10,4 12 | 11,9 13 | 12,4 14 | 13,9 15 | 14,15 16 | 15,15 17 | 16,15 18 | 17,15 19 | 18,3 20 | 19,8 21 | 20,3 22 | 21,3 23 | 22,3 24 | 23,3 25 | 24,3 26 | 25,3 27 | 26,3 28 | 27,8 29 | 28,8 30 | 29,14 31 | 30,14 32 | 31,8 33 | 32,1 34 | 33,16 35 | 34,8 36 | 35,1 37 | 36,10 38 | 37,10 39 | 38,1 40 | 39,10 41 | 40,10 42 | 41,12 43 | 42,4 44 | 43,10 45 | 44,12 46 | 45,5 47 | 46,5 48 | 47,5 49 | 48,11 50 | 49,11 51 | 50,11 52 | 51,6 53 | 52,2 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Flexible_demand_data.csv: -------------------------------------------------------------------------------- 1 | ID,Zone_name,Zone,Load_type,Max_Capacity_MW,Max_Delay_Hrs 2 | 1,CA_N,1,ev_load_shifting,7498.595,5 3 | 2,CA_S,2,ev_load_shifting,10523.132,5 4 | 3,WECC_N,3,ev_load_shifting,3946.495,5 5 | 4,WECC_NMAZ,4,ev_load_shifting,7852.402,5 6 | 5,WECC_PNW,5,ev_load_shifting,8967.414,5 7 | 6,WECC_WYCO,6,ev_load_shifting,5226.18,5 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Flexible_load_data.csv: -------------------------------------------------------------------------------- 1 | ID,Zone_name,Zone,Load_type,Max_Capacity_MW,Max_Delay_Hrs 2 | 1,CA_N,1,ev_load_shifting,7498.595,5 3 | 2,CA_S,2,ev_load_shifting,10523.132,5 4 | 3,WECC_N,3,ev_load_shifting,3946.495,5 5 | 4,WECC_NMAZ,4,ev_load_shifting,7852.402,5 6 | 5,WECC_PNW,5,ev_load_shifting,8967.414,5 7 | 6,WECC_WYCO,6,ev_load_shifting,5226.18,5 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | rockies_uranium,0.69,0,2 4 | pacific_naturalgas_ccs90,4.48,0.00531,3 5 | pacific_uranium,0.69,0,4 6 | pacific_naturalgas_ccs100,4.53,0,5 7 | rockies_naturalgas_ccs90,4.78,0.00531,6 8 | rockies_naturalgas_ccs100,4.83,0,7 9 | biogas,33,0,8 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Transmission Path Name,Network_lines,z1,z2,z3,z4,z5,z6,Line_Max_Flow_MW,Distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | CA_N_to_CA_S,1,1,-1,0,0,0,0,3675,333.6,0.0334,3675,90280 3 | CA_N_to_WECC_N,2,1,0,-1,0,0,0,100,490.7,0.0491,100,92347 4 | CA_S_to_WECC_N,3,0,1,-1,0,0,0,1920,555.9,0.0556,1400,104618 5 | CA_S_to_WECC_NMAZ,4,0,1,0,-1,0,0,10464,446.7,0.0447,10464,84067 6 | WECC_N_to_WECC_NMAZ,5,0,0,1,-1,0,0,800,598.8,0.0599,740,63333 7 | WECC_N_to_WECC_WYCO,6,0,0,1,0,0,-1,6350,384.3,0.0384,4150,40646 8 | WECC_NMAZ_to_WECC_WYCO,7,0,0,0,1,0,-1,664,485.2,0.0485,664,51318 9 | CA_N_to_WECC_PNW,8,1,0,0,0,-1,0,4200,249.5,0.025,3675,46955 10 | CA_S_to_WECC_PNW,9,0,1,0,0,-1,0,2858,401.5,0.0402,2858,75560 11 | WECC_N_to_WECC_PNW,10,0,0,1,0,-1,0,5150,478.5,0.0479,5150,50609 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/high_electrification_16_weeks/Zones.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones 2 | CA_N,z1 3 | CA_S,z2 4 | WECC_N,z3 5 | WECC_NMAZ,z4 6 | WECC_PNW,z5 7 | WECC_WYCO,z6 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/readme.md: -------------------------------------------------------------------------------- 1 | Notes on this data set: 2 | 3 | This data set provides inputs for a capacity expansion planning study considering options for a 100% carbon-free electricity system across the U.S. portion of the Western Interconnection (Western Electricity Coordinating Council or WECC). 4 | 5 | All inputs are generated by the open source [PowerGenome data platform](https://github.com/gschivley/PowerGenome#readme) from public data sources. Some PowerGenome output columns are renamed or removed as redundant. 6 | 7 | Only carbon-free resources are included in the candidate generation/storage options. Existing renewable energy, hydropower, pumped hydro storage, and nuclear power capacity is included across all states, but carbon-emitting existing resources are not included in the data set. Natural gas plants with CCS at 100% capture rate are included in the new build options by default, but less costly plants with 90% capture rate are also provided as an alternative option (users must switch New_Build flag = 0 8 | 9 | There are 6 regions (see [accompanying map](wecc_6_zone_map.png) and time series data provided for 16 representative weeks (with hourly chronological resolution within each week). Each representative period represents 1 or more other weeks throughout the time series. The number of hours represented by each 168 hour 7 day period is given by the Representative_Period_Weight input column in the Inputs_data.csv file. Representative weeks and weights are determined via K-means clustering to minimize error in wind, solar, hydropower and demand time series within each cluster as per Mallapragada et al. (2018), Impact of model resolution on scenario outcomes for electricity sector system expansion, Energy 163 (DOI: [https://doi.org/10.1016/j.energy.2018.08.015](https://doi.org/10.1016/j.energy.2018.08.015)) and always include the peak demand week. 10 | 11 | We provide two sets of inputs with different demand levels: a reference electrification case and a high electrification case. Demand profiles are from the NREL 2018 [Electrification Futures Study](https://www.nrel.gov/docs/fy18osti/70485.pdf) and are based on weather year 2012. 12 | 13 | Renewables data profiles are from an open source data set available via PowerGenome under open source license from Vibrant Clean Energy, with 13-km continental United States resolution and are for weather year 2012 14 | 15 | Technology costs are from NREL Annual Technology Baseline 2019 edition. 16 | 17 | Transmission transfer limits from EPA IPM model. 18 | 19 | Data is provided without warranty for accuracy. -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/reference_electrification_16_weeks/Cluster_order.csv: -------------------------------------------------------------------------------- 1 | Index,Cluster 2 | 1,11 3 | 2,13 4 | 3,6 5 | 4,6 6 | 5,13 7 | 6,12 8 | 7,2 9 | 8,7 10 | 9,7 11 | 10,4 12 | 11,9 13 | 12,4 14 | 13,9 15 | 14,15 16 | 15,15 17 | 16,15 18 | 17,15 19 | 18,3 20 | 19,8 21 | 20,3 22 | 21,3 23 | 22,3 24 | 23,3 25 | 24,3 26 | 25,3 27 | 26,3 28 | 27,8 29 | 28,8 30 | 29,14 31 | 30,14 32 | 31,8 33 | 32,1 34 | 33,16 35 | 34,8 36 | 35,1 37 | 36,10 38 | 37,10 39 | 38,1 40 | 39,10 41 | 40,10 42 | 41,12 43 | 42,4 44 | 43,10 45 | 44,12 46 | 45,5 47 | 46,5 48 | 47,5 49 | 48,11 50 | 49,11 51 | 50,11 52 | 51,6 53 | 52,2 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/reference_electrification_16_weeks/Flexible_load_data.csv: -------------------------------------------------------------------------------- 1 | ID,Zone_name,Zone,Load_type,Max_Capacity_MW,Max_Delay_Hrs 2 | 1,CA_N,1,ev_load_shifting,559.626,5 3 | 2,CA_S,2,ev_load_shifting,785.349,5 4 | 3,WECC_N,3,ev_load_shifting,447.022,5 5 | 4,WECC_NMAZ,4,ev_load_shifting,903.914,5 6 | 5,WECC_PNW,5,ev_load_shifting,688.733,5 7 | 6,WECC_WYCO,6,ev_load_shifting,415.601,5 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/reference_electrification_16_weeks/Fuels_data.csv: -------------------------------------------------------------------------------- 1 | Fuel,Cost_per_MMBtu,CO2_content_tons_per_MMBtu,fuel_indices 2 | None,0,0,1 3 | rockies_uranium,0.69,0,2 4 | pacific_naturalgas_ccs90,4.48,0.00531,3 5 | pacific_uranium,0.69,0,4 6 | pacific_naturalgas_ccs100,4.53,0,5 7 | rockies_naturalgas_ccs90,4.78,0.00531,6 8 | rockies_naturalgas_ccs100,4.83,0,7 9 | biogas,33,0,8 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/reference_electrification_16_weeks/Network.csv: -------------------------------------------------------------------------------- 1 | Transmission Path Name,Network_lines,z1,z2,z3,z4,z5,z6,Line_Max_Flow_MW,Distance_mile,Line_Loss_Percentage,Line_Max_Reinforcement_MW,Line_Reinforcement_Cost_per_MW_yr 2 | CA_N_to_CA_S,1,1,-1,0,0,0,0,3675,333.6,0.0334,3675,90280 3 | CA_N_to_WECC_N,2,1,0,-1,0,0,0,100,490.7,0.0491,100,92347 4 | CA_S_to_WECC_N,3,0,1,-1,0,0,0,1920,555.9,0.0556,1400,104618 5 | CA_S_to_WECC_NMAZ,4,0,1,0,-1,0,0,10464,446.7,0.0447,10464,84067 6 | WECC_N_to_WECC_NMAZ,5,0,0,1,-1,0,0,800,598.8,0.0599,740,63333 7 | WECC_N_to_WECC_WYCO,6,0,0,1,0,0,-1,6350,384.3,0.0384,4150,40646 8 | WECC_NMAZ_to_WECC_WYCO,7,0,0,0,1,0,-1,664,485.2,0.0485,664,51318 9 | CA_N_to_WECC_PNW,8,1,0,0,0,-1,0,4200,249.5,0.025,3675,46955 10 | CA_S_to_WECC_PNW,9,0,1,0,0,-1,0,2858,401.5,0.0402,2858,75560 11 | WECC_N_to_WECC_PNW,10,0,0,1,0,-1,0,5150,478.5,0.0479,5150,50609 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/reference_electrification_16_weeks/Zones.csv: -------------------------------------------------------------------------------- 1 | Region description,Network_zones 2 | CA_N,z1 3 | CA_S,z2 4 | WECC_N,z3 5 | WECC_NMAZ,z4 6 | WECC_PNW,z5 7 | WECC_WYCO,z6 -------------------------------------------------------------------------------- /Project/wecc_2045_all_clean_expansion/wecc_6_zone_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Project/wecc_2045_all_clean_expansion/wecc_6_zone_map.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Power Systems Optimization 2 | - 3 | 4 | [![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/east-winds/power-systems-optimization/mybinder) 5 | 6 | These course materials are jointly developed by [Michael Davidson](http://mdavidson.org/) and [Jesse Jenkins](https://mae.princeton.edu/people/faculty/jenkins) for introducing constrained optimization models applied to power systems. The materials will be used for: 7 | - [MAE / ENE 539](https://registrar.princeton.edu/course-offerings/course-details?term=1212&courseid=008273) Optimization Methods for Energy Systems Engineering (Advanced Topics in Combustion I) [Princeton] 8 | - [MAE 243](https://catalog.ucsd.edu/courses/MAE.html#mae243) Electric Power Systems Modeling [UC San Diego] 9 | 10 | ### Description 11 | 12 | This course will teach students constrained optimization problems and associated solution methods, how to implement and apply linear and mixed integer linear programs to solve such problems using [Julia](https://julialang.org/)/[JuMP](https://jump.dev/JuMP.jl/dev/), and the practical application of such techniques in energy systems engineering. 13 | 14 | The course will first introduce students to the theory and mathematics of constrained optimization problems and provide a brief introduction to linear programming, including problem formation and solution algorithms. 15 | 16 | Next, to build hands-on experience with optimization methods for energy systems engineering, the course will introduce students to several canonical problems in electric power systems planning and operations, including: economic dispatch, unit commitment, optimal network power flow, and capacity planning. 17 | 18 | Finally, several datasets of realistic power systems are provided which students will use in conjunction with building a model for a course project that answers a specific power systems question. 19 | 20 | ### Notebooks 21 | 22 | 1. [Constrained Optimization](Notebooks/01-Constrained-Optimization.ipynb) 23 | 24 | 2. [Using Julia and JuMP for Constrained Optimization](Notebooks/02-Anatomy-of-a-Model.ipynb) 25 | 26 | 3. [Basic Capacity Expansion Planning](Notebooks/03-Basic-Capacity-Expansion.ipynb) 27 | 28 | 4. [Economic Dispatch](Notebooks/04-Economic-Dispatch.ipynb) 29 | 30 | 5. [Unit Commitment](Notebooks/05-Unit-Commitment.ipynb) 31 | 32 | 6. [DC Optimal Network Power Flow](Notebooks/06-Optimal-Power-Flow.ipynb) 33 | 34 | 7. [Complex Capacity Expansion Planning](Notebooks/07-Complex-Capacity-Expansion.ipynb) 35 | 36 | ### Homeworks 37 | 38 | 1. [Homework 1 - Building Your First Model](Homeworks/Homework-01.ipynb) 39 | 40 | 2. [Homework 2 - Basic Capacity Expansion](Homeworks/Homework-02.ipynb) 41 | 42 | 3. [Homework 3 - Unit Commitment](Homeworks/Homework-03.ipynb) 43 | 44 | 4. [Homework 4 - Optimal Power Flow](Homeworks/Homework-04.ipynb) 45 | 46 | 5. [Homework 5 - Complex Capacity Expansion](Homeworks/Homework-05.ipynb) 47 | 48 | ### Project 49 | 50 | [Project dataset descriptions](Project/) 51 | 52 | 1. [ERCOT 120-bus 500kV simulated system for optimal power flow and economic dispatch problems](Project/ercot_500kV/) 53 | 54 | 2. [ERCOT 3-zone 2040 brownfield expansion system for capacity expansion planning problems](Project/ercot_brownfield_expansion) - (See [Notebook 7](Notebooks/07-Complex-Capacity-Expansion.ipynb) for description) 55 | 56 | 3. [WECC 6-zone 2045 brownfield expansion system w/100% clean resources for capacity planning problems](Project/wecc_2045_all_clean_expansion) 57 | 58 | 4. [WECC 12-zone 2020 current capacity for unit commitment and economic dispatch problems](Project/wecc_2020_unit_commitment) 59 | 60 | ### Tutorials 61 | 62 | 1. [Julia Tutorial](Tutorials/julia_tutorial.ipynb) 63 | 64 | 2. [JuMP: Diagnosing infeasible models](Tutorials/jump_infeasibilities.ipynb) 65 | 66 | 3. [Debugging a Julia script with VS Code](Tutorials/Debugging%20with%20VS%20Code.md) 67 | 68 | 69 | ### License and copyright 70 | 71 | If you would like to use these materials, please see the [license and copyright page](LICENSE.md). 72 | 73 | 74 | -------------------------------------------------------------------------------- /Tutorials/Debugging with VS Code.md: -------------------------------------------------------------------------------- 1 | ## Debugging a Julia script with VS Code 2 | 3 | - Download and Install [VS Code](https://code.visualstudio.com/) 4 | - Install Julia extension for VS Code https://www.julia-vscode.org/ 5 | 6 | *Note*: make sure to correctly set the `julia.executablePath` on VS Code `settings` to point to the Julia executable (`julia.exe` for MS Windows, `julia` for Unix and MacOS). You can follow the instructions on the main page of the Julia extension for VS Code. 7 | 8 | #### Outline: 9 | 10 | 1. Debugging the precompilation of a Julia package; 11 | 2. Usage of the Integrated Julia REPL 12 | 3. Debugging a script or a module 13 | 14 | #### Practice: 15 | 16 | Try to debug and fix the script: `exercise_debugging.jl` inside `Tutorials`. 17 | 18 | -------------------------------------------------------------------------------- /Tutorials/example8.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Power-Systems-Optimization-Course/power-systems-optimization/1c55475988c6de1ffc7f905f024cd548284ea436/Tutorials/example8.csv.gz -------------------------------------------------------------------------------- /Tutorials/exercise_debugging.jl: -------------------------------------------------------------------------------- 1 | using JuMP 2 | using HiGHS 3 | 4 | 5 | # function to calculate upper and lower bound of variable x 6 | function compute_xbounds() 7 | A = [-0.10 1.0; 0.35 -0.17] 8 | b = [8.4,-1.4] 9 | x = A \ b 10 | convert.(Int64,round(x)) 11 | end 12 | 13 | # function to build a JuMP model with a specific optimizer 14 | function build_model(optimizer) 15 | Model = Model() 16 | set_optimizer(Model, optimizer) 17 | return Model 18 | end 19 | 20 | # function to define the variables x and y of the JuMP model and set upper and lower bound of x 21 | function set_variables(model::GenericModel{Float64}, x_lower_bound::Float64, x_upper_bound::Float64) 22 | @variable(model, x) 23 | @variable(model, y) 24 | 25 | set_lower_bound(x, x_lower_bound) 26 | set_upper_bound(x, x_upper_bound) 27 | 28 | return (x,y) 29 | end 30 | 31 | # function to define the constraints of the JuMP model 32 | function set_constraints(model::GenericModel{Float64}, x::VariableRef, y::VariableRef) 33 | @constraints(model, 34 | begin 35 | time_constraint, 10x + 8y <= 80 36 | materials_constraint, 7x + 11y <= 77 37 | end) 38 | end 39 | 40 | # function to define the objective of the JuMP model 41 | function set_objective(model::GenericModel{Float64}, x::VariableRef, y::VariableRef) 42 | @expression(model, objective, 150x + 175y) 43 | @objective(model, max, objective) 44 | end 45 | 46 | 47 | # workflow 48 | x_lower_bound, x_upper_bound = compute_xbounds() # x-bounds calculation 49 | model = build_model(HiGHS.Optimizer) # JuMP model definition 50 | x, y = set_variables(model, x_lower_bound, x_upper_bound) # variables definition 51 | set_constraints(model, x, y) # constraints definition 52 | set_objective(model, x, y) # objective definition 53 | optimize!(model) # model optimization 54 | print(model) -------------------------------------------------------------------------------- /Tutorials/jump_infeasibilities.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# JuMP: Diagnosing infeasible models\n", 8 | "\n", 9 | "Notebooks 1 and 2 define basic objects in JuMP such as variables, constraints, and expressions. This tutorial builds further to discuss how to diagnose infeasible models." 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "## Install Gurobi\n", 17 | "\n", 18 | "Diagnosing infeasibilities is much easier with an advanced solver such as Gurobi, which has the ability to find infeasible constraints for you. A solver such as Gurobi will also be helpful for solving larger models later in the class, and for your final project.\n", 19 | "\n", 20 | "Let's start by installing a Gurobi academic license. To start, first go to https://www.gurobi.com and click \"Register\" at the top right to create an account. Follow through the steps to confirm your account. Then, once you are logged in, click \"Licenses\", click \"Request\", and generate a \"Named-User Academic\" license. Follow the steps to install the license. Once a license is installed, you can run \"gurobi_cl\" in the command line to check that the license was installed correctly.\n", 21 | "\n", 22 | "Next, open Julia and install the Gurobi package. Once it is installed, you can continue with the rest of this notebook." 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "## Diagnosing an infeasible model\n", 30 | "\n", 31 | "Let's start with the same factory optimization example from notebook 2. We are going to purposefully add an infeasible constraint, and then figure out how to diagnose it." 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": 46, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "using JuMP\n", 41 | "using Gurobi" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 47, 47 | "metadata": {}, 48 | "outputs": [ 49 | { 50 | "name": "stdout", 51 | "output_type": "stream", 52 | "text": [ 53 | "Set parameter Username\n", 54 | "Academic license - for non-commercial use only - expires 2024-09-14\n" 55 | ] 56 | }, 57 | { 58 | "data": { 59 | "text/latex": [ 60 | "$$ \\begin{aligned}\n", 61 | "\\max\\quad & 150 x + 175 y\\\\\n", 62 | "\\text{Subject to} \\quad & 10 x + 8 y \\leq 80\\\\\n", 63 | " & 7 x + 11 y \\leq 77\\\\\n", 64 | " & x \\geq 0\\\\\n", 65 | " & y \\geq 0\\\\\n", 66 | " & x \\leq 8\\\\\n", 67 | "\\end{aligned} $$" 68 | ] 69 | }, 70 | "metadata": {}, 71 | "output_type": "display_data" 72 | } 73 | ], 74 | "source": [ 75 | "factory_model = Model(Gurobi.Optimizer);\n", 76 | "@variables(factory_model, begin\n", 77 | " 8 >= x >= 0\n", 78 | " y >= 0\n", 79 | " end)\n", 80 | "@constraints(factory_model, begin\n", 81 | " time_constraint, 10x + 8y <= 80\n", 82 | " materials_constraint, 7x + 11y <= 77 \n", 83 | " end)\n", 84 | "@expression(factory_model, objective, 150x + 175y)\n", 85 | "@objective(factory_model, Max, objective)\n", 86 | "print(factory_model)\n" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": 42, 92 | "metadata": {}, 93 | "outputs": [ 94 | { 95 | "name": "stdout", 96 | "output_type": "stream", 97 | "text": [ 98 | "Gurobi Optimizer version 10.0.2 build v10.0.2rc0 (mac64[arm])\n", 99 | "\n", 100 | "CPU model: Apple M2\n", 101 | "Thread count: 8 physical cores, 8 logical processors, using up to 8 threads\n", 102 | "\n", 103 | "Optimize a model with 2 rows, 2 columns and 4 nonzeros\n", 104 | "Model fingerprint: 0x3b4095a3\n", 105 | "Coefficient statistics:\n", 106 | " Matrix range [7e+00, 1e+01]\n", 107 | " Objective range [2e+02, 2e+02]\n", 108 | " Bounds range [8e+00, 8e+00]\n", 109 | " RHS range [8e+01, 8e+01]\n", 110 | "Presolve time: 0.00s\n", 111 | "Presolved: 2 rows, 2 columns, 4 nonzeros\n", 112 | "\n", 113 | "Iteration Objective Primal Inf. Dual Inf. Time\n", 114 | " 0 1.7500000e+32 1.187500e+30 1.750000e+02 0s\n", 115 | " 2 1.4138889e+03 0.000000e+00 0.000000e+00 0s\n", 116 | "\n", 117 | "Solved in 2 iterations and 0.00 seconds (0.00 work units)\n", 118 | "Optimal objective 1.413888889e+03\n", 119 | "\n", 120 | "User-callback calls 47, time in user-callback 0.00 sec\n" 121 | ] 122 | } 123 | ], 124 | "source": [ 125 | "optimize!(factory_model)" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "execution_count": 43, 131 | "metadata": {}, 132 | "outputs": [ 133 | { 134 | "data": { 135 | "text/plain": [ 136 | "(4.888888888888888, 3.888888888888889)" 137 | ] 138 | }, 139 | "execution_count": 43, 140 | "metadata": {}, 141 | "output_type": "execute_result" 142 | } 143 | ], 144 | "source": [ 145 | "value.(x), value.(y)" 146 | ] 147 | }, 148 | { 149 | "cell_type": "markdown", 150 | "metadata": {}, 151 | "source": [ 152 | "Now, let's try adding a constraint that is clearly in conflict with the constraint x<=8. What happens when we solve the model?" 153 | ] 154 | }, 155 | { 156 | "cell_type": "code", 157 | "execution_count": 44, 158 | "metadata": {}, 159 | "outputs": [ 160 | { 161 | "data": { 162 | "text/latex": [ 163 | "$$ \\begin{aligned}\n", 164 | "\\max\\quad & 150 x + 175 y\\\\\n", 165 | "\\text{Subject to} \\quad & x \\geq 10\\\\\n", 166 | " & 10 x + 8 y \\leq 80\\\\\n", 167 | " & 7 x + 11 y \\leq 77\\\\\n", 168 | " & x \\geq 0\\\\\n", 169 | " & y \\geq 0\\\\\n", 170 | " & x \\leq 8\\\\\n", 171 | "\\end{aligned} $$" 172 | ] 173 | }, 174 | "metadata": {}, 175 | "output_type": "display_data" 176 | } 177 | ], 178 | "source": [ 179 | "@constraint(factory_model,test_constraint,x>=10) ;\n", 180 | "\n", 181 | "print(factory_model)" 182 | ] 183 | }, 184 | { 185 | "cell_type": "code", 186 | "execution_count": 45, 187 | "metadata": {}, 188 | "outputs": [ 189 | { 190 | "name": "stdout", 191 | "output_type": "stream", 192 | "text": [ 193 | "Gurobi Optimizer version 10.0.2 build v10.0.2rc0 (mac64[arm])\n", 194 | "\n", 195 | "CPU model: Apple M2\n", 196 | "Thread count: 8 physical cores, 8 logical processors, using up to 8 threads\n", 197 | "\n", 198 | "Optimize a model with 3 rows, 2 columns and 5 nonzeros\n", 199 | "Coefficient statistics:\n", 200 | " Matrix range [1e+00, 1e+01]\n", 201 | " Objective range [2e+02, 2e+02]\n", 202 | " Bounds range [8e+00, 8e+00]\n", 203 | " RHS range [1e+01, 8e+01]\n", 204 | "Iteration Objective Primal Inf. Dual Inf. Time\n", 205 | " 0 1.4138889e+03 5.111111e+00 0.000000e+00 0s\n", 206 | "\n", 207 | "Solved in 1 iterations and 0.00 seconds (0.00 work units)\n", 208 | "Infeasible model\n", 209 | "\n", 210 | "User-callback calls 20, time in user-callback 0.00 sec\n" 211 | ] 212 | } 213 | ], 214 | "source": [ 215 | "optimize!(factory_model)" 216 | ] 217 | }, 218 | { 219 | "cell_type": "markdown", 220 | "metadata": {}, 221 | "source": [ 222 | "### Diagnosing the problem" 223 | ] 224 | }, 225 | { 226 | "cell_type": "markdown", 227 | "metadata": {}, 228 | "source": [ 229 | "Gurobi is reporting that we have an \"Infeasible model.\" This means that there is nowhere in the space of decision variables where all the constraints are obeyed. We can figure out which constraints in particular are causing the infeasibility by running \"compute_conflict!\" on the model, and printing out the results:" 230 | ] 231 | }, 232 | { 233 | "cell_type": "code", 234 | "execution_count": 39, 235 | "metadata": {}, 236 | "outputs": [ 237 | { 238 | "name": "stdout", 239 | "output_type": "stream", 240 | "text": [ 241 | "\n", 242 | "IIS computed: 1 constraints and 1 bounds\n", 243 | "IIS runtime: 0.00 seconds (0.00 work units)\n" 244 | ] 245 | }, 246 | { 247 | "data": { 248 | "text/latex": [ 249 | "$$ \\begin{aligned}\n", 250 | "\\max\\quad & 150 x + 175 y\\\\\n", 251 | "\\text{Subject to} \\quad & x \\geq 10\\\\\n", 252 | " & x \\leq 8\\\\\n", 253 | "\\end{aligned} $$" 254 | ] 255 | }, 256 | "metadata": {}, 257 | "output_type": "display_data" 258 | } 259 | ], 260 | "source": [ 261 | "compute_conflict!(factory_model) ;\n", 262 | "\n", 263 | "if get_attribute(factory_model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND\n", 264 | " iis_model, _ = copy_conflict(factory_model)\n", 265 | " print(iis_model)\n", 266 | "end" 267 | ] 268 | }, 269 | { 270 | "cell_type": "markdown", 271 | "metadata": {}, 272 | "source": [ 273 | "Voila! Gurobi has identified the set of constraints that are leading to the infeasibility. In this context it was obvious where the infeasibility came from, but in larger models it can be quite difficult to identify what you did wrong, which is why this method is helpful." 274 | ] 275 | } 276 | ], 277 | "metadata": { 278 | "kernelspec": { 279 | "display_name": "Julia 1.9.3", 280 | "language": "julia", 281 | "name": "julia-1.9" 282 | }, 283 | "language_info": { 284 | "file_extension": ".jl", 285 | "mimetype": "application/julia", 286 | "name": "julia", 287 | "version": "1.9.3" 288 | } 289 | }, 290 | "nbformat": 4, 291 | "nbformat_minor": 4 292 | } 293 | --------------------------------------------------------------------------------