def kUB_(B,kUB,Cooperativity,P):
    """Returns the receptor binding rate kUB for either the cooperative or the non-cooperative binding model.

    Parameters
    ----------
    B : float
        Number of bound receptors.
    kUB : float
        Rate at which AMPARs bind to PSD slots.
    Cooperativity : 0, 1
        Specifies whether cooperative recepotr binding is accounted for (=1) or not (=0).
    P : float
        Number of binding site/slots at the PSD.
        
    Returns
    -------
    float
        kUB.
    """
    if Cooperativity==1:       
        m = 24.6/(12.5 + P);
        return kUB*(m*B**0.8 + 1);
    else:
        return kUB