docs: def K_run_diverging_Crane(D_run, D_branch, Q_run, Q_branch, angle=90):
      r'''Returns the loss coefficient for the run of a converging tee or wye
      according to the Crane method [1]_.
      
      .. math::
          K_{run} = M \left(\frac{Q_{branch}}{Q_{comb}}\right)^2
              
      .. math::
          \beta_{branch} = \frac{D_{branch}}{D_{comb}}
      
      See the notes for the definition of M.
  
      Parameters
      ----------
      D_run : float
          Diameter of the straight-through inlet portion of the tee or wye [m]
      D_branch : float
          Diameter of the pipe attached at an angle to the straight-through, [m]
      Q_run : float
          Volumetric flow rate in the straight-through outlet of the tee or wye,
          [m^3/s]
      Q_branch : float
          Volumetric flow rate in the pipe attached at an angle to the straight-
          through, [m^3/s]
      angle : float, optional
          Angle the branch makes with the straight-through (tee=90, wye<90)
          [degrees]
  
      Returns
      -------
      K : float
          Loss coefficient of run with respect to the velocity and inside 
          diameter of the combined flow inlet [-]
  
      Notes
      -----
      M is calculated according to the following pseudocode:
          
      .. code-block:: python
  
          if beta*beta <= 0.4:
              M = 0.4
          elif Q_branch/Q_comb <= 0.5:
              M = 2*(2*Q_branch/Q_comb - 1)
          else:
              M = 0.3*(2*Q_branch/Q_comb - 1)
  
      Examples
      --------
      Example 7-36 of [1]_. A DN150 schedule 80 wye has 1515 liters/minute of
      water exiting the straight leg, and 950 liters/minute of water
      exiting it through a 45° branch. Calculate the loss coefficient in
      the branch. The calculated value there is -0.06809.
      
      >>> K_run_diverging_Crane(0.146, 0.146, 0.02525, 0.01583, angle=45)
      -0.06810067607153049
      
      References
      ----------
      .. [1] Crane Co. Flow of Fluids Through Valves, Fittings, and Pipe. Crane,
         2009.
      '''
      beta = (D_branch/D_run)
      beta2 = beta*beta
      Q_comb = Q_run + Q_branch
      Q_ratio = Q_branch/Q_comb
      if beta2 <= 0.4:
          M = 0.4
      elif Q_ratio <= 0.5:
          M = 2.*(2.*Q_ratio - 1.)
      else:
          M = 0.3*(2.*Q_ratio - 1.)
      return M*Q_ratio*Q_ratio