{ "cells": [ { "cell_type": "markdown", "source": [ "# Simulations with TAMU data and [PowerSimulations.jl](https://github.com/NREL/PowerSimulations.jl)" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Originally Contributed by**: Clayton Barrows" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Introduction" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "This is a basic simulation example using the [TAMU Cases](https://electricgrids.engr.tamu.edu/)." ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Dependencies" ], "metadata": {} }, { "outputs": [], "cell_type": "code", "source": [ "using SIIPExamples\n", "pkgpath = dirname(dirname(pathof(SIIPExamples)))\n", "using Dates" ], "metadata": {}, "execution_count": 1 }, { "cell_type": "markdown", "source": [ "### Modeling Packages" ], "metadata": {} }, { "outputs": [], "cell_type": "code", "source": [ "using PowerSystems\n", "using PowerSimulations\n", "using PowerSystemCaseBuilder" ], "metadata": {}, "execution_count": 2 }, { "cell_type": "markdown", "source": [ "### Optimization packages\n", "For this simple example, we can use the Cbc solver with a relatively relaxed tolerance." ], "metadata": {} }, { "outputs": [ { "output_type": "execute_result", "data": { "text/plain": "MathOptInterface.OptimizerWithAttributes(Cbc.Optimizer, Pair{MathOptInterface.AbstractOptimizerAttribute,Any}[MathOptInterface.RawParameter(\"logLevel\") => 1, MathOptInterface.RawParameter(\"ratioGap\") => 0.5])" }, "metadata": {}, "execution_count": 3 } ], "cell_type": "code", "source": [ "using Cbc #solver\n", "solver = optimizer_with_attributes(Cbc.Optimizer, \"logLevel\" => 1, \"ratioGap\" => 0.5)" ], "metadata": {}, "execution_count": 3 }, { "cell_type": "markdown", "source": [ "### Create a `System` from TAMU data\n", "We have included some of the TAMU cases (with truncated time series info)\n", "in the PowerSystemCaseBuilder testing, so we can just use that." ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "┌ Info: Building new system tamu_ACTIVSg2000_sys from raw data\n", "└ sys_descriptor.raw_data = \"/Users/cbarrows/.julia/packages/PowerSystemCaseBuilder/UaGGi/data\"\n", "[ Info: The PSS(R)E parser currently supports buses, loads, shunts, generators, branches, transformers, and dc lines\n", "[ Info: Switched shunt converted to fixed shunt, with default value gs=0.0\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2243 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1881 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1907 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2923 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 599 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2491 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 228 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2590 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2579 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1880 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2562 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1106 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2366 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 3196 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1783 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 928 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 859 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1863 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 561 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1825 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2631 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2714 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 3157 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 815 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 981 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1429 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 39 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2713 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 112 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 3153 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1665 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 590 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 17 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 333 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 550 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 341 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 664 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 912 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1598 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2509 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 598 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 14 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 613 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 1052 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2334 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 510 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2166 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2585 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 2127 to +/- 60.0 deg.\n", "[ Info: angmin and angmax values are 0, widening these values on branch 197 to +/- 60.0 deg.\n", "[ Info: reversing the orientation of branch 36 (1071, 1019) to be consistent with other parallel branches\n", "[ Info: no active generators found at bus 6144, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8070, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6273, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 4096, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 4098, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 4138, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2084, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 5089, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 5023, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1049, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2005, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 3044, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8060, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6271, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1081, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 5107, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8033, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2104, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 7121, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2095, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 3043, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2006, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 2056, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8115, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8047, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6272, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8036, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 5035, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6007, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6259, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 7122, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 7284, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 3133, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 4137, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1076, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 4163, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8152, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1059, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8061, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8051, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1057, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8034, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1062, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 5066, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1048, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 1077, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 6052, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 8147, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 7034, updating to bus type from 2 to 1\n", "[ Info: no active generators found at bus 7025, updating to bus type from 2 to 1\n", "[ Info: the voltage setpoint on generator 306 does not match the value at bus 6166\n", "[ Info: the voltage setpoint on generator 407 does not match the value at bus 7166\n", "[ Info: the voltage setpoint on generator 1 does not match the value at bus 1004\n", "[ Info: the voltage setpoint on generator 54 does not match the value at bus 2076\n", "[ Info: the voltage setpoint on generator 519 does not match the value at bus 8050\n", "[ Info: the voltage setpoint on generator 101 does not match the value at bus 3095\n", "[ Info: the voltage setpoint on generator 371 does not match the value at bus 7063\n", "[ Info: the voltage setpoint on generator 41 does not match the value at bus 2004\n", "[ Info: the voltage setpoint on generator 464 does not match the value at bus 7361\n", "[ Info: the voltage setpoint on generator 65 does not match the value at bus 2104\n", "[ Info: the voltage setpoint on generator 475 does not match the value at bus 7379\n", "[ Info: the voltage setpoint on generator 447 does not match the value at bus 7325\n", "[ Info: the voltage setpoint on generator 335 does not match the value at bus 6297\n", "[ Info: the voltage setpoint on generator 362 does not match the value at bus 7025\n", "[ Info: the voltage setpoint on generator 505 does not match the value at bus 7428\n", "[ Info: the voltage setpoint on generator 491 does not match the value at bus 7422\n", "[ Info: the voltage setpoint on generator 326 does not match the value at bus 6268\n", "[ Info: the voltage setpoint on generator 543 does not match the value at bus 8158\n", "[ Info: the voltage setpoint on generator 299 does not match the value at bus 6145\n", "[ Info: the voltage setpoint on generator 168 does not match the value at bus 4181\n", "[ Info: the voltage setpoint on generator 159 does not match the value at bus 4138\n", "[ Info: the voltage setpoint on generator 403 does not match the value at bus 7162\n", "[ Info: the voltage setpoint on generator 228 does not match the value at bus 5325\n", "[ Info: the voltage setpoint on generator 332 does not match the value at bus 6274\n", "[ Info: the voltage setpoint on generator 190 does not match the value at bus 5041\n", "[ Info: the voltage setpoint on generator 227 does not match the value at bus 5324\n", "[ Info: the voltage setpoint on generator 270 does not match the value at bus 6049\n", "[ Info: the voltage setpoint on generator 536 does not match the value at bus 8130\n", "[ Info: the voltage setpoint on generator 476 does not match the value at bus 7389\n", "[ Info: the voltage setpoint on generator 223 does not match the value at bus 5303\n", "[ Info: the voltage setpoint on generator 453 does not match the value at bus 7350\n", "[ Info: the voltage setpoint on generator 531 does not match the value at bus 8099\n", "[ Info: the voltage setpoint on generator 88 does not match the value at bus 3060\n", "[ Info: the voltage setpoint on generator 467 does not match the value at bus 7371\n", "[ Info: the voltage setpoint on generator 297 does not match the value at bus 6111\n", "[ Info: the voltage setpoint on generator 26 does not match the value at bus 1072\n", "[ Info: the voltage setpoint on generator 289 does not match the value at bus 6087\n", "[ Info: the voltage setpoint on generator 250 does not match the value at bus 5418\n", "[ Info: the voltage setpoint on generator 77 does not match the value at bus 3020\n", "[ Info: the voltage setpoint on generator 230 does not match the value at bus 5342\n", "[ Info: the voltage setpoint on generator 449 does not match the value at bus 7329\n", "[ Info: the voltage setpoint on generator 394 does not match the value at bus 7135\n", "[ Info: the voltage setpoint on generator 258 does not match the value at bus 5444\n", "[ Info: the voltage setpoint on generator 328 does not match the value at bus 6270\n", "[ Info: the voltage setpoint on generator 204 does not match the value at bus 5167\n", "[ Info: the voltage setpoint on generator 387 does not match the value at bus 7113\n", "[ Info: the voltage setpoint on generator 23 does not match the value at bus 1063\n", "[ Info: the voltage setpoint on generator 160 does not match the value at bus 4142\n", "[ Info: the voltage setpoint on generator 416 does not match the value at bus 7193\n", "[ Info: the voltage setpoint on generator 450 does not match the value at bus 7334\n", "┌ Info: Constructing System from Power Models\n", "│ data[\"name\"] = \"activsg2000\"\n", "└ data[\"source_type\"] = \"pti\"\n", "[ Info: Reading bus data\n", "[ Info: Reading generator data\n", "[ Info: Reading branch data\n", "┌ Warning: Rate 149.0 MW for BEN WHEELE~1-8020-GRAND SALI~1-8029-i_2243 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for HOUSTON 14 0-7144-SOUTH HOUS~1-7119-i_1881 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for LA PORTE 0 -7419-LAPORTE 2 -7132-i_1907 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 409.0 MW for DENTON 1 1 -5165-DENTON 4 0 -5007-i_599 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for CAMP WOOD 0 -3010-BRACKETTVI~5-3076-i_228 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for SPRING 4 0 -7118-HOUSTON 57 0-7404-i_1880 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for LITTLE ELM 0-5277-DENTON 6 0 -5315-i_1106 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 443.0 MW for TEXAS CITY~1-7171-GALVESTON ~1-7073-i_1783 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for DESOTO 0 -5157-DUNCANVILL~1-5194-i_928 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for ROSEBUD 0 -5159-MARLIN 0 -5123-i_859 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for SPRING 6 0 -7290-TOMBALL 1 0 -7102-i_1863 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 170.0 MW for REFUGIO 0 -4173-ROCKPORT 0 -4149-i_561 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for RICHMOND 2 0-7088-WALLIS 0 -7116-i_1825 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 310.0 MW for FORT WORT~28-5104-BURLESON 1 -5480-i_815 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 251.0 MW for CARROLLTON~1-5188-DALLAS 35 0 -5203-i_981 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for MANOR 0 -6181-TAYLOR 0 -6116-i_1429 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for BIG SPRING~3-1084-BIG SPRING~1-1020-i_39 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for CHILDRESS 0 -2014-SILVERTON 0 -2029-i_112 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for CHANNELVIE~7-7368-HOUSTON 9 0 -7016-i_1665 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for TOLAR 0 -5133-LIPAN 0 -5005-i_590 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for PRESIDIO 1 0-1010-MARFA 0 -1015-i_17 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for KEMPNER 0 -3108-BERTRAM 0 -6065-i_333 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for PEARSALL 1 -4132-DILLEY 0 -4143-i_550 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 100.0 MW for BOERNE 2 1 -6286-FREDERICKS~1-3124-i_341 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 251.0 MW for PRINCETON 0 -5031-MCKINNEY 1 1-5296-i_664 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for IRVING 5 0 -5148-COLLEYVILL~1-5457-i_912 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 647.0 MW for ELMENDORF 1 -6240-SAN ANTON~45-6287-i_1598 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 251.0 MW for DENTON 4 0 -5007-DENTON 5 0 -5012-i_598 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for FORT DAVIS 0-1031-VAN HORN 0 -1007-i_14 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for EARLY 0 -5013-COMANCHE 0 -5101-i_613 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 2020.0 MW for COPPERAS C~1-5451-GOLDTHWAIT~1-5239-i_1052 is larger than the max expected in the range of (min = 850.0, max = 1075.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 170.0 MW for BRYAN 3 0 -8120-COLLEGE ST~4-8140-i_2334 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for CORPUS CH~12-4150-CORPUS CH~10-4100-i_510 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for FRIENDSWOO~1-7317-ALVIN 2 -7424-i_2166 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 548.0 MW for BAY CITY 0 -7261-FREEPORT 2 1-7429-i_2127 is larger than the max expected in the range of (min = 134.0, max = 145.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 251.0 MW for SHERMAN 2 0 -2107-TIOGA 0 -2125-i_197 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for CALDWELL 1 -6193-LEXINGTON 0 -6206-i_1545 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for CUSHING 2 0 -8062-CUSHING 1 1 -8098-i_2288 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for MCALLEN 3 0 -4027-PHARR 0 -4088-i_401 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for MILES 0 -3072-BALLINGER 0 -3040-i_276 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for HOUSTON 8 0 -7174-HOUSTON 7 0 -7231-i_1973 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for MONAHANS 2 0-1013-FORT DAVIS 0-1031-i_21 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for NEEDVILLE 0 -7339-DAMON 0 -7247-i_2096 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 2300.0 MW for ROSCOE 5 2 -3048-ODESSA 1 8 -1079-i_83 is larger than the max expected in the range of (min = 850.0, max = 1075.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 100.0 MW for BAYTOWN 1 2 -7206-PORT BOLIV~1-7294-i_2025 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for AUSTIN 30 0 -6186-AUSTIN 1 2 -6351-i_1540 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 187.0 MW for ZEPHYR 0 -5226-GOLDTHWAIT~6-5129-i_871 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 98.0 MW for CEDAR CREE~3-6294-CEDAR CREE~7-6339-i_1615 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 149.0 MW for ATHENS 1 0 -8053-TRINIDAD 2 0-8065-i_2276 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "┌ Warning: Rate 221.0 MW for FORT HOOD 0 -5081-KILLEEN 2 0 -5377-i_751 is larger than the max expected in the range of (min = 47.0, max = 52.0).\n", "└ @ PowerSystems ~/.julia/packages/PowerSystems/4kGrw/src/utils/IO/branchdata_checks.jl:148\n", "[ Info: Reading branch data\n", "[ Info: Reading DC Line data\n", "[ Info: Reading storage data\n", "[ Info: Serialized time series data to /Users/cbarrows/.julia/packages/PowerSystemCaseBuilder/UaGGi/data/serialized_system/ForecastOnly/tamu_ACTIVSg2000_sys_time_series_storage.h5.\n", "[ Info: Serialized System to /Users/cbarrows/.julia/packages/PowerSystemCaseBuilder/UaGGi/data/serialized_system/ForecastOnly/tamu_ACTIVSg2000_sys.json\n" ] } ], "cell_type": "code", "source": [ "sys = build_system(PSYTestSystems, \"tamu_ACTIVSg2000_sys\")\n", "\n", "horizon = 24;\n", "interval = Dates.Hour(24);\n", "transform_single_time_series!(sys, horizon, interval);" ], "metadata": {}, "execution_count": 4 }, { "cell_type": "markdown", "source": [ "## Run a PCM\n", "note that the TAMU data doesn't contain startup and shutdown costs, or minimum up/down\n", "time limits, so a UC problem merely respects minmum generation levels." ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "┌ Warning: No Feedforward Chronologies have been defined. This configuration assummes that there is no information passing between problems\n", "└ @ PowerSimulations ~/.julia/packages/PowerSimulations/A1Nao/src/core/simulation_sequence.jl:103\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "Feed Forward Chronology\n-----------------------\n\nInitial Condition Chronology\n----------------------------\n\n1\n\n" }, "metadata": {}, "execution_count": 5 } ], "cell_type": "code", "source": [ "sim_folder = mkpath(joinpath(pkgpath, \"TAMU-sim\"))\n", "problems = SimulationProblems(\n", " UC = OperationsProblem(\n", " template_unit_commitment(transmission = CopperPlatePowerModel),\n", " sys,\n", " optimizer = solver,\n", " ),\n", ")\n", "intervals = Dict(\"UC\" => (Hour(24), Consecutive()))\n", "DA_sequence = SimulationSequence(\n", " problems = problems,\n", " intervals = intervals,\n", " ini_cond_chronology = IntraProblemChronology(),\n", ")" ], "metadata": {}, "execution_count": 5 }, { "cell_type": "markdown", "source": [ "### Define and build a simulation" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "┌ Info: \n", "│ ──────────────────────────────────────────────────────────────────────────────\n", "│ Time Allocations \n", "│ ────────────────────── ───────────────────────\n", "│ Tot / % measured: 5.47s / 100% 1.65GiB / 100% \n", "│ \n", "│ Section ncalls time %tot avg alloc %tot avg\n", "│ ──────────────────────────────────────────────────────────────────────────────\n", "│ Build Simulation 1 5.47s 100% 5.47s 1.65GiB 100% 1.65GiB\n", "│ Build Problems 1 5.33s 97.4% 5.33s 1.62GiB 98.3% 1.62GiB\n", "│ Problem UC 1 5.33s 97.4% 5.33s 1.62GiB 98.3% 1.62GiB\n", "│ PowerLoad 1 1.17s 21.3% 1.17s 110MiB 6.50% 110MiB\n", "│ ThermalStandard 1 595ms 10.9% 595ms 283MiB 16.7% 283MiB\n", "│ Build pre-step 1 51.2ms 0.94% 51.2ms 6.01MiB 0.36% 6.01MiB\n", "│ CopperPlateP... 1 42.1ms 0.77% 42.1ms 27.0MiB 1.60% 27.0MiB\n", "│ Objective 1 1.23ms 0.02% 1.23ms 971KiB 0.06% 971KiB\n", "│ Services 1 130μs 0.00% 130μs 10.4KiB 0.00% 10.4KiB\n", "│ HydroDispatch 1 71.2μs 0.00% 71.2μs 4.58KiB 0.00% 4.58KiB\n", "│ RenewableFix 1 65.8μs 0.00% 65.8μs 4.58KiB 0.00% 4.58KiB\n", "│ RenewableDis... 1 18.6μs 0.00% 18.6μs 4.63KiB 0.00% 4.63KiB\n", "│ HydroEnergyR... 1 17.2μs 0.00% 17.2μs 4.70KiB 0.00% 4.70KiB\n", "│ Interruptibl... 1 16.1μs 0.00% 16.1μs 4.63KiB 0.00% 4.63KiB\n", "│ Line 1 4.66μs 0.00% 4.66μs 64.0B 0.00% 64.0B\n", "│ HVDCLine 1 1.56μs 0.00% 1.56μs 64.0B 0.00% 64.0B\n", "│ Transformer2W 1 1.10μs 0.00% 1.10μs 64.0B 0.00% 64.0B\n", "│ TapTransformer 1 968ns 0.00% 968ns 64.0B 0.00% 64.0B\n", "│ Serializing Simu... 1 97.9ms 1.79% 97.9ms 20.7MiB 1.22% 20.7MiB\n", "│ Assign FeedForward 1 32.9ms 0.60% 32.9ms 7.44MiB 0.44% 7.44MiB\n", "│ Initialize Simul... 1 8.52ms 0.16% 8.52ms 320KiB 0.02% 320KiB\n", "│ Check Steps 1 37.7μs 0.00% 37.7μs 1.61KiB 0.00% 1.61KiB\n", "└ ──────────────────────────────────────────────────────────────────────────────\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "BuildStatus.BUILT = 0" }, "metadata": {}, "execution_count": 6 } ], "cell_type": "code", "source": [ "sim = Simulation(\n", " name = \"TAMU-test\",\n", " steps = 3,\n", " problems = problems,\n", " sequence = DA_sequence,\n", " simulation_folder = sim_folder,\n", ")\n", "\n", "build!(sim)" ], "metadata": {}, "execution_count": 6 }, { "cell_type": "markdown", "source": [ "### Execute the simulation" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\rProgress: 33%|█████████████▋ | ETA: 0:00:58\u001b[K\r\n", " Step: 1\u001b[K\r\n", " problem: UC\u001b[K\r\n", " Simulation Timestamp: 2016-01-01T00:00:00\u001b[K\r\u001b[A\r\u001b[A\r\u001b[A\n", "\n", "\n", "\r\u001b[K\u001b[A\r\u001b[K\u001b[A\r\u001b[K\u001b[A\rProgress: 67%|███████████████████████████▍ | ETA: 0:00:29\u001b[K\r\n", " Step: 2\u001b[K\r\n", " problem: UC\u001b[K\r\n", " Simulation Timestamp: 2016-01-02T00:00:00\u001b[K\r\u001b[A\r\u001b[A\r\u001b[A\n", "\n", "\n", "\r\u001b[K\u001b[A\r\u001b[K\u001b[A\r\u001b[K\u001b[A\rProgress: 100%|█████████████████████████████████████████| Time: 0:01:26\u001b[K\r\n", " Step: 3\u001b[K\r\n", " problem: UC\u001b[K\r\n", " Simulation Timestamp: 2016-01-03T00:00:00\u001b[K\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "RunStatus.SUCCESSFUL = 0" }, "metadata": {}, "execution_count": 7 } ], "cell_type": "code", "source": [ "execute!(sim)" ], "metadata": {}, "execution_count": 7 }, { "cell_type": "markdown", "source": [ "### Load and analyze results" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ Info: checking integrity of /Users/cbarrows/Documents/repos/SIIPExamples.jl/TAMU-sim/TAMU-test/20/data_store/simulation_store.h5\n", "[ Info: reading variables from data store\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "\u001b[1m72×545 DataFrame\u001b[0m\n\u001b[1m Row \u001b[0m│\u001b[1m DateTime \u001b[0m\u001b[1m generator-1004-1 \u001b[0m\u001b[1m generator-1006-1 \u001b[0m\u001b[1m generator-1009\u001b[0m ⋯\n\u001b[1m \u001b[0m│\u001b[90m DateTime \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Float64 \u001b[0m ⋯\n─────┼──────────────────────────────────────────────────────────────────────────\n 1 │ 2016-01-01T00:00:00 1.0 1.0 1 ⋯\n 2 │ 2016-01-01T01:00:00 1.0 1.0 1\n 3 │ 2016-01-01T02:00:00 1.0 1.0 1\n 4 │ 2016-01-01T03:00:00 1.0 1.0 1\n 5 │ 2016-01-01T04:00:00 1.0 1.0 1 ⋯\n 6 │ 2016-01-01T05:00:00 1.0 1.0 1\n 7 │ 2016-01-01T06:00:00 1.0 1.0 1\n 8 │ 2016-01-01T07:00:00 1.0 1.0 1\n ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋱\n 66 │ 2016-01-03T17:00:00 1.0 1.0 1 ⋯\n 67 │ 2016-01-03T18:00:00 1.0 1.0 1\n 68 │ 2016-01-03T19:00:00 1.0 1.0 1\n 69 │ 2016-01-03T20:00:00 1.0 1.0 1\n 70 │ 2016-01-03T21:00:00 1.0 1.0 1 ⋯\n 71 │ 2016-01-03T22:00:00 1.0 1.0 1\n 72 │ 2016-01-03T23:00:00 1.0 1.0 1\n\u001b[36m 542 columns and 57 rows omitted\u001b[0m", "text/html": [ "

72 rows × 545 columns (omitted printing of 540 columns)

DateTimegenerator-1004-1generator-1006-1generator-1009-1generator-1011-1
DateTimeFloat64Float64Float64Float64
12016-01-01T00:00:001.01.01.01.0
22016-01-01T01:00:001.01.01.01.0
32016-01-01T02:00:001.01.01.01.0
42016-01-01T03:00:001.01.01.01.0
52016-01-01T04:00:001.01.01.01.0
62016-01-01T05:00:001.01.01.01.0
72016-01-01T06:00:001.01.01.01.0
82016-01-01T07:00:001.01.01.01.0
92016-01-01T08:00:001.01.01.01.0
102016-01-01T09:00:001.01.01.01.0
112016-01-01T10:00:001.01.01.01.0
122016-01-01T11:00:001.01.01.01.0
132016-01-01T12:00:001.01.01.01.0
142016-01-01T13:00:001.01.01.01.0
152016-01-01T14:00:001.01.01.01.0
162016-01-01T15:00:001.01.01.01.0
172016-01-01T16:00:001.01.01.01.0
182016-01-01T17:00:001.01.01.01.0
192016-01-01T18:00:001.01.01.01.0
202016-01-01T19:00:001.01.01.01.0
212016-01-01T20:00:001.01.01.01.0
222016-01-01T21:00:001.01.01.01.0
232016-01-01T22:00:001.01.01.01.0
242016-01-01T23:00:001.01.01.01.0
" ] }, "metadata": {}, "execution_count": 8 } ], "cell_type": "code", "source": [ "sim_results = SimulationResults(sim);\n", "uc_results = get_problem_results(sim_results, \"UC\")\n", "read_realized_variables(uc_results, names = [:On__ThermalStandard])[:On__ThermalStandard]" ], "metadata": {}, "execution_count": 8 }, { "cell_type": "markdown", "source": [ "---\n", "\n", "*This notebook was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*" ], "metadata": {} } ], "nbformat_minor": 3, "metadata": { "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.5.2" }, "kernelspec": { "name": "julia-1.5", "display_name": "Julia 1.5.2", "language": "julia" } }, "nbformat": 4 }