# Linear approximation of the given equation with python3 [closed]

I was given a set of raw datum and have to model it by means of some machine learning techniques. After some research, I decided to do with the method of linear approximation.

### Description of the equation.

• z - depth (meters)

• T(z) - temperature at the depth z

• T(zᵢ) - temperature at the depth zᵢ

• T₀ - temperature at the surface (It is constant and known)

• K - coefficient of geothermal gradient (How the temperature changes with respect to the depth)

• Mᵢ - flow rate of the liquid at the depth zᵢ

As it is shown from the equation we can find the temperature of the liquid in the any depth of the well bore.

I have list of depths, temperature and the flow rate of the liquid. I have to model an equation according to these datum by means of python3 and find K and c. Currently I use matplotlib library for such type of calculations.