Meeting: Python or spreadsheet?
Hello ,
You can come in now. We've just started. We'd like to know which tool we're going to use to calculate permeability. So far, we've been doing the calculations on a spreadsheet. But a young student trainee told us about Python, which has the advantage of being free. We're testing both solutions.
Méthode : Faire une régression linéaire sur Python
Here's a quick guide to linear regression in Python. We'll be using the Anaconda platform, which you can download free of charge. The platform features the Python language, an environment with numerous scientific libraries and various editors. Here, I'll be using Notebok jupyter notebooks, which allow you to combine text fields, lines of code and code results. You can use these notebooks very easily: as easily or even more easily than a calculator!
import numpy as np
import matplotlib.pyplot as plt
mu=0.001
PTM=np.array([1e4,2e4,3e4,4e4])
J=np.array([2e-6,4e-6,6e-6,7e-6])
plt.plot(PTM,J,'x')
fit=np.polyfit(PTM,J,1)
plt.plot (PTM, fit[0]*PTM+fit[1], 'r--')
print(fit)
pente=fit[0]
Rm=1/(mu*pente)
print('Rm=',Rm)
Méthode : Faire une régression linéaire sur un tableur
Here's a quick overview of how to perform linear regression on a spreadsheet program on LibreOffice, which you can download free of charge onto your computer.
Conseil : Que choisir ?
We can now discuss which choice to make. The Spreadsheet demo took 5 min and the Python demo took 7 min. Time advantage for the spreadsheet. Now I also have the impression that the Python demo was slower, as it was necessary to introduce less familiar concepts. Once the appropriation phase is over, the time needed to carry out the regression should be similar. Now let's take a look at the final rendering. In both cases, we didn't try to improve the form: we should have added units, legends and titles to the graphs...
Well, what do you think ?
It seems to us that on these last arguments, it would be a good idea to choose the Python suite. We know that you, like me, make mistakes, and being able to find them quickly is a point that can save us an enormous amount of time and therefore money!

