def calc_eaf(delta_T, N_lay, P_i, A_i, v, A_p, D_i, t_p, alpha, E_p, thick=False):
    """Return the effective axial force [N], negative in compression."""
    if thick:
        return (
            N_lay
            - P_i * A_i
            + 2 * P_i * v * (A_p / 4) * (D_i / t_p - 1)
            - alpha * delta_T * E_p * A_p
        )
    else:
        return N_lay - P_i * A_i * (1 - 2 * v) - A_p * E_p * alpha * delta_T