def get_trsnscritical_coeffs(b, bM, hM, q0, g):
    """2nd- & 0th-order term coefficients of transcritical Bernoulli relation.

    Args:
    -----
        b: a scalar or 1 1D numpy.ndarray; the topo elevation at target locations.
        bM: maximum topo elevation.
        hM: water depth at where the topo elevation is maximum.
        q0: a scalar; the conservative quantity hu at x = 0 (the left) boundary.
        g: gravity.

    Returns:
    --------
        C0: the coefficient of the constant term of the polynomial.
        C2: the coefficient of the quadratic term of the polynomial.
    """

    g2 = 2. * g
    q02 = q0 * q0

    C0 = q02 / g2
    C2 = b - q02 / (g2 * hM * hM) - hM - bM

    return C0, C2