-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PSY base methods #6
Changes from all commits
79d8928
a6c9880
b21e855
2d553ed
fc74eb2
825c74c
f6eb445
ba277d7
3c9283c
b03645b
2456312
ee45ef4
86458f8
74d43f0
7e64882
b7deead
2582284
60193d2
e43614e
5e5efc7
d22568c
d40072b
3ad9147
afac1ab
e8cd006
5aa51d2
eefce02
7abe741
3bfde43
ae2d652
525f4dd
5d18b60
dbf8652
67d5acb
af1c5d9
d056ef5
09e5b69
f3c391e
487c847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
name = "PowerSystemsInvestmentsPortfolios" | ||
uuid = "bed98974-b02a-5e2f-9fe0-a103f8c450dd" | ||
authors = ["Jose Daniel Lara"] | ||
authors = ["Jose Daniel Lara", "Sourabh Dalvi", "Rodrigo Henriquez-Auba"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | ||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
InfrastructureSystems = "2cd47ed4-ca9b-11e9-27f2-ab636a7671f1" | ||
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" | ||
PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" | ||
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" | ||
|
||
[compat] | ||
DocStringExtensions = "~0.9" | ||
julia = "^1.6" | ||
InfrastructureSystems = "1" | ||
PowerSystems = "^3.3" | ||
PrettyTables = "1, 2" | ||
JSON3 = "1" | ||
DataStructures = "~0.18" |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,91 @@ | ||||||||||||
using Pkg | ||||||||||||
Pkg.activate("") | ||||||||||||
Pkg.instantiate() | ||||||||||||
using Revise | ||||||||||||
using PowerSystems | ||||||||||||
import InfrastructureSystems | ||||||||||||
using PowerSystemsInvestmentsPortfolios | ||||||||||||
const IS = InfrastructureSystems | ||||||||||||
const PSY = PowerSystems | ||||||||||||
const PSIP = PowerSystemsInvestmentsPortfolios | ||||||||||||
|
||||||||||||
data = PSY._create_system_data_from_kwargs() | ||||||||||||
|
||||||||||||
#bus = ACBus(nothing) | ||||||||||||
#discount_rate = 0.07 | ||||||||||||
#investment_schedule = Dict() | ||||||||||||
#port_metadata = PSIP.PortfolioMetadata("portfolio_test", nothing, nothing) | ||||||||||||
|
||||||||||||
p = Portfolio(0.07) | ||||||||||||
|
||||||||||||
t_th = SupplyTechnology{ThermalStandard}( | ||||||||||||
name="thermal_tech", | ||||||||||||
available=true, | ||||||||||||
fuel=PSY.ThermalFuels.COAL, | ||||||||||||
prime_mover=PSY.PrimeMovers.ST, | ||||||||||||
capacity_factor=0.98, # cap factor | ||||||||||||
capital_cost=nothing, | ||||||||||||
operational_cost=nothing, | ||||||||||||
) | ||||||||||||
|
||||||||||||
t_th_ext = t_th.ext | ||||||||||||
t_th_ext["capital_cost"] = 50.0 | ||||||||||||
t_th_ext["investment_periods"] = [2030, 2040] | ||||||||||||
# one option is to repeat these for each investment | ||||||||||||
t_th_ext["operational_periods"] = [1, 2, 3] | ||||||||||||
t_th_ext["operational_periods_2"] = [ | ||||||||||||
1, 2, 3, # first investment period | ||||||||||||
4, 5, 6 # second investment period | ||||||||||||
] | ||||||||||||
t_th_ext["investment_operational_periods_map"] = Dict( | ||||||||||||
2030 => [1, 2, 3], | ||||||||||||
2040 => [4, 5, 6], | ||||||||||||
) | ||||||||||||
Comment on lines
+40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||
t_th_ext["initial_capacity"] = 200.0 # Data in MW | ||||||||||||
t_th_ext["maximum_capacity"] = 10000.0 | ||||||||||||
t_th_ext["minimum_required_capacity"] = [0.0, 0.0] | ||||||||||||
|
||||||||||||
t_th_exp = SupplyTechnology{ThermalStandard}( | ||||||||||||
name="thermal_tech_expensive", | ||||||||||||
available=true, | ||||||||||||
fuel=PSY.ThermalFuels.WASTE_OIL, | ||||||||||||
prime_mover=PSY.PrimeMovers.ST, | ||||||||||||
capacity_factor=0.92, # cap factor | ||||||||||||
capital_cost=nothing, | ||||||||||||
operational_cost=nothing, | ||||||||||||
) | ||||||||||||
|
||||||||||||
t_th_exp_ext = t_th_exp.ext | ||||||||||||
t_th_exp_ext["capital_cost"] = 150.0 | ||||||||||||
|
||||||||||||
# Initial Capacity | ||||||||||||
|
||||||||||||
t_re = SupplyTechnology{RenewableDispatch}( | ||||||||||||
name="renewable_tech", | ||||||||||||
available=true, | ||||||||||||
fuel=PSY.ThermalFuels.OTHER, | ||||||||||||
prime_mover=PSY.PrimeMovers.WT, | ||||||||||||
capacity_factor=0.98, # cap factor | ||||||||||||
capital_cost=nothing, | ||||||||||||
operational_cost=nothing, | ||||||||||||
) | ||||||||||||
|
||||||||||||
t_re_ext = t_re.ext | ||||||||||||
t_re_ext["capital_cost"] = 100.0 | ||||||||||||
t_re_ext["variable_capacity_factor"] = [0.8, 0.6, 0.3] | ||||||||||||
|
||||||||||||
|
||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||
PSIP.add_technology!(p, t_th) | ||||||||||||
PSIP.add_technology!(p, t_re) | ||||||||||||
|
||||||||||||
|
||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||
IS.serialize(t) | ||||||||||||
IS.serialize(p) | ||||||||||||
|
||||||||||||
get_technologies(x -> (!get_available(x)), SupplyTechnology{ThermalStandard}, p) | ||||||||||||
|
||||||||||||
get_technologies(SupplyTechnology{ThermalStandard}, p) | ||||||||||||
PSIP.remove_technology!(SupplyTechnology{ThermalStandard}, p, "thermal_tech") | ||||||||||||
|
||||||||||||
get_available(t) | ||||||||||||
IS.deserialize(p) |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶