From 99d43f3e96f5be6c67fd6b60e596ba8089f6101b Mon Sep 17 00:00:00 2001 From: Mirletz Date: Wed, 23 Oct 2024 16:45:57 -0600 Subject: [PATCH] #35 Implemented Negative Deployment Check, Error, and Correct added an if statement to the beginning of the mass code checking for negative deployment, which prints a message and sets all deployment that is negative to 0. --- PV_ICE/main.py | 5 + docs/dev/MESC-NRELStdScens.html | 710 +- docs/dev/MESC-NRELStdScens.ipynb | 12680 ++++++++++++++--------------- docs/dev/MESC-NRELStdScens.py | 66 +- 4 files changed, 6469 insertions(+), 6992 deletions(-) diff --git a/PV_ICE/main.py b/PV_ICE/main.py index 63b34e5..1f9e5d0 100644 --- a/PV_ICE/main.py +++ b/PV_ICE/main.py @@ -684,6 +684,11 @@ def calculateMassFlow(self, scenarios=None, materials_input=None, # Standard method to calculate Area from the Power else: + #negative deployment check, error, correct + if (df['new_Installed_Capacity_[MW]'].values<0).any(): + print('You have at least 1 negative annual deployment! All years of negative deployment have been set to 0.') + df.loc[df['new_Installed_Capacity_[MW]']<0,'new_Installed_Capacity_[MW]'] = 0.0 + df['new_Installed_Capacity_[W]'] = ( df['new_Installed_Capacity_[MW]']*1e6) diff --git a/docs/dev/MESC-NRELStdScens.html b/docs/dev/MESC-NRELStdScens.html index 68cb2c8..df71c6b 100644 --- a/docs/dev/MESC-NRELStdScens.html +++ b/docs/dev/MESC-NRELStdScens.html @@ -15264,8 +15264,8 @@

-
[<matplotlib.lines.Line2D at 0x1cd8c40a910>,
- <matplotlib.lines.Line2D at 0x1cd8c4df310>]
+
[<matplotlib.lines.Line2D at 0x212476d39d0>,
+ <matplotlib.lines.Line2D at 0x212486ef390>]
@@ -15304,7 +15304,7 @@

idx_temp = pd.RangeIndex(start=2024,stop=2051,step=1) #create the index CdTeRamp = pd.DataFrame(index=idx_temp, columns=['CdTe_deploy_[MWdc]'], dtype=float) CdTeRamp.loc[2024] = 14000 -CdTeRamp.loc[2030] = 22000 +CdTeRamp.loc[2030] = 50000#22000 CdTeRamp_full = round(CdTeRamp.interpolate(),0) #CdTeRamp_full @@ -15379,7 +15379,7 @@

- @@ -15463,7 +15463,7 @@

- @@ -15545,7 +15545,7 @@

- @@ -15557,6 +15557,95 @@

+ + + + + +