We can infer the infiltration rate from the rate of carbon dioxide decrease.
$$ \frac{\Delta\ concentration}{\Delta t} \cdot \frac{1}{outside\ concentration - inside\ concentration}$$%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
data = pd.read_csv('Indoor_3-3-2016.csv',
skiprows=3, # ignore the first 3 rows of data
sep=';', # semicolon is used to separate data values
index_col=1, # use column 1 as the dates to index the data
parse_dates=True) # convert the date string into a date object
inside_concentration = data['CO2']
concentration_slope = data['CO2'].diff()/data['Timestamp'].diff()
concentration_slope = concentration_slope.where(concentration_slope<0, 0)
infiltration_rate = concentration_slope/(inside_concentration - 400.)*3600
ax = infiltration_rate.plot()
ax.set_ylim((-1,1))
ax.grid()
#data['CO2'].plot()
infiltration_rate.describe()
infiltration_rate.hist(bins=50)
data['CO2'].plot()
time2 = '2016-02-23 12:15:00'
time1 = '2016-02-23 12:45:00'
rise = data['CO2'][time2] - data['CO2'][time1]
run = (data['Timestamp'][time2] - data['Timestamp'][time1])
print(data['CO2'][time2])
print(rise)
print('run =',run)
print('slope =', rise/run)
rise / run * 3600 / (data['CO2'][time2]-400)
time2 = '2016-02-24 05:00:00'
time1 = '2016-02-24 07:00:00'
data[time2:time1]
time2 = '2016-02-24 05:45:00'
time1 = '2016-02-24 06:15:00'
rise = data['CO2'][time2] - data['CO2'][time1]
run = (data['Timestamp'][time2] - data['Timestamp'][time1])
print(data['CO2'][time2])
print(rise)
print('run =', run)
print('slope =', rise/run)
rise / run * 3600 / (data['CO2'][time2]-400)
time2 = '2016-02-23 09:15:00'
time1 = '2016-02-23 08:45:00'
rise = data['CO2'][time2] - data['CO2'][time1]
run = (data['Timestamp'][time2] - data['Timestamp'][time1])
rise/run