docs: def from_total_moment_rate(cls, min_mag, b_val, char_mag,
                                 total_moment_rate, bin_width):
          """
          Define Youngs and Coppersmith 1985 MFD by constraing cumulative a
          value and characteristic rate from total moment rate.
          The cumulative a value and characteristic rate are obtained by
          solving equations (16) and (17), page 954, for the cumulative rate of
          events with magnitude greater than the minimum magnitude - N(min_mag)
          - and the cumulative rate of characteristic earthquakes - N(char_mag).
          The difference ``N(min_mag) - N(char_mag)`` represents the rate of
          noncharacteristic, exponentially distributed earthquakes and is used
          to derive the cumulative a value by solving the following equation ::
  
              10 ** (a_val - b_val * min_mag) -
              10 ** (a_val - b_val * (char_mag - 0.25))
              = N(min_mag) - N(char_mag)
  
          which can be written as ::
  
              a_val =
              log10(N(min_mag) - N(char_mag)) /
              (10 ** (- b_val * min_mag) - 10 ** (- b_val * (char_mag - 0.25))
  
          In the calculation of N(min_mag) and N(char_mag), the Hanks and
          Kanamori (1979) formula ::
  
              M0 = 10 ** (1.5 * Mw + 9.05)
  
          is used to convert moment magnitude (Mw) to seismic moment (M0,
          Newton × m)
  
          :param min_mag:
              The lowest magnitude for the MFD. The first bin in the
              :meth:`result histogram <get_annual_occurrence_rates>` is aligned
              to make its left border match this value.
          :param b_val:
              The Gutenberg-Richter ``b`` value -- the gradient of the loglinear
              G-R relationship.
          :param char_mag:
              The characteristic magnitude defining the middle point of
              characteristic distribution. That is the boxcar function
              representing the characteristic distribution is defined in the
              range [char_mag - 0.25, char_mag + 0.25].
          :param total_moment_rate:
              Total moment rate in N * m / year.
          :param bin_width:
              A positive float value -- the width of a single histogram bin.
          :returns:
              An instance of :class:`YoungsCoppersmith1985MFD`.
  
          Values for ``min_mag`` and the maximum magnitude (char_mag + 0.25)
          don't have to be aligned with respect to ``bin_width``. They get
          rounded accordingly anyway so that both are divisible by ``bin_width``
          just before converting a function to a histogram.
          See :meth:`_get_min_mag_and_num_bins`.
          """
          beta = b_val * numpy.log(10)
          mu = char_mag + DELTA_CHAR / 2
          m0 = min_mag
  
          # seismic moment (in Nm) for the maximum magnitude
          c = 1.5
          d = 9.05
          mo_u = 10 ** (c * mu + d)
  
          # equations (16) and (17) solved for N(min_mag) and N(char_mag)
          c1 = numpy.exp(-beta * (mu - m0 - 0.5))
          c2 = numpy.exp(-beta * (mu - m0 - 1.5))
          c3 = beta * c2 / (2 * (1 - c1) + beta * c2)
          c4 = (b_val * (10 ** (-c / 2)) / (c - b_val)) + \
               (b_val * numpy.exp(beta) * (1 - (10 ** (-c / 2))) / c)
          n_min_mag = (1 - c1) * total_moment_rate / ((1 - c3) * c1 * mo_u * c4)
          n_char_mag = c3 * n_min_mag
  
          a_val = numpy.log10(
              (n_min_mag - n_char_mag) /
              (10 ** (- b_val * min_mag) - 10 ** (- b_val * (char_mag - 0.25)))
          )
  
          return cls(min_mag, a_val, b_val, char_mag, n_char_mag, bin_width)