def tocreset(I, Ipickup, TD, curve='U1', CTR=1):
    """
    Time OverCurrent Reset Time Function
    
    Function to calculate the time to reset for a TOC
    (Time-OverCurrent, 51) element.
    
    Parameters
    ----------
    I:          float
                Measured Current in Amps
    Ipickup:    float
                Fault Current Pickup Setting (in Amps)
    TD:         float
                Time Dial Setting
    curve:      string, optional
                Name of specified TOC curve, may be entry from set:
                {U1,U2,U3,U4,U5,C1,C2,C3,C4,C5}, default=U1
    CTR:        float, optional
                Current Transformer Ratio, default=1
    
    Returns
    -------
    tr:         float
                Time-to-Reset for characterized element.
    """
    curve = curve.upper()
    C = {'U1': 1.08, 'U2': 5.95, 'U3': 3.88, 'U4': 5.67, 'U5': 0.323, 'C1':
        13.5, 'C2': 47.3, 'C3': 80.0, 'C4': 120.0, 'C5': 4.85}
    M = I / (CTR * Ipickup)
    tr = TD * (C[curve] / (1 - M ** 2))
    return tr
