docs: def K_plug_valve_Crane(D1, D2, angle, fd=None, style=0):
      r'''Returns the loss coefficient for a plug valve or cock valve as shown in
      [1]_.
  
      If β = 1:
          
      .. math::
          K = K_1 = K_2 = Nf_d
          
      Otherwise:
          
      .. math::
          K_2 = \frac{K + 0.5\sqrt{\sin\frac{\theta}{2}}(1-\beta^2) 
          + (1-\beta^2)^2}{\beta^4}
          
      Three types of plug valves are supported. For straight-through plug valves
      (`style` = 0), N = 18. For 3-way, flow straight through (`style` = 1) 
      plug valves, N = 30. For 3-way, flow 90° valves (`style` = 2) N = 90.
          
      Parameters
      ----------
      D1 : float
          Diameter of the valve plug bore (must be equal to or smaller than 
          `D2`), [m]
      D2 : float
          Diameter of the pipe attached to the valve, [m]
      angle : float
          Angle formed by the reducer in the valve, [degrees]
      fd : float, optional
          Darcy friction factor calculated for the actual pipe flow in clean 
          steel (roughness = 0.0018 inch) in the fully developed turbulent 
          region; do not specify this to use the original Crane friction factor!,
          [-]
      style : int, optional
          Either 0 (straight-through), 1 (3-way, flow straight-through), or 2 
          (3-way, flow 90°) [-]
  
      Returns
      -------
      K : float
          Loss coefficient with respect to the pipe inside diameter [-]
  
      Notes
      -----    
      This method is not valid in the laminar regime and the pressure drop will
      be underestimated in those conditions.
  
      Examples
      --------
      >>> K_plug_valve_Crane(D1=.01, D2=.02, angle=50)
      19.80513692341617
      
      References
      ----------
      .. [1] Crane Co. Flow of Fluids Through Valves, Fittings, and Pipe. Crane,
         2009.
      '''
      if fd is None:
          fd = ft_Crane(D2)
      beta = D1/D2
      try:
          K = plug_valve_Crane_coeffs[style]*fd
      except KeyError:
          raise KeyError('Accepted valve styles are 0 (straight-through), 1 (3-way, flow straight-through), or 2 (3-way, flow 90°)')
      angle = radians(angle)
      if beta == 1:
          return K
      else:
          return (K + 0.5*(sin(angle/2))**0.5 * (1 - beta**2) + (1-beta**2)**2)/beta**4