def get_coeffs(b, q0, hL, g):
    """Coefficients of the quadratic and constant terms in the Bernoulli relation.

    Args:
    -----
        b: a scalar or 1 1D numpy.ndarray; the topo elevation at target locations.
        q0: a scalar; the conservative quantity hu at x = 0 (the left) boundary.
        hL: a scalar; the depth h at the x = L (the right) boundary.
        g: gravity.
    """

    C0 = q0 * q0 / (2. * g)
    C1 = b - C0 / (hL * hL) - hL

    return C0, C1