def METHOD_NAME(r):
    if r < beam_r:
        bt = -current * r * con.mu_0 / (2.*np.pi*beam_r**2)
    elif r >= beam_r and r < r_pipe:
        bt = -current * con.mu_0 / (2.*np.pi*r)
    else:
        bt = np.zeros_like(r)
    return bt