diff --git a/CHANGELOG.md b/CHANGELOG.md index f442edec3..0154dd1eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ Classify the change according to the following categories: ##### Deprecated ##### Removed ### Patches + +## v2.3.1 +### Minor Updates +##### Fixed +Lookback charge parameters expected from the URDB API call were changed to the non-caplitalized format, so they are now used properly. ## v2.3.0 ### Minor Updates diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index b00302cbb..6e2281a4c 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -17,9 +17,9 @@ version = "3.4.0" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] -git-tree-sha1 = "65cdad9f49e0d2fec6b6abc80668ca49c034824b" +git-tree-sha1 = "83b8798c00f556c0a8ac89cad7bde716a28fe9c9" uuid = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3" -version = "0.9.1" +version = "0.9.2" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -73,9 +73,9 @@ version = "0.5.1" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "dc4405cee4b2fe9e1108caec2d760b7ea758eca2" +git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.15.5" +version = "1.15.6" [[deps.ChangesOfVariables]] deps = ["ChainRulesCore", "LinearAlgebra", "Test"] @@ -114,9 +114,9 @@ uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" version = "0.12.8" [[deps.CommonSolve]] -git-tree-sha1 = "332a332c97c7071600984b3c31d9067e1a4e6e25" +git-tree-sha1 = "9441451ee712d1aec22edad62db1a9af3dc8d852" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.1" +version = "0.2.3" [[deps.CommonSubexpressions]] deps = ["MacroTools", "Test"] @@ -126,9 +126,9 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "5856d3031cdb1f3b2b6340dfdc66b6d9a149a374" +git-tree-sha1 = "3ca828fe1b75fa84b021a7860bd039eaea84d2f2" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.2.0" +version = "4.3.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -153,9 +153,9 @@ uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" version = "6.4.2+0" [[deps.DataAPI]] -git-tree-sha1 = "1106fa7e1256b402a86a8e7b15c00c85036fef49" +git-tree-sha1 = "46d2680e618f8abd007bce0c3026cb0c4a8f2032" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.11.0" +version = "1.12.0" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] @@ -177,28 +177,28 @@ deps = ["Mmap"] uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" [[deps.DiffResults]] -deps = ["StaticArrays"] -git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805" +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.0.3" +version = "1.1.0" [[deps.DiffRules]] deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "992a23afdb109d0d2f8802a30cf5ae4b1fe7ea68" +git-tree-sha1 = "8b7a4d23e22f5d44883671da70865ca98f2ebf9d" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.11.1" +version = "1.12.0" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "230d999fc78652ea070312373ed1bfe2489e4fe5" +git-tree-sha1 = "bd0543363fc8ceac0c9fb24d38783ffffd95c20c" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.6" +version = "0.3.7" [[deps.DocStringExtensions]] deps = ["LibGit2"] -git-tree-sha1 = "5158c2b41018c5f7eb1470d558127ac274eca0c9" +git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.1" +version = "0.9.2" [[deps.Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] @@ -217,9 +217,9 @@ version = "0.1.1" [[deps.FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "94f5101b96d2d968ace56f7f2db19d0a5f592e28" +git-tree-sha1 = "7be5f99f7d15578798f338f5433b6c432ea8037b" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.15.0" +version = "1.16.0" [[deps.FixedPointNumbers]] deps = ["Statistics"] @@ -286,9 +286,9 @@ version = "0.1.0" [[deps.HDF5]] deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"] -git-tree-sha1 = "899f041bf330ebeead3637073b2ca7477760edde" +git-tree-sha1 = "19effd6b5af759c8aaeb9c77f89422d3f975ab65" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.11" +version = "0.16.12" [[deps.HDF5_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -325,9 +325,9 @@ version = "0.6.2" [[deps.InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "b3364212fb5d870f724876ffcd34dd8ec6d98918" +git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.7" +version = "0.1.8" [[deps.IrrationalConstants]] git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" @@ -444,9 +444,9 @@ version = "1.9.3+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf" +git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.9" +version = "0.5.10" [[deps.MappedArrays]] git-tree-sha1 = "e8b359ef06ec72e8c030463fe02efe5527ee5142" @@ -465,9 +465,9 @@ version = "0.9.22" [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] -git-tree-sha1 = "6872f9594ff273da6d13c7c1a1545d5a8c7d0c1c" +git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.1.6" +version = "1.1.7" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] @@ -501,9 +501,9 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "1ea784113a6aa054c5ebd95945fa5e52c2f378e7" +git-tree-sha1 = "f71d8950b724e9ff6110fc948dff5a329f901d64" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.7" +version = "1.12.8" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -550,9 +550,9 @@ version = "0.5.11" [[deps.Parsers]] deps = ["Dates"] -git-tree-sha1 = "3d5bf43e3e8b412656404ed9466f1dcbf7c50269" +git-tree-sha1 = "6c01a9b494f6d2a9fc180a08b182fcb06f0958a0" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.4.0" +version = "2.4.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -578,9 +578,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CoolProp", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "4b2e8b7ec3bc44a68c7a58c20bc42a04ced820e0" +git-tree-sha1 = "70e34138a437cb1a224646c45e230f90ae2d7283" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.20.0" +version = "0.20.1" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -592,9 +592,10 @@ uuid = "b3c3ace0-ae52-54e7-9d0b-2c1406fd6b9d" version = "0.3.2" [[deps.RecipesBase]] -git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d" +deps = ["SnoopPrecompile"] +git-tree-sha1 = "d12e612bba40d189cead6ff857ddb67bd2e6a387" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.2.1" +version = "1.3.1" [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" @@ -608,19 +609,19 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" [[deps.Roots]] -deps = ["CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "90a03cebb786c568d3c1f0fb2f71dcb26115e13e" +deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] +git-tree-sha1 = "a3db467ce768343235032a1ca0830fc64158dadf" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.3" +version = "2.0.8" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "e7c1d14d4c93e2d0f85970f818052de200eba5d2" +git-tree-sha1 = "9d920c4ee8cd5684e23bf84f43ead45c0af796e7" uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" -version = "3.39.2+0" +version = "3.39.4+0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -631,6 +632,11 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" +[[deps.SnoopPrecompile]] +git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85" +uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" +version = "1.0.1" + [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -652,14 +658,14 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "efa8acd030667776248eabb054b1836ac81d92f0" +git-tree-sha1 = "f86b3a049e5d05227b10e15dbb315c5b90f14988" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.7" +version = "1.5.9" [[deps.StaticArraysCore]] -git-tree-sha1 = "ec2bd695e905a3c755b33026954b119ea17f2d22" +git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.3.0" +version = "1.4.0" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -677,9 +683,9 @@ version = "1.0.1" [[deps.Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] -git-tree-sha1 = "7149a60b01bf58787a1b83dad93f90d4b9afbe5d" +git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.8.1" +version = "1.10.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] diff --git a/julia_src/reopt_model.jl b/julia_src/reopt_model.jl index 1cc37eef4..b56d9ce73 100644 --- a/julia_src/reopt_model.jl +++ b/julia_src/reopt_model.jl @@ -234,14 +234,14 @@ function add_bigM_adjustments(m, p) for mth in p.Month if n > 1 m[:NewMaxDemandMonthsInTier][mth,n] = minimum([p.MaxDemandMonthsInTier[n], - added_power + 2*maximum([p.ElecLoad[ts] + p.CoolingLoad[ts] + + added_power + 2*maximum([100*p.ElecLoad[ts] + p.CoolingLoad[ts] + add_ghp_heating_elec * p.HeatingLoad[ts] for ts in p.TimeStepRatchetsMonth[mth]]) - sum(m[:NewMaxDemandMonthsInTier][mth,np] for np in 1:(n-1))] ) else m[:NewMaxDemandMonthsInTier][mth,n] = minimum([p.MaxDemandMonthsInTier[n], - added_power + 2*maximum([p.ElecLoad[ts] + p.CoolingLoad[ts] + + added_power + 2*maximum([100*p.ElecLoad[ts] + p.CoolingLoad[ts] + add_ghp_heating_elec * p.HeatingLoad[ts] for ts in p.TimeStepRatchetsMonth[mth]])] ) @@ -1069,7 +1069,8 @@ function add_tou_demand_charge_constraints(m, p) if !isempty(p.DemandRates) m[:DemandTOUCharges] = @expression(m, p.pwf_e * sum( p.DemandRates[r,e] * m[:dvPeakDemandE][r,e] for r in p.Ratchets, e in p.DemandBin) ) - + else + m[:DemandTOUCharges] = 0.0 end end @@ -1499,11 +1500,7 @@ function reopt_run(m, p::Parameter) ### Constraint set (11): Peak Electrical Power Demand Charges: binDemandMonthsTier add_monthly_demand_charge_constraints(m, p) ### Constraint set (12): Peak Electrical Power Demand Charges: Ratchets - if !isempty(p.TimeStepRatchets) - add_tou_demand_charge_constraints(m, p) - else - m[:DemandTOUCharges] = 0 - end + add_tou_demand_charge_constraints(m, p) m[:TotalDemandCharges] = @expression(m, m[:DemandTOUCharges] + m[:DemandFlatCharges]) ### Constraint set (14): Coincident Peak Charges diff --git a/reo/src/urdb_parse.py b/reo/src/urdb_parse.py index ab1e9d588..c65c5ae9a 100644 --- a/reo/src/urdb_parse.py +++ b/reo/src/urdb_parse.py @@ -108,9 +108,9 @@ def __init__(self, rate): 'demandwindow', 'demandreactivepowercharge', # lookback demand charges - 'lookbackMonths', - 'lookbackPercent', - 'lookbackRange', + 'lookbackmonths', + 'lookbackpercent', + 'lookbackrange', # coincident rates 'coincidentrateunit', 'coincidentratestructure', @@ -447,31 +447,31 @@ def prepare_demand_periods(self, current_rate): def prepare_demand_lookback(self, current_rate): """ URDB lookback fields: - lookbackMonths + lookbackmonths Type: array - Array of 12 booleans, true or false, indicating months in which lookbackPercent applies. - If any of these is true, lookbackRange should be zero. + Array of 12 booleans, true or false, indicating months in which lookbackpercent applies. + If any of these is true, lookbackrange should be zero. - lookbackPercent + lookbackpercent Type: decimal - Lookback percentage. Applies to either lookbackMonths with value=1, or a lookbackRange. + Lookback percentage. Applies to either lookbackmonths with value=1, or a lookbackrange. - lookbackRange + lookbackrange Type: integer - Number of months for which lookbackPercent applies. If not 0, lookbackMonths values should all be 0. + Number of months for which lookbackpercent applies. If not 0, lookbackmonths values should all be 0. """ - if current_rate.lookbackPercent in [None, 0, []]: + if current_rate.lookbackpercent in [None, 0, []]: reopt_lookback_months = [] lookback_percentage = 0 lookback_range = 0 else: - lookback_percentage = current_rate.lookbackPercent or 0.0 - lookback_months = current_rate.lookbackMonths # defaults to empty list - lookback_range = current_rate.lookbackRange or 0 + lookback_percentage = current_rate.lookbackpercent or 0.0 + lookback_months = current_rate.lookbackmonths # defaults to empty list + lookback_range = current_rate.lookbackrange or 0 reopt_lookback_months = [] - if lookback_range != 0 and len(lookback_months) == 12: - for month in range(1, 13): - if lookback_months[month] == 1: + if lookback_range == 0 and len(lookback_months) == 12: + for month in range(1,13): + if lookback_months[month-1] == True: reopt_lookback_months.append(month) self.reopt_args.demand_lookback_months = reopt_lookback_months diff --git a/reo/tests/test_demand_ratchet.py b/reo/tests/test_demand_ratchet.py index 03aa67578..798fd9530 100644 --- a/reo/tests/test_demand_ratchet.py +++ b/reo/tests/test_demand_ratchet.py @@ -54,161 +54,27 @@ def setUp(self): "timeout_seconds": 295, "Site": { "PV": { - "pbi_years": 1.0, - "macrs_bonus_pct": 0.0, - "max_kw": 0.0, - "pbi_max_us_dollars": 1000000000.0, - "radius": 0.0, - "state_ibi_pct": 0.0, - "state_rebate_us_dollars_per_kw": 0.0, - "installed_cost_us_dollars_per_kw": 2000.0, - "utility_ibi_max_us_dollars": 10000000000.0, - "tilt": 0.537, - "degradation_pct": 0.005, - "gcr": 0.4, - "pbi_system_max_kw": 1000000000.0, - "utility_ibi_pct": 0.0, - "state_ibi_max_us_dollars": 10000000000.0, - "utility_rebate_max_us_dollars": 10000000000.0, - "macrs_option_years": 5, - "state_rebate_max_us_dollars": 10000000000.0, - "dc_ac_ratio": 1.1, - "federal_itc_pct": 0.3, - "existing_kw": 0.0, - "module_type": 0, - "array_type": 1, - "pbi_us_dollars_per_kwh": 0.0, - "om_cost_us_dollars_per_kw": 16.0, - "utility_rebate_us_dollars_per_kw": 0.0, - "min_kw": 0.0, - "losses": 0.14, - "macrs_itc_reduction": 0.5, - "federal_rebate_us_dollars_per_kw": 0.0, - "inv_eff": 0.96, - "azimuth": 180.0 - }, - "Generator": { - "pbi_years": 0.0, - "macrs_bonus_pct": 0.0, - "om_cost_us_dollars_per_kwh": 0.01, - "max_kw": 1000000000.0, - "pbi_max_us_dollars": 0.0, - "state_ibi_pct": 0.0, - "fuel_intercept_gal_per_hr": 0.0125, - "generator_only_runs_during_grid_outage": True, - "utility_rebate_max_us_dollars": 0.0, - "installed_cost_us_dollars_per_kw": 600.0, - "utility_ibi_max_us_dollars": 0.0, - "fuel_avail_gal": 1000000000.0, - "min_turn_down_pct": 0.0, - "pbi_system_max_kw": 0.0, - "utility_ibi_pct": 0.0, - "state_ibi_max_us_dollars": 0.0, - "diesel_fuel_cost_us_dollars_per_gallon": 3.0, - "fuel_slope_gal_per_kwh": 0.068, - "state_rebate_us_dollars_per_kw": 0.0, - "macrs_option_years": 0, - "state_rebate_max_us_dollars": 0.0, - "federal_itc_pct": 0.0, - "pbi_us_dollars_per_kwh": 0.0, - "existing_kw": 0.0, - "om_cost_us_dollars_per_kw": 10.0, - "utility_rebate_us_dollars_per_kw": 0.0, - "min_kw": 0.0, - "macrs_itc_reduction": 0.0, - "federal_rebate_us_dollars_per_kw": 0.0, - "generator_sells_energy_back_to_grid": False + "max_kw": 0.0 }, "LoadProfile": { - "critical_loads_kw_is_net": False, - "year": 2017, - "loads_kw_is_net": True, - "outage_start_time_step": None, - "outage_end_time_step": None, - "monthly_totals_kwh": [], - "critical_load_pct": 0.5, - "loads_kw": [], - "outage_is_major_event": True, - "critical_loads_kw": [], - "doe_reference_name": "MidriseApartment", - "annual_kwh": 24000.0 + "year": 2017 }, - "address": "", "Storage": { "max_kwh": 0.0, - "rectifier_efficiency_pct": 0.96, - "total_itc_pct": 0.0, - "min_kw": 0.0, - "max_kw": 0.0, - "replace_cost_us_dollars_per_kw": 460.0, - "replace_cost_us_dollars_per_kwh": 230.0, - "min_kwh": 0.0, - "installed_cost_us_dollars_per_kw": 1000.0, - "total_rebate_us_dollars_per_kw": 0, - "installed_cost_us_dollars_per_kwh": 500.0, - "inverter_efficiency_pct": 0.96, - "battery_replacement_year": 10, - "canGridCharge": True, - "macrs_bonus_pct": 0.0, - "macrs_itc_reduction": 0.5, - "macrs_option_years": 7, - "internal_efficiency_pct": 0.975, - "soc_min_pct": 0.2, - "soc_init_pct": 0.5, - "inverter_replacement_year": 10 + "max_kw": 0.0 }, "land_acres": None, "ElectricTariff": { - "add_blended_rates_to_urdb_rate": False, - "wholesale_rate_us_dollars_per_kwh": 0.0, - "net_metering_limit_kw": 0.0, - "interconnection_limit_kw": 100000000.0, - "urdb_utility_name": "Town of Wallingford, Connecticut (Utility Company)", - "urdb_label": "", - "wholesale_rate_above_site_load_us_dollars_per_kwh": 0.0, - "urdb_rate_name": "Primary Service - Northford", - "urdb_response": {"sector": "Industrial", "utility": "Town of Wallingford, Connecticut (Utility Company)", "energyratestructure": [[{"rate": 0.0687, "adj": 0.008376, "unit": "kWh"}], [{"rate": 0.0619, "adj": 0.008376, "unit": "kWh"}]], "energyweekendschedule": [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], "revisions": [1376316457, 1376316486, 1399411674, 1399585108, 1401288502, 1402428494, 1402433957, 1427405196], "flatdemandstructure": [[{"rate": 11.5}], [{"rate": 10.5}]], "startdate": 1372658400, "phasewiring": "3-Phase", "source": "http://www.town.wallingford.ct.us/images/customer-files//EDRate5110813.pdf", "label": "539f6a23ec4f024411ec8bf9", "flatdemandunit": "kW", "eiaid": 20038, "demandrateunit": "kW", "energycomments": "energy adjustments can be found here: http://www.town.wallingford.ct.us/images/customer-files//EDRate12PCAHist60514.pdf", "sourceparent": "http://www.town.wallingford.ct.us/Content/Retail_Rates_and_Fees.asp", "energyweekdayschedule": [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], "flatdemandmonths": [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1], "approved": "True", "demandratchetpercentage": [0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35], "enddate": 1383199200, "name": "Primary Service - Northford", "fixedmonthlycharge": 275, "uri": "https://openei.org/apps/USURDB/rate/view/539f6a23ec4f024411ec8bf9", "peakkwcapacitymin": 400, "demandreactivepowercharge": 2.7}, - "blended_annual_demand_charges_us_dollars_per_kw": 0.0, - "blended_annual_rates_us_dollars_per_kwh": 0.0, + "urdb_label": "539f6a23ec4f024411ec8bf9", }, "longitude": -84.387982, "roof_squarefeet": None, "latitude": 33.748995, "Financial": { - "escalation_pct": 0.026, - "offtaker_discount_pct": 0.081, - "value_of_lost_load_us_dollars_per_kwh": 100.0, - "analysis_years": 20, - "microgrid_upgrade_cost_pct": 0.3, - "offtaker_tax_pct": 0.26, - "om_cost_escalation_pct": 0.025 - }, - "Wind": { - "pbi_years": 1.0, - "macrs_bonus_pct": 0.0, - "max_kw": 0.0, - "pbi_max_us_dollars": 1000000000.0, - "wind_meters_per_sec": None, - "state_ibi_pct": 0.0, - "utility_rebate_max_us_dollars": 10000000000.0, - "installed_cost_us_dollars_per_kw": 3013.0, - "utility_ibi_max_us_dollars": 10000000000.0, - "pressure_atmospheres": None, - "pbi_system_max_kw": 1000000000.0, - "utility_ibi_pct": 0.0, - "state_ibi_max_us_dollars": 10000000000.0, - "wind_direction_degrees": None, - "state_rebate_us_dollars_per_kw": 0.0, - "macrs_option_years": 5, - "state_rebate_max_us_dollars": 10000000000.0, - "federal_itc_pct": 0.3, - "temperature_celsius": None, - "pbi_us_dollars_per_kwh": 0.0, - "om_cost_us_dollars_per_kw": 35.0, - "utility_rebate_us_dollars_per_kw": 0.0, - "min_kw": 0.0, - "macrs_itc_reduction": 0.5, - "federal_rebate_us_dollars_per_kw": 0.0 + "escalation_pct": 0.0, + "offtaker_discount_pct": 0.0, + "offtaker_tax_pct": 0.0, + "om_cost_escalation_pct": 0.0 } }, "time_steps_per_hour": 1, @@ -232,7 +98,13 @@ def get_response(self, data): return response def test_demand_ratchet_rate(self): - expected_year_one_demand_flat_cost = 721.99 + # urdb_label used https://apps.openei.org/IURDB/rate/view/539f6a23ec4f024411ec8bf9#2__Demand + # has a demand charge lookback of 35% for all months with 2 different demand charges based on which month + self.post["Scenario"]["Site"]["LoadProfile"]["loads_kw"] = [1.0]*8760 + self.post["Scenario"]["Site"]["LoadProfile"]["loads_kw"][8] = 100.0 + # Expected result is 100 kW demand for January, 35% of that for all other months and + # with 5x other $10.5/kW cold months and 6x $11.5/kW warm months + expected_year_one_demand_flat_cost = 100 * (10.5 + 0.35*10.5*5 + 0.35*11.5*6) response = self.get_response(self.post) tariff_out = response['outputs']['Scenario']['Site']['ElectricTariff']