/**
 * Calculates the required thickness of a pipeline based on various factors.
 *
 * @param pipeDiameter The diameter of the pipeline in meters.
 * @param materialDensity The density of the pipeline material in kilograms per cubic meter.
 * @param operationalPressure The operational pressure of the pipeline in pascals.
 * @return The required thickness of the pipeline in meters.
 * @throws IllegalArgumentException If any of the arguments are negative or zero.
 *
 * Example:
 * calculatePipelineThickness(0.5, 7850, 12000000) => 0.01967
 */
fun calculatePipelineThickness(pipeDiameter: Double, materialDensity: Double, operationalPressure: Double): Double {

    if (pipeDiameter <= 0 || materialDensity <= 0 || operationalPressure <= 0) {
        throw IllegalArgumentException("Arguments must be positive non-zero values.")
    }

    // Determine the required thickness using the Barlow's formula
    val thickness = (2 * operationalPressure * pipeDiameter) / (materialDensity * 0.85)

    return thickness
}
/**
 * Calculates the required thickness of a pipeline based on various factors.
 *
 * @param pipeDiameter The diameter of the pipeline in meters.
 * @param materialDensity The density of the pipeline material in kilograms per cubic meter.
 * @param operationalPressure The operational pressure of the pipeline in pascals.
 * @return The required thickness of the pipeline in meters.
 * @throws IllegalArgumentException If any of the arguments are negative or zero.
 *
 * Example:
 * calculatePipelineThickness(0.5, 7850, 12000000) => 0.01967
 */
fun calculatePipelineThickness(pipeDiameter: Double, materialDensity: Double, operationalPressure: Double): Double {
/**
 * Calculates the required thickness of a pipeline based on various factors.
 *
 * @param pipeDiameter The diameter of the pipeline in meters.
 * @param materialDensity The density of the pipeline material in kilograms per cubic meter.
 * @param operationalPressure The operational pressure of the pipeline in pascals.
 * @return The required thickness of the pipeline in meters.
 * @throws IllegalArgumentException If any of the arguments are negative or zero.
 *
 * Example:
 * calculatePipelineThickness(0.5, 7850, 12000000) => 0.01967
 */
fun calculatePipelineThickness(pipeDiameter: Double, materialDensity: Double, operationalPressure: Double): Double {

    if (pipeDiameter <= 0 || materialDensity <= 0 || operationalPressure <= 0) {
        throw IllegalArgumentException("Arguments must be positive non-zero values.")
    }

    // Determine the required thickness using the Barlow's formula
    val thickness = (2 * operationalPressure * pipeDiameter) / (materialDensity * 0.85)

    return thickness
}