Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GEP475GROUPINEEDANAP

3796 views
Kernel: Python 3 (Ubuntu Linux)

Infiltration Calculations

Things needed to make calculations more accurate:

  • No inf or zeros present in data

  • Find true asymtote for CO2_inside (seems to go below 400 "outside ppm")

  • Get accurate ETC volume. (used 40,000 ft3^3 here)

  • Isolate Negative slopes

  • Determine best days/times to isolate further

VolumetricFlowRate:
CFMCO2=CFMallair∗(%CO2outside−%CO2inside)CFM_{CO_2} = CFM_{allair} * ( \% CO_2 outside - \% CO_2 inside)VolumetricFlowRate=CFMCO2/(%CO2outside−%CO2inside)VolumetricFlowRate = CFM_{CO_2} / (\% CO_2 outside - \% CO_2 inside)
  • ΔCO2\Delta CO_2 = CO2CO_2 cubic feet per minute (cfm)

  • Volumetric Flow Rate = Total cubic feet per minute (cfm)

  • CO2CO_2_outside = proportion (unitless)

  • CO2CO_2_inside = proportion (unitless)

Infiltration:
Infiltration=ΔCO2(CO2_outside−CO2_inside)∗1Volume∗60minhourInfiltration = \frac{\Delta CO2}{(CO2\_outside - CO2\_inside)} * \frac{1}{Volume} * \frac{60 min}{hour}
  • Infiltration = "air changes" Per Minute (1min\large{\frac{1}{min}})

  • ΔCO2\Delta CO_2 = CO2CO_2 cubic feet per minute (cfm)

  • CO2CO_2_outside = proportion (unitless)

  • CO2CO_2_inside = proportion (unitless)

  • Volume = ETC cubic feet ( ft3ft^{3} )

import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline

More Data Manipulation

Starting with just ppm and timestamp

Finshing withing percent CO2 inside and outside, as well as cfm of CO2, and volume of ETC.

df1 = pd.read_csv('NetatmoCleanedForInfiltrationAnalysis.csv', parse_dates=True) df1.drop(df1.columns[[0]], axis =1 , inplace = True) df1.head()
df1['Time'] = pd.to_datetime(df1.Time) df1.head()
df1.rename(index=str, columns={"CO2": "ppm_inside"}, inplace = True) df1.head()
df1['TimeDelta'] = df1['Time'].diff(1) df1['TimeDelta'] = df1.TimeDelta / np.timedelta64(1, 'm') df1['ppm_outside'] = 400 df1['ETC_Volume'] = 4e4 df1['changeinppminside'] = df1['ppm_inside'].diff(1) df1.head(4)

Cfm = percent change inside * Volume of ETC

df1['percentchangeinside'] = df1['changeinppminside'] / 1e4 df1.head()
df1['CFM_CO2'] = (df1['percentchangeinside'] / df1['TimeDelta'])* df1['ETC_Volume'] df1.head()
df1['percent_Inside'] = df1['ppm_inside'] / 1e4 df1['percent_Outside'] = df1['ppm_outside'] / 1e4 df1.head()
df1.drop(df1.columns[[0, 2, 3, 5, 6,]], axis =1 , inplace = True) df1.head()
df1.percent_Inside.describe()
count 100985.000000 mean 0.054765 std 0.030451 min 0.020100 25% 0.036200 50% 0.043800 75% 0.061500 max 0.277700 Name: percent_Inside, dtype: float64
df1.to_csv('InfiltrationFINALCleanedData.csv')
df2 = pd.read_csv('InfiltrationFINALCleanedData.csv', parse_dates=True, index_col=0) df2.iloc[32]
Time 2016-02-19 16:07:00 ETC_Volume 40000 CFM_CO2 12.8 percent_Inside 0.0409 percent_Outside 0.04 Name: 32, dtype: object
df2 = df2[df2['percent_Inside']>(df2['percent_Outside'] + 0.02)] df2 = df2[df2['CFM_CO2'] < 0] df2 = df2.replace([np.inf, -np.inf], np.nan) df2.dropna() df2.describe()
df2.head()
df2['CFM_CO2'].hist(bins = 50, range = (-80, 0))
<matplotlib.axes._subplots.AxesSubplot at 0x7f754f36c0f0>
Image in a Jupyter notebook
df2['CFM_ETC'] = df2['CFM_CO2'] / (df2['percent_Inside'] - df2['percent_Outside']) df2.describe()
df2['CFM_ETC'].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e3131d0>
Image in a Jupyter notebook
df2['CFM_ETC'].hist(bins = 10, range = (-1500, -1000))
<matplotlib.axes._subplots.AxesSubplot at 0x7f754df58198>
Image in a Jupyter notebook
df2['ACH'] = (df2['CFM_ETC'] / df2['ETC_Volume']) * 60 df2.describe()
#df2['CFM_ETC'].plot.density( range = 200 )
df2['ACH'].hist(bins = 10, range = (-10, 0))
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e50c550>
Image in a Jupyter notebook
df2.set_index('Time',inplace=True) df2.head()
df2['ACH'].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e8c6c18>
Image in a Jupyter notebook
df2.reset_index(inplace = True) df2.head(1)
df2['Time'] = pd.to_datetime(df2.Time)
df2['Day'] = df2.Time.dt.weekday_name df2.head()
#df3.Day.value_counts()
InfiltrationData = df2.drop(df2.columns[[1,2,3,4,5]], axis =1 ) InfiltrationData.to_csv('FinalData.csv')
df3 = pd.read_csv('FinalData.csv', index_col = 0, parse_dates=True) df3.head()
df3.dtypes
Time object ACH float64 Day object dtype: object
df3['Time'] = pd.to_datetime(df2.Time) #df3['Day'] = pd.to_datetime(df2.Time)
df3.dtypes
Time datetime64[ns] ACH float64 Day object dtype: object
df3 = df3[df3['ACH'] < -0.6] df3 = df3[df3['ACH'] > -5.0] df3.describe()
df3.head()
Fridays = df3[df3['Day'] == 'Friday'] Fridays.set_index('Time',inplace=True) Fridays.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e76a668>
Image in a Jupyter notebook
Tuesdays = df3[df3['Day'] == 'Tuesday'] Tuesdays.set_index('Time',inplace=True) Tuesdays.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e767208>
Image in a Jupyter notebook
Fridays.hist(bins = 100, range = (-2 , -0.5))
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f754e7f0828>]], dtype=object)
Image in a Jupyter notebook
Tuesdays.hist(bins = 100, range = (-2 , -0.5))
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f754e719c18>]], dtype=object)
Image in a Jupyter notebook
Tuesdays.plot.density()
<matplotlib.axes._subplots.AxesSubplot at 0x7f754e249b00>
Image in a Jupyter notebook
Tuesdays.describe()