/**
 * Given a list of temperature measurements (in Celsius) at different depths (in meters), calculate the heat flow
 * (in Watts per square meter) at each depth using the formula:
 * heat_flow = thermal_conductivity * (temperature_difference / depth_interval)
 *
 * @param data A list of pairs where each pair represents (temperature, depth) in Celsius and meters respectively.
 * @return A list of heat flow values in Watts per square meter at each depth.
 */
fun calculateHeatFlow(data: List<Pair<Double, Double>>): List<Double> {

    val heatFlows = mutableListOf<Double>()

    for (i in 1 until data.size) {
        val temperatureDifference = data[i].first - data[i - 1].first
        val depthInterval = data[i].second - data[i - 1].second
        val heatFlow = temperatureDifference / depthInterval
        heatFlows.add(heatFlow)
    }

    return heatFlows
}
/**
 * Given a list of temperature measurements (in Celsius) at different depths (in meters), calculate the heat flow
 * (in Watts per square meter) at each depth using the formula:
 * heat_flow = thermal_conductivity * (temperature_difference / depth_interval)
 *
 * @param data A list of pairs where each pair represents (temperature, depth) in Celsius and meters respectively.
 * @return A list of heat flow values in Watts per square meter at each depth.
 */
fun calculateHeatFlow(data: List<Pair<Double, Double>>): List<Double> {
/**
 * Given a list of temperature measurements (in Celsius) at different depths (in meters), calculate the heat flow
 * (in Watts per square meter) at each depth using the formula:
 * heat_flow = thermal_conductivity * (temperature_difference / depth_interval)
 *
 * @param data A list of pairs where each pair represents (temperature, depth) in Celsius and meters respectively.
 * @return A list of heat flow values in Watts per square meter at each depth.
 */
fun calculateHeatFlow(data: List<Pair<Double, Double>>): List<Double> {

    val heatFlows = mutableListOf<Double>()

    for (i in 1 until data.size) {
        val temperatureDifference = data[i].first - data[i - 1].first
        val depthInterval = data[i].second - data[i - 1].second
        val heatFlow = temperatureDifference / depthInterval
        heatFlows.add(heatFlow)
    }

    return heatFlows
}