Skip to content
Snippets Groups Projects
Commit a0296c92 authored by Delvigne Frank's avatar Delvigne Frank
Browse files

Upload New File

parent 5918fdb9
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 9 11:03:43 2022
@author: delvigne
"""
'''
Exercice 2.12 -> Kla measurement based on gassing-in/out method
'''
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy import stats
#Import data from excel
df = pd.read_excel ("oxykla.xlsx")
CL = df['Dissolved Oxygen']
t = np.arange(np.size(CL))*2 #Acquisition each 2 seconds
CL2 = CL[50:71] #Selection for the range of CL
#LnCL = [np.log(100-y) for y in CL2]
LnCL =[]
for y in CL2:
LnCLi = np.log(100-y)
LnCL.append(LnCLi)
#linear regression
x = t[50:71]
y = LnCL
slope, intercept, r, p, std_err = stats.linregress(x, y)
def myfunc(x):
return slope * x + intercept
mymodel = list(map(myfunc, x))
plt.scatter(x, y)
plt.plot(x, mymodel)
plt.xlabel('Time (s)')
plt.ylabel('Ln(100-CL)')
plt.show()
KLa = slope
print(-KLa)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment