def METHOD_NAME(t):
    global Pinv
    if t > imin and t < icrit:
        cd = Pinv@neurons.r
        err = neurons.z - zx(t)
        neurons.BPhi -= cd*err
        Pinv -= np.outer(cd,cd)/( 1 + np.dot(neurons.r, cd))