/**
 * Calculates the required reinforcement for a simply supported beam based on its dimensions and load.
 *
 * @param b The width of the beam (in meters).
 * @param h The height of the beam (in meters).
 * @param L The length of the beam (in meters).
 * @param load The load acting on the beam (in newtons).
 * @return The required reinforcement area (in square meters).
 */
fun calculateBeamDesign(b: Double, h: Double, L: Double, load: Double): Double? {

    return if (b > 0 && h > 0 && L > 0 && load > 0) {
        when {
            b * h < L * L -> (6 * load * L * L) / (Math.PI * b * b)
            b * h > L * L -> (4 * load * L * L) / (Math.PI * h * h)
            else -> (5 * load * L * L) / (3 * Math.PI * b * h)
        }
    } else {
        null
    }
}
/**
 * Calculates the required reinforcement for a simply supported beam based on its dimensions and load.
 *
 * @param b The width of the beam (in meters).
 * @param h The height of the beam (in meters).
 * @param L The length of the beam (in meters).
 * @param load The load acting on the beam (in newtons).
 * @return The required reinforcement area (in square meters).
 */
fun calculateBeamDesign(b: Double, h: Double, L: Double, load: Double): Double? {
/**
 * Calculates the required reinforcement for a simply supported beam based on its dimensions and load.
 *
 * @param b The width of the beam (in meters).
 * @param h The height of the beam (in meters).
 * @param L The length of the beam (in meters).
 * @param load The load acting on the beam (in newtons).
 * @return The required reinforcement area (in square meters).
 */
fun calculateBeamDesign(b: Double, h: Double, L: Double, load: Double): Double? {

    return if (b > 0 && h > 0 && L > 0 && load > 0) {
        when {
            b * h < L * L -> (6 * load * L * L) / (Math.PI * b * b)
            b * h > L * L -> (4 * load * L * L) / (Math.PI * h * h)
            else -> (5 * load * L * L) / (3 * Math.PI * b * h)
        }
    } else {
        null
    }
}