Skip to content
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

Capacity credits #41

Merged
merged 10 commits into from
Jul 13, 2022
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
Wind,-65758000.0,2255353.118176605,4311674.486824546,2189778.776554348,1110016.7498568967,993754.9837025497,211170.95499059185,-572862.6820326308,-694407.9175025169,-578131.876071821,-704821.6977355331,-7320445.83615773,-7452492.440224206,-7587170.875698172,-7724824.276799135,-7865239.065943911,-8031004.646820019,-8199737.29759013,-8349334.090623318,-8502110.294989245,-8658139.7908863,-8830582.44751698,-9006431.573151236,-9172682.35653955,-9342500.309453165,-9515968.720129624,-9693172.900102394,-9874200.23419418,-10059140.231754152,-10248084.579170175,-10441127.19368782
Solar,-598000.0,132972.89292314532,7819.094162721771,-8600.03799858602,-18665.795908903372,-19198.757888189997,-26894.865740457295,-34591.97261281748,-35136.42424911188,-35690.0778649275,-36255.4560248329,-36830.24770358585,-37417.22400068745,-38014.0847089788,-38623.61200965868,-39243.517047402216,-40078.87161706286,-40925.75538824187,-41582.79259601164,-42252.53517368127,-42935.26354989535,-43750.25184195851,-44578.8068680814,-45302.2424136456,-46039.85350158752,-46791.95541700401,-47558.87093608467,-48340.9305094789,-49138.47245020792,-49951.84312623508,-50781.39715781063
Wind,-65758000.0,2545458.108734848,4604680.527288372,2485714.8774228115,1408912.2117340444,1295639.400198469,516074.21565147024,-264910.38876514323,-383376.10130235367,-263989.741709657,-387538.14202974737,-6999989.444894886,-7128831.485048735,-7260273.310970944,-7394657.736424636,-7531770.860165667,-7694201.758983992,-7859566.380875744,-8005761.464741787,-8155101.9428489,-8307661.35522455,-8476599.227498613,-8648908.520932686,-8811584.073798813,-8977791.043885022,-9147612.361905798,-9321132.97829633,-9498439.913170056,-9679622.307519786,-9864771.475693468,-10053980.959176345
Solar,-598000.0,129085.2774151767,3892.6024996734614,-12565.79457826481,-22671.21005437895,-23244.226175120326,-30980.78871025693,-38718.754812315114,-39304.47427060449,-39899.808386635035,-40507.283851757515,-41124.593808779704,-41754.51356693324,-42394.74717088706,-43048.081096186026,-43712.23082479483,-44592.2725322294,-45484.290312560086,-46186.91286957302,-46902.69664997827,-47631.926640955324,-48493.88156392908,-49369.872887271675,-50141.21909302777,-50927.21994776352,-51728.19552764176,-52544.47344782881,-53376.389046340475,-54224.28557243811,-55088.51437968757,-55969.43512379765
H2,-10208630.922059558,-3157524.5395198874,-6344891.316648774,-6420707.224377561,-6584189.225722473,-6747970.408518016,-6912089.031371135,-7076911.101704337,-10316982.944670048,-7333159.46503054,-7484764.170471385,-7638699.743216958,-7795328.219134912,-7954442.801969383,-8116399.575269274,-11788467.969932593,-8380536.197296668,-8553359.068016369,-8729104.392487109,-8907658.509570297,-9089312.18173999,-9419862.129971638,-13755789.219810031,-9869388.326495074,-10068166.056057714,-10270174.38954674,-10475549.95192073,-10684359.290088326,-10914559.019108143,-15713301.486689113,-23609871.995784074
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
Wind,-93884000.0,3360181.838277127,6213853.873140052,3235214.2658716077,1613426.9027866474,1500304.1032627225,304882.6337080039,-891533.9045568937,-1008975.7583795879,-917780.2246493306,-1040295.0044795955,-6861254.8446111195,-6989041.888572343,-7119358.175244488,-7252665.799151127,-7388631.360234123,-7559477.044308345,-7733215.31521979,-7878258.815846274,-8026436.194881432,-8177820.877194406,-8351168.642955167,-8527875.965102306,-8689341.19241013,-8854325.733682452,-9022912.398601202,-9195186.01535869,-9371233.480603037,-9551143.8106271,-9735008.193831852,-9922920.044496115
Solar,-598000.0,132972.89292314532,7819.094162721771,-8600.03799858602,-18665.795908903372,-19198.757888189997,-26894.865740457295,-34591.97261281748,-35136.42424911188,-35690.0778649275,-36255.4560248329,-36830.24770358585,-37417.22400068745,-38014.0847089788,-38623.61200965868,-39243.517047402216,-40078.87161706286,-40925.75538824187,-41582.79259601164,-42252.53517368127,-42935.26354989535,-43750.25184195851,-44578.8068680814,-45302.2424136456,-46039.85350158752,-46791.95541700401,-47558.87093608467,-48340.9305094789,-49138.47245020792,-49951.84312623508,-50781.39715781063
Wind,-93884000.0,3608939.6455447525,6465099.258480352,3488972.1050653127,1869722.320372288,1759162.4750242196,566329.5891871164,-627472.4795229891,-742273.7190953447,-648411.1649722457,-768232.2542057391,-6586471.466834525,-6711510.677017981,-6839051.651574584,-6969556.210244524,-7102690.675438453,-7270676.952664719,-7441527.222659728,-7583653.842360611,-7728885.171660911,-7877294.343741682,-8047636.844167916,-8221308.848327182,-8379708.404467255,-8541596.617860148,-8707055.991620675,-8876171.044308357,-9049028.359842202,-9225716.638658654,-9406326.750143724,-9590951.786371104
Solar,-598000.0,129085.2774151767,3892.6024996734614,-12565.79457826481,-22671.21005437895,-23244.226175120326,-30980.78871025693,-38718.754812315114,-39304.47427060449,-39899.808386635035,-40507.283851757515,-41124.593808779704,-41754.51356693324,-42394.74717088706,-43048.081096186026,-43712.23082479483,-44592.2725322294,-45484.290312560086,-46186.91286957302,-46902.69664997827,-47631.926640955324,-48493.88156392908,-49369.872887271675,-50141.21909302777,-50927.21994776352,-51728.19552764176,-52544.47344782881,-53376.389046340475,-54224.28557243811,-55088.51437968757,-55969.43512379765
H2,-10208630.922059558,-3157524.5395198874,-6344891.316648774,-6420707.224377561,-6584189.225722473,-6747970.408518016,-6912089.031371135,-7076911.101704337,-10316982.944670048,-7333159.46503054,-7484764.170471385,-7638699.743216958,-7795328.219134912,-7954442.801969383,-8116399.575269274,-11788467.969932593,-8380536.197296668,-8553359.068016369,-8729104.392487109,-8907658.509570297,-9089312.18173999,-9419862.129971638,-13755789.219810031,-9869388.326495074,-10068166.056057714,-10270174.38954674,-10475549.95192073,-10684359.290088326,-10914559.019108143,-15713301.486689113,-23609871.995784074
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
Wind,-89180000.0,3257727.2876148797,5986219.0615870515,3149604.937588957,1626619.3210637802,1511683.4627870042,393431.7678976599,-725904.025817669,-845359.2642386351,-741884.7098626215,-866451.5340753356,-7076152.389478,-7206032.824250644,-7338473.469330773,-7473916.661541027,-7612049.180299121,-7783482.294656745,-7957834.823590874,-8105105.799733069,-8255532.929039095,-8409189.859125646,-8583896.61673772,-8761985.880438684,-8925792.206899872,-9093141.25831709,-9264116.078482188,-9438801.732038485,-9617285.354449632,-9799656.203212159,-9986005.710342761,-10176427.536172133
Solar,-598000.0,132972.89292314532,7819.094162721771,-8600.03799858602,-18665.795908903372,-19198.757888189997,-26894.865740457295,-34591.97261281748,-35136.42424911188,-35690.0778649275,-36255.4560248329,-36830.24770358585,-37417.22400068745,-38014.0847089788,-38623.61200965868,-39243.517047402216,-40078.87161706286,-40925.75538824187,-41582.79259601164,-42252.53517368127,-42935.26354989535,-43750.25184195851,-44578.8068680814,-45302.2424136456,-46039.85350158752,-46791.95541700401,-47558.87093608467,-48340.9305094789,-49138.47245020792,-49951.84312623508,-50781.39715781063
Wind,-89180000.0,3527996.5773605527,6259191.044230182,3425306.6400585184,1905078.0405580369,1792926.7694762042,677487.5076537514,-439007.72866401635,-555594.004113446,-449221.79713618103,-570861.9922216302,-6777606.952205758,-6904501.932605679,-7033927.268769358,-7166324.998973998,-7301381.601106422,-7469708.039672119,-7640922.826056401,-7785024.682223251,-7932251.000354179,-8082675.111153882,-8254116.721286237,-8428908.186032686,-8589383.735549815,-8753368.702253532,-8920945.796857996,-9092199.74759805,-9267217.350164792,-9446087.51888447,-9628901.339171797,-9815752.121289458
Solar,-598000.0,129085.2774151767,3892.6024996734614,-12565.79457826481,-22671.21005437895,-23244.226175120326,-30980.78871025693,-38718.754812315114,-39304.47427060449,-39899.808386635035,-40507.283851757515,-41124.593808779704,-41754.51356693324,-42394.74717088706,-43048.081096186026,-43712.23082479483,-44592.2725322294,-45484.290312560086,-46186.91286957302,-46902.69664997827,-47631.926640955324,-48493.88156392908,-49369.872887271675,-50141.21909302777,-50927.21994776352,-51728.19552764176,-52544.47344782881,-53376.389046340475,-54224.28557243811,-55088.51437968757,-55969.43512379765
H2,-10208630.922059558,-3157524.5395198874,-6344891.316648774,-6420707.224377561,-6584189.225722473,-6747970.408518016,-6912089.031371135,-7076911.101704337,-10316982.944670048,-7333159.46503054,-7484764.170471385,-7638699.743216958,-7795328.219134912,-7954442.801969383,-8116399.575269274,-11788467.969932593,-8380536.197296668,-8553359.068016369,-8729104.392487109,-8907658.509570297,-9089312.18173999,-9419862.129971638,-13755789.219810031,-9869388.326495074,-10068166.056057714,-10270174.38954674,-10475549.95192073,-10684359.290088326,-10914559.019108143,-15713301.486689113,-23609871.995784074
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
Wind,-93884000.0,4818772.84362792,7817277.037448029,4816265.716633119,3338865.2932555582,3202921.1087428834,2151432.4107388547,1098718.1480362657,957763.3984382767,1192193.2778248172,1045692.9930141736,-9308016.207659427,-9460270.865251133,-9615299.441690067,-9773566.478261162,-9934741.046135258,-10131047.82706849,-10330501.805807538,-10501518.1713399,-10675928.143929992,-10853807.745733453,-11053915.380179605,-11257650.169698987,-11446413.139052778,-11638968.399791528,-11835401.491371369,-12035799.999056557,-12240253.604137883,-12448854.135397295,-12661695.62184975,-12878874.346794192
Solar,-598000.0,126298.34906812382,1077.8048691500608,-15408.740185093446,-25542.58511727587,-26144.31498864622,-33909.87841191808,-41677.135410992865,-42292.438675269026,-42917.65243534622,-43555.30634095581,-44203.09652286998,-44863.80130816442,-45535.127789530554,-46219.86552101595,-46915.73309387306,-47827.8098239984,-48752.18297724678,-49487.484460906584,-50236.273957225174,-50998.83972127469,-51894.46377505164,-52804.46092050547,-53610.1530065939,-54430.843200465315,-55266.85501287057,-56118.5195279099,-56986.17558722238,-57870.16997872884,-58770.857630041195,-59688.60180665481
Wind,-93884000.0,4979365.928704133,7979476.053375005,4980086.722719364,3504324.5094026644,3370034.9170514606,2320217.357130519,1269190.9438918456,1129940.922252413,1366092.5768770948,1221331.2850569766,-9130621.532696197,-9281102.243538272,-9434339.133760076,-9590796.567251872,-9750143.436015874,-9944604.240847914,-10142193.783724755,-10311327.069036288,-10483835.130603347,-10659793.80227354,-10857961.297285093,-11059736.545975532,-11246520.379092086,-11437076.712231228,-11631490.886935467,-11829850.288576297,-12032244.39655282,-12238764.835736379,-12449505.429192226,-12664562.252210092
Solar,-598000.0,121164.95105717558,-4106.927121907664,-20645.319496061747,-30831.530221353856,-31486.149543764983,-39305.13131258803,-47126.34084066952,-47796.13615924244,-48476.38689415938,-49169.62814435709,-49873.56154430528,-50590.97097981407,-51319.569157896694,-52062.151303065766,-52816.44173374337,-53787.52555026741,-54771.49586077848,-55566.9904732736,-56376.57502971587,-57200.543804490284,-58158.1848990994,-59130.8192557937,-59999.77492523501,-60884.36133829284,-61784.90833207637,-62701.75338030775,-63635.24177814422,-64585.726831559885,-65553.57005140057,-66539.14135222779
H2,-10208630.922059558,-3157524.5395198874,-6344891.316648774,-6420707.224377561,-6584189.225722473,-6747970.408518016,-6912089.031371135,-7076911.101704337,-10316982.944670048,-7333159.46503054,-7484764.170471385,-7638699.743216958,-7795328.219134912,-7954442.801969383,-8116399.575269274,-11788467.969932593,-8380536.197296668,-8553359.068016369,-8729104.392487109,-8907658.509570297,-9089312.18173999,-9419862.129971638,-13755789.219810031,-9869388.326495074,-10068166.056057714,-10270174.38954674,-10475549.95192073,-10684359.290088326,-10914559.019108143,-15713301.486689113,-23609871.995784074
1 change: 0 additions & 1 deletion hybrid/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def simulate_financials(self, interconnect_kw: float, project_life: int, cap_cre
else:
self._financial_model.Lifetime.system_use_lifetime_output = 0
self._financial_model.FinancialParameters.analysis_period = project_life
self._financial_model.CapacityPayments.cp_system_nameplate = min(interconnect_kw, self.system_capacity_kw)
self._financial_model.SystemCosts.om_batt_nameplate = self.system_capacity_kw
try:
if self._financial_model.SystemCosts.om_production != 0:
Expand Down
1 change: 0 additions & 1 deletion hybrid/csp_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ def simulate_financials(self, interconnect_kw: float, project_life: int = 25, ca
# TODO: avoid using ssc data here?
nameplate_capacity_kw = self.cycle_capacity_kw * self.ssc.get('gross_net_conversion_factor')
self._financial_model.value("system_capacity", min(nameplate_capacity_kw, interconnect_kw))
self._financial_model.value("cp_system_nameplate", min(nameplate_capacity_kw, interconnect_kw))
self._financial_model.value("total_installed_cost", self.calculate_total_installed_cost())
# need to store for later grid aggregation
self.gen_max_feasible = self.calc_gen_max_feasible_kwh(interconnect_kw, cap_cred_avail_storage)
Expand Down
13 changes: 13 additions & 0 deletions hybrid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ def simulate_grid_connection(self, hybrid_size_kw: float, total_gen: list, proje
# FIXME: updating capacity credit for reporting only.
self.capacity_credit_percent = self.capacity_credit_percent * (self.system_capacity_kw / self.interconnect_kw)

def calc_gen_max_feasible_kwh(self, interconnect_kw: float) -> list:
"""
Calculates the maximum feasible generation profile that could have occurred (year 1)

:param interconnect_kw: Interconnection limit [kW]

:return: maximum feasible generation [kWh]
"""
W_ac_nom = self.calc_nominal_capacity(interconnect_kw)
t_step = self.site.interval / 60 # hr
E_net_max_feasible = [min(x,W_ac_nom) * t_step for x in self.total_gen_max_feasible_year1[0:self.site.n_timesteps]] # [kWh]
return E_net_max_feasible

@property
def system_capacity_kw(self) -> float:
return self._financial_model.SystemOutput.system_capacity
Expand Down
39 changes: 16 additions & 23 deletions hybrid/hybrid_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,6 @@ def set_logical_or_for_hybrid(var_name):

# Debt and Financing should be handled via user customization of the grid's financial model

# capacity payments
# for v in generators:
# v.value("cp_system_nameplate", v.system_capacity_kw)
# self.grid.value("cp_system_nameplate", hybrid_size_kw)

# O&M Cost
set_average_for_hybrid("om_capacity", size_ratios)
set_average_for_hybrid("om_fixed", [1] * len(generators))
Expand Down Expand Up @@ -498,6 +493,7 @@ def simulate_power(self, project_life: int = 25, lifetime_sim=False):

# Put the hybrid together for grid simulation
hybrid_size_kw = 0
hybrid_nominal_capacity = 0
total_gen = np.zeros(self.site.n_timesteps * project_life)
total_gen_before_battery = np.zeros(self.site.n_timesteps * project_life)
total_gen_max_feasible_year1 = np.zeros(self.site.n_timesteps)
Expand All @@ -506,7 +502,8 @@ def simulate_power(self, project_life: int = 25, lifetime_sim=False):
if system != 'grid':
model = getattr(self, system)
if model:
hybrid_size_kw += model.system_capacity_kw #model.calc_nominal_capacity(self.interconnect_kw)
hybrid_size_kw += model.system_capacity_kw
hybrid_nominal_capacity += model.calc_nominal_capacity(self.interconnect_kw)
project_life_gen = np.tile(model.generation_profile, int(project_life / (len(model.generation_profile) // self.site.n_timesteps)))
if len(project_life_gen) != len(total_gen):
raise ValueError("Generation profile, `gen`, from system {} should have length that divides"
Expand All @@ -515,12 +512,15 @@ def simulate_power(self, project_life: int = 25, lifetime_sim=False):
if system in non_dispatchable_systems:
total_gen_before_battery += project_life_gen
total_gen += project_life_gen
model.gen_max_feasible = model.calc_gen_max_feasible_kwh(self.interconnect_kw)
total_gen_max_feasible_year1 += model.gen_max_feasible

# Consolidate grid generation by copying over power and storage generation information
if self.battery:
self.grid.generation_profile_wo_battery = total_gen_before_battery
self.grid.simulate_grid_connection(hybrid_size_kw, total_gen, project_life, lifetime_sim, total_gen_max_feasible_year1)
self.grid.hybrid_nominal_capacity = hybrid_nominal_capacity
self.grid.total_gen_max_feasible_year1 = total_gen_max_feasible_year1
logger.info(f"Hybrid Peformance Simulation Complete. AEPs are {self.annual_energies}.")

def simulate_financials(self, project_life):
Expand Down Expand Up @@ -701,23 +701,6 @@ def capacity_factors(self) -> HybridSimulationOutput:
cf.hybrid = (hybrid_generation / hybrid_capacity) / 87.6
return cf

@property
def capacity_credit_percent(self) -> HybridSimulationOutput:
"""Hybrid Capacity credit (eligible portion of nameplate) by technology [%]"""
cap_cred = self.outputs_factory.create()
if self.pv:
cap_cred.pv = self.pv.capacity_credit_percent
if self.wind:
cap_cred.wind = self.wind.capacity_credit_percent
if self.tower:
cap_cred.tower = self.tower.capacity_credit_percent
if self.trough:
cap_cred.trough = self.trough.capacity_credit_percent
if self.battery:
cap_cred.battery = self.battery.capacity_credit_percent
cap_cred.hybrid = self.grid.capacity_credit_percent
return cap_cred

def _aggregate_financial_output(self, name, start_index=None, end_index=None) -> HybridSimulationOutput:
"""Helper function for aggregating hybrid financial outputs"""
out = self.outputs_factory.create()
Expand All @@ -734,6 +717,16 @@ def _aggregate_financial_output(self, name, start_index=None, end_index=None) ->
setattr(out, k, val)
return out

@property
def system_nameplate_mw(self) -> HybridSimulationOutput:
"""System nameplate capacity [MW]"""
return self._aggregate_financial_output("system_nameplate_mw")

@property
def capacity_credit_percent(self) -> HybridSimulationOutput:
"""Capacity credit (eligible portion of nameplate) by technology [%]"""
return self._aggregate_financial_output("capacity_credit_percent")

@property
def cost_installed(self) -> HybridSimulationOutput:
"""The total_installed_cost plus any financing costs [$]"""
Expand Down
Loading