def PO2_Calc(KO2, tO2, Kr, I, qO2):
    """
    Calculate PO2.

    :param KO2: oxygen valve constant [kmol.s^(-1).atm^(-1)]
    :type KO2 : float
    :param tO2: oxygen time constant [s]
    :type tO2 : float
    :param Kr: modeling constant [kmol.s^(-1).A^(-1)]
    :type Kr : float
    :param I: cell load current [A]
    :type I : float
    :param qO2: molar flow of oxygen [kmol.s^(-1)
    :type qO2 : float
    :return: PO2 [atm] as float
    """
    try:
        result = ((1 / KO2) / (1 + tO2)) * (qO2 - Kr * I)
        return result
    except (TypeError, ZeroDivisionError):
        print(
            "[Error] PO2 Calculation Failed (KO2:%s, tO2:%s, Kr:%s, I:%s, qO2:%s)" %
            (str(KO2), str(tO2), str(Kr), str(I), str(qO2)))