Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Modelling physical and biological systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mipi
Lectures
Modelling physical and biological systems
Commits
a0296c92
Commit
a0296c92
authored
2 years ago
by
Delvigne Frank
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
5918fdb9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ex_2_12.py
+55
-0
55 additions, 0 deletions
Ex_2_12.py
with
55 additions
and
0 deletions
Ex_2_12.py
0 → 100644
+
55
−
0
View file @
a0296c92
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment