A borehole logged the temperature at seven depths. You will fit a straight line, turn its slope into a heat flow and find how deep a well must go to reach a given temperature.
The idea. A least-squares line fits the readings. The heat flow is . The slope in K/km times a conductivity in gives in mW/m².
Your tasks.
fit_line, return the slope and the intercept of the least-squares line through the readings.heat_flow, return the heat flow in mW/m² for a conductivity k in .depth_for, return the depth in km at which the fitted line reaches the temperature T.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…