Originally Contributed by: Clayton Barrows
This is a basic simulation example using the TAMU Cases.
using SIIPExamples
pkgpath = dirname(dirname(pathof(SIIPExamples)))
using Dates
using PowerSystems
using PowerSimulations
using PowerSystemCaseBuilder
For this simple example, we can use the Cbc solver with a relatively relaxed tolerance.
using Cbc #solver
solver = optimizer_with_attributes(Cbc.Optimizer, "logLevel" => 1, "ratioGap" => 0.5)
MathOptInterface.OptimizerWithAttributes(Cbc.Optimizer, Pair{MathOptInterface.AbstractOptimizerAttribute,Any}[MathOptInterface.RawParameter("logLevel") => 1, MathOptInterface.RawParameter("ratioGap") => 0.5])
System
from TAMU data¶We have included some of the TAMU cases (with truncated time series info) in the PowerSystemCaseBuilder testing, so we can just use that.
sys = build_system(PSYTestSystems, "tamu_ACTIVSg2000_sys")
horizon = 24;
interval = Dates.Hour(24);
transform_single_time_series!(sys, horizon, interval);
[ Info: Loaded time series from storage file existing=tamu_ACTIVSg2000_sys_time_series_storage.h5 new=/var/folders/27/2jr8c7gn4j72fvrg4qt81zrw8w_711/T/jl_MwJA7D ┌ Warning: Rate 221.0 MW for PASADENA 2 2-7004-DEER PARK 2 -7106-i_1641 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for PRAIRIE VI~1-7010-PATTISON 0 -7182-i_1647 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 251.0 MW for GORDON 0 -5190-DE LEON 0 -5264-i_989 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for AUSTIN 3 2 -6040-AUSTIN 25 0 -6019-i_1268 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ 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). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 250.0 MW for ABILENE 6 0 -3077-TUSOCOLA 0 -3131-i_313 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for AUSTIN 6 0 -6018-AUSTIN 2 2 -6256-i_1265 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for SANTA FE 1 0-7213-TEXAS CITY~3-7273-i_2026 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 187.0 MW for GRAPEVINE 0 -5245-SOUTHLAKE 0 -5339-i_1057 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for EDEN 0 -3132-MASON 0 -3075-i_310 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for MISSOURI C~1-7052-RICHMOND 1 0-7053-i_1742 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 300.0 MW for MISSION 3 0 -4079-MISSION 4 1 -4040-i_436 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 2020.0 MW for KATY 3 0 -7341-WHARTON 1 0 -7304-i_2154 is larger than the max expected in the range of (min = 850.0, max = 1075.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 250.0 MW for SUGAR LAND~1-7087-SUGAR LAND~4-7127-i_1816 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 300.0 MW for HOUSTON 4 2 -7188-HOUSTON 39 0-7255-i_2012 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for SAN ANTON~14-6220-SAN ANTON~37-6121-i_1437 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.0 MW for CONROE 5 0 -7035-WILLIS 1 1 -7390-i_1702 is larger than the max expected in the range of (min = 134.0, max = 145.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ 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). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 187.0 MW for FARMERSVIL~1-5408-JOSEPHINE 0 -5421-i_1206 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for HOUSTON 2 0 -7145-CROSBY 0 -7243-i_1921 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for CUERO 2 1 -6173-YOAKUM 1 -6031-i_1305 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 187.0 MW for KOPPERL 0 -5247-WALNUT SPR~1-5209-i_1009 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for JACKSONVIL~7-8121-RUSK 0 -8055-i_2281 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for SAN ANGELO~3-3130-BIG LAKE 0 -1044-i_64 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for SIMONTON 0 -7012-WALLIS 0 -7116-i_1652 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 548.0 MW for ROCKDALE 1 1-6108-PFLUGERVIL~2-6034-i_1310 is larger than the max expected in the range of (min = 134.0, max = 145.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for GOODFELLOW~1-3142-MILES 0 -3072-i_306 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 750.0 MW for ALBANY 1 1 -5395-ABILENE 1 0 -3088-i_319 is larger than the max expected in the range of (min = 134.0, max = 145.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 310.0 MW for LEWISVILLE~4-5370-FLOWER MOU~1-5253-i_1072 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 750.0 MW for SARITA 1 0 -4140-CORPUS CH~18-4080-i_498 is larger than the max expected in the range of (min = 134.0, max = 145.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 149.0 MW for DEL RIO 1 -3051-SANDERSON 0 -1012-i_20 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 149.0 MW for LOS FRESNO~1-4110-SAN BENITO 0-4171-i_523 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for ETOILE 0 -8022-GARRISON 0 -8021-i_2247 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for HOUSTON 18 0-7100-HOUSTON 24 0-7222-i_1857 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for GREGORY 1 -4057-PORTLAND 0 -4145-i_466 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 409.0 MW for FORT WORT~16-5027-FORT WORT~17-5098-i_652 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for HOUSTON 91 0-7396-KATY 2 1 -7410-i_2189 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 310.0 MW for GRAND PRAI~1-5145-DALLAS 2 1 -5323-i_899 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 187.0 MW for HUBBARD 0 -5211-DAWSON 0 -5275-i_1012 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for SAN ANTON~67-6043-SAN ANTON~72-6236-i_1334 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 251.0 MW for LANCASTER ~1-5109-RED OAK 0 -5333-i_828 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for LAPORTE 2 -7132-BAYTOWN 3 1 -7283-i_1904 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for SAN ANTON~68-6026-SAN ANTON~54-6182-i_1291 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 310.0 MW for PLANO 2 0 -5010-PLANO 1 0 -5096-i_606 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 149.0 MW for JOURDANTON 0-4117-CHARLOTTE 0 -4016-i_379 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 2768.0 MW for LAPORTE 0 -7130-DEER PARK 0 -7104-i_1866 is larger than the max expected in the range of (min = 850.0, max = 1075.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for BIG SPRIN~13-1067-BIG SPRING~8-1005-i_12 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 98.0 MW for HOLLAND 1 -5459-ROGERS 1 -5391-i_1204 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 251.0 MW for TELEPHONE 0 -2122-BONHAM 0 -2030-i_134 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148 ┌ Warning: Rate 221.0 MW for HOUSTON 83 0-7221-HOUSTON 84 0-7220-i_2045 is larger than the max expected in the range of (min = 47.0, max = 52.0). └ @ PowerSystems ~/.julia/packages/PowerSystems/N2l8o/src/utils/IO/branchdata_checks.jl:148
note that the TAMU data doesn't contain startup and shutdown costs, or minimum up/down time limits, so a UC problem merely respects minmum generation levels.
sim_folder = mkpath(joinpath(pkgpath, "TAMU-sim"))
problems = SimulationProblems(
UC = OperationsProblem(
template_unit_commitment(transmission = CopperPlatePowerModel),
sys,
optimizer = solver,
),
)
intervals = Dict("UC" => (Hour(24), Consecutive()))
DA_sequence = SimulationSequence(
problems = problems,
intervals = intervals,
ini_cond_chronology = IntraProblemChronology(),
)
┌ Warning: No Feedforward Chronologies have been defined. This configuration assummes that there is no information passing between problems └ @ PowerSimulations ~/.julia/packages/PowerSimulations/DWqCz/src/core/simulation_sequence.jl:103
Feed Forward Chronology ----------------------- Initial Condition Chronology ---------------------------- 1
sim = Simulation(
name = "TAMU-test",
steps = 3,
problems = problems,
sequence = DA_sequence,
simulation_folder = sim_folder,
)
build!(sim)
┌ Info: │ ────────────────────────────────────────────────────────────────────────────── │ Time Allocations │ ────────────────────── ─────────────────────── │ Tot / % measured: 5.74s / 100% 1.68GiB / 100% │ │ Section ncalls time %tot avg alloc %tot avg │ ────────────────────────────────────────────────────────────────────────────── │ Build Simulation 1 5.74s 100% 5.74s 1.68GiB 100% 1.68GiB │ Build Problems 1 5.64s 98.3% 5.64s 1.66GiB 98.8% 1.66GiB │ Problem UC 1 5.64s 98.3% 5.64s 1.66GiB 98.8% 1.66GiB │ PowerLoad 1 1.13s 19.6% 1.13s 110MiB 6.38% 110MiB │ ThermalStandard 1 524ms 9.14% 524ms 283MiB 16.4% 283MiB │ CopperPlateP... 1 48.9ms 0.85% 48.9ms 27.1MiB 1.58% 27.1MiB │ Build pre-step 1 2.68ms 0.05% 2.68ms 1.13MiB 0.07% 1.13MiB │ Objective 1 1.20ms 0.02% 1.20ms 971KiB 0.06% 971KiB │ Services 1 130μs 0.00% 130μs 10.4KiB 0.00% 10.4KiB │ RenewableFix 1 72.4μs 0.00% 72.4μs 4.58KiB 0.00% 4.58KiB │ HydroDispatch 1 59.1μs 0.00% 59.1μs 4.58KiB 0.00% 4.58KiB │ RenewableDis... 1 28.7μs 0.00% 28.7μs 4.63KiB 0.00% 4.63KiB │ HydroEnergyR... 1 20.3μs 0.00% 20.3μs 4.70KiB 0.00% 4.70KiB │ Interruptibl... 1 18.8μs 0.00% 18.8μs 4.63KiB 0.00% 4.63KiB │ Line 1 5.04μs 0.00% 5.04μs 64.0B 0.00% 64.0B │ TapTransformer 1 1.71μs 0.00% 1.71μs 64.0B 0.00% 64.0B │ HVDCLine 1 1.58μs 0.00% 1.58μs 64.0B 0.00% 64.0B │ Transformer2W 1 1.44μs 0.00% 1.44μs 64.0B 0.00% 64.0B │ Serializing Simu... 1 93.8ms 1.63% 93.8ms 20.5MiB 1.19% 20.5MiB │ Initialize Simul... 1 2.54ms 0.04% 2.54ms 22.3KiB 0.00% 22.3KiB │ Check Steps 1 22.5μs 0.00% 22.5μs 1.61KiB 0.00% 1.61KiB │ Assign FeedForward 1 7.71μs 0.00% 7.71μs 1.11KiB 0.00% 1.11KiB └ ──────────────────────────────────────────────────────────────────────────────
BuildStatus.BUILT = 0
execute!(sim)
Progress: 33%|█████████████▋ | ETA: 0:00:58 Step: 1 problem: UC Progress: 67%|███████████████████████████▍ | ETA: 0:00:29 Step: 2 problem: UC Progress: 100%|█████████████████████████████████████████| Time: 0:01:28 Step: 3 problem: UC Simulation Timestamp: 2016-01-03T00:00:00
RunStatus.SUCCESSFUL = 0
sim_results = SimulationResults(sim);
uc_results = get_problem_results(sim_results, "UC")
read_realized_variables(uc_results, names = [:On__ThermalStandard])[:On__ThermalStandard]
[ Info: checking integrity of /Users/cbarrows/Documents/repos/SIIPExamples.jl/TAMU-sim/TAMU-test/21/data_store/simulation_store.h5 [ Info: reading variables from data store
DateTime | generator-1004-1 | generator-1006-1 | generator-1009-1 | generator-1011-1 | |
---|---|---|---|---|---|
DateTime | Float64 | Float64 | Float64 | Float64 | |
1 | 2016-01-01T00:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
2 | 2016-01-01T01:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
3 | 2016-01-01T02:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
4 | 2016-01-01T03:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
5 | 2016-01-01T04:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
6 | 2016-01-01T05:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
7 | 2016-01-01T06:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
8 | 2016-01-01T07:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
9 | 2016-01-01T08:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
10 | 2016-01-01T09:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
11 | 2016-01-01T10:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
12 | 2016-01-01T11:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
13 | 2016-01-01T12:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
14 | 2016-01-01T13:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
15 | 2016-01-01T14:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
16 | 2016-01-01T15:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
17 | 2016-01-01T16:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
18 | 2016-01-01T17:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
19 | 2016-01-01T18:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
20 | 2016-01-01T19:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
21 | 2016-01-01T20:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
22 | 2016-01-01T21:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
23 | 2016-01-01T22:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
24 | 2016-01-01T23:00:00 | 1.0 | 1.0 | 1.0 | 1.0 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
This notebook was generated using Literate.jl.