# CO2 concentration versus time. The maths...



## ian_m (20 Nov 2017)

All this talk about CO2 concentration and why CO2 turn on two hours before lights on got me thinking about how does the CO2 concentration vary with time for our CO2 injected high tech tanks.

Well here is my stab at the maths, remembered from A level maths 35 years ago (oh and my maths books).

For a CO2 injected tank

(CO2 injection rate) – (CO2 loss rate) = (CO2 accumulation)

Assigning some variables so we can write an equation:

_p_ = CO2 mass injected per second
_r_ = CO2 mass lost per second.
_M_ = mass of tank water
_c_ = concentration of CO2 in water
_t_ = time​Thus at time _t_:

p – r = accumulation.​
For a small time δt later
_
p δt - r δt = M δc_​
Note that _Mδc_ (mass times change in concentration) = mass accumulated.

However the CO2 loss rate (_r_) is proportional to the CO2 concentration ie _r = kc_, k is a constant (the loss is probably related to surface area and surface agitation). I suspect may also be related to injection rate as well, for CO2 bubbles that never dissolve and escape, but that calculation is for another time .

Thus

_p δt – kc δt = M δc_​
Rearranging




Letting _δt_ -> 0,







 
This is a first order linear differential equation, whose solution may be looked up in book or manually solved by multiplying by integrating factor and integrating, to remove the differential.

Multiplying by 

 , where e is base of natural logarithm



 


 
Then integrating with respect to _t
_


 



Where A is a constant of integration.

Dividing by 

  and cancelling _M_ gives




At time _t_ = 0 assume _c_ = 0 and substituting in







Putting back equation for _c
_







And this is the relationship we require, showing the relationship between _c_ (the CO2 concentration) and _t_ time.

Things to note are:

Increasing p (CO2 injection rate) increases c (CO2 concentration).
Increasing k (CO2 loss) decreases c (CO2 concentration).
Increasing M (tank water mass) decreases c (CO2 concentration).

Using Sagemath (www.sagemath.org) and putting some numbers in gives the following curves for 3 CO2 injection rates of 2, 4, 8 g/hour into 200litres and assuming k = 0.1 (ie only 10% stays in the water) gives the following curves. X axis is time in seconds, Y access is CO2 concentration in ppm.





For 2g/hour with k changing gives. This shows how CO2 varies CO2 loss due to surface agitation, surface area and even plants consuming CO2.





Finally 2 g/s CO2 injection rate but in three tank sizes. This shows that CO2 eventually reaches the same level, just takes longer with a larger tank.





So does any of this help ?

I think it does help, namely for a certain tank size CO2 the time in getting to a level CO2 concentration and the final CO2 concentration depends solely on CO2 injection rate and the CO2 loss rate.

We can increase CO2 injection rate by just turning up the bps (bubbles per second) and control the loss rate by better injection methods and less (more controlled !)  surface agitation.


----------



## ceg4048 (20 Nov 2017)

Hi Ian,
         The loss rate will also be affected by the solubility of the gas, which is directly related to temperature and ambient pressure. So higher temperatures, where the gas has lower solubility, even a few degrees, will have a significant impact on the loss rate. A tank located in La Paz or Denver will have a higher loss rate than the same tank located in London, for example, due to lower atmospheric pressure.

Cheers,


----------



## Zeus. (20 Nov 2017)

Plus [Plant uptake rate] is going to affect the [CO2] which in turn will effect the loss to some extent. Then most of use have the lights lower for first 30mins then we go for optimal light intensity so [CO2] will drop a little again as the plant CO2 uptake will be maxed until the plants have their fill then [CO2] will increase again until the end of the CO2 period 

But in you example Ian I assume you was talking about a tank free of plants and livestock


----------



## Edvet (20 Nov 2017)

Won't plant uptake rate be just  a few percents?


----------



## ian_m (21 Nov 2017)

All the other CO2 losses, as mentioned above, the plants consuming CO2 and assuming fixed temperature and pressure (don't take your CO2 tank in plane then), all just affect the value of _k_ in the final equation. My comments about never dissolving bubbles of CO2, when thinking about it, just lower the value of _p_ the CO2 injection rate.

The value of _k_ for your tank, as pointed out at a particular temperature and pressure, can be found by tending t -> ∞ (infinity) in which case _k = p / c._

Anyway below is the SageMath code I used to plot the graphs, assuming target of 30ppm.

```
p = var('p, k, M')
p = 2                # Injection rate in g/s
k = p/0.00003        # Loss at 30ppm
M = 200000           # Mass of tank 200litres
c = p/k*(1-e^(-x*k/M))*1000000 # x 10000000 to get in ppm
p1 = plot(c,(x,0,8),rgbcolor=(0,0,1), legend_label="Normal loss rate") # Blue
p1 += point((2,c(x=2)), color='blue', pointsize=50, legend_label=N(c(x=2),2))
k = p/0.00003*0.5    # 1/2 loss rate
c = p/k*(1-e^(-x*k/M))*1000000
p2 = plot(c,(x,0,8),rgbcolor=(0,1,0), legend_label="Low loss rate") # Green
k = p/0.00003*2     # Twice loss rate.
c = p/k*(1-e^(-x*k/M))*1000000
p3 = plot(c,(x,0,8),rgbcolor=(1,0,0), legend_label="High loss rate") # Red
show(p1+p2+p3,ymin=0,ymax=60)
```
Gives the following, x axis is hours, y axis is ppm.
This shows that after two hours CO2 is only 16ppm. So maybe I need more injection rate and greater surface agitation to get to the optimum 30ppm quick.



Anyway SageMath will give you something else to play with now.


----------



## Zeus. (21 Nov 2017)

The slow uptake of CO2 from single CO2 injection esp with a big tank 500l is why I went for a duel CO2 injection method. I have a much higher injection on the booster line which is on at the same time as the steady lower rate. then once Target pH is reached (or very close) the boost injection switches off and is off for the rest of photo period. Have had it dropping the pH as quick as 45mins at times, Takes about 60mins ATM as have a slightly higher pH drop than before. Then pH hold pretty steady for rest of Photoperiod, have it going off 2hrs before lights off.

My smaller tank 50l tanks about 3hours to get pH drop then lights on, only has one atomiser on it

Only problem with a duel injection setup is the initial setup cast as twin regulators needed. Have tried it with a single inline atomiser having both regulars feeding it, worked OK, but get faster pH drop with twin atomisers as you would expect


----------

