<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def API520_B(Pset, Pback, overpressure=0.1):
    r'''Calculates capacity correction due to backpressure on balanced
    spring-loaded PRVs in vapor service. For pilot operated valves,
    this is always 1. Applicable up to 50% of the percent gauge backpressure,
    For use in API 520 relief valve sizing. 1D interpolation among a table with
    53 backpressures is performed.

    Parameters
    ----------
    Pset : float
        Set pressure for relief [Pa]
    Pback : float
        Backpressure, [Pa]
    overpressure : float, optional
        The maximum fraction overpressure; one of 0.1, 0.16, or 0.21, []

    Returns
    -------
    Kb : float
        Correction due to vapor backpressure [-]

    Notes
    -----
    If the calculated gauge backpressure is less than 30%, 38%, or 50% for
    overpressures of 0.1, 0.16, or 0.21, a value of 1 is returned.

    Percent gauge backpressure must be under 50%.

    Examples
    --------
    Custom examples from figure 30:

    >>> API520_B(1E6, 5E5)
    0.7929945420944432

    References
    ----------
    .. [1] API Standard 520, Part 1 - Sizing and Selection.
    '''
    gauge_backpressure = (Pback-atm)/(Pset-atm)*100 # in percent
    if overpressure not in [0.1, 0.16, 0.21]:
        raise Exception('Only overpressure of 10%, 16%, or 21% are permitted')
    if (overpressure == 0.1 and gauge_backpressure < 30) or (
        overpressure == 0.16 and gauge_backpressure < 38) or (
        overpressure == 0.21 and gauge_backpressure < 50):
        return 1
    elif gauge_backpressure > 50:
        raise Exception('Gauge pressure must be < 50%')
    if overpressure == 0.16:
        Kb = interp(gauge_backpressure, Kb_16_over_x, Kb_16_over_y)
    elif overpressure == 0.1:
        Kb = interp(gauge_backpressure, Kb_10_over_x, Kb_10_over_y)
    return Kb