docs: def V_vertical_torispherical_concave(D, f, k, h):
      r'''Calculates volume of a vertical tank with a concave torispherical bottom,
      according to [1]_. No provision for the top of the tank is made here.
  
      .. math::
          V = \frac{\pi D^2 h}{4} - v_1(h=a_1+a_2) + v_1(h=a_1 + a_2 -h),\; 0 \le h < a_2
  
      .. math::
          V = \frac{\pi D^2 h}{4} - v_1(h=a_1+a_2) + v_2(h=a_1 + a_2 -h),\; a_2 \le h < a_1 + a_2
  
      .. math::
          V = \frac{\pi D^2 h}{4} - v_1(h=a_1+a_2) + 0,\; h \ge a_1 + a_2
  
      .. math::
          v_1 = \frac{\pi}{4}\left(\frac{2a_1^3}{3} + \frac{a_1D_1^2}{2}\right)
          +\pi u\left[\left(\frac{D}{2}-kD\right)^2 +s\right]
          + \frac{\pi tu^2}{2} - \frac{\pi u^3}{3} + \pi D(1-2k)\left[
          \frac{2u-t}{4}\sqrt{s+tu-u^2} + \frac{t\sqrt{s}}{4}
          + \frac{k^2D^2}{2}\left(\cos^{-1}\frac{t-2u}{2kD}-\alpha\right)\right]
  
      .. math::
          v_2 = \frac{\pi h^2}{4}\left(2a_1 + \frac{D_1^2}{2a_1} - \frac{4h}{3}\right)
  
      .. math::
          \alpha = \sin^{-1}\frac{1-2k}{2(f-k)}
  
      .. math::
          a_1 = fD(1-\cos\alpha)
  
      .. math::
          a_2 = kD\cos\alpha
  
      .. math::
          D_1 = 2fD\sin\alpha
  
      .. math::
          s = (kD\sin\alpha)^2
  
      .. math::
          t = 2a_2
  
      .. math::
          u = h - fD(1-\cos\alpha)
  
      Parameters
      ----------
      D : float
          Diameter of the main cylindrical section, [m]
      f : float
          Dish-radius parameter; fD  = dish radius [1/m]
      k : float
          knuckle-radius parameter ; kD = knuckle radius [1/m]
      h : float
          Height, as measured up to where the fluid ends, [m]
  
      Returns
      -------
      V : float
          Volume [m^3]
  
      Examples
      --------
      Matching example from [1]_, with inputs in inches and volume in gallons.
  
      >>> V_vertical_torispherical_concave(D=113., f=0.71, k=0.081, h=15)/231
      103.88569287163769
  
      References
      ----------
      .. [1] Jones, D. "Compute Fluid Volumes in Vertical Tanks." Chemical
         Processing. December 18, 2003.
         http://www.chemicalprocessing.com/articles/2003/193/
      '''
      alpha = asin((1-2*k)/(2.*(f-k)))
      a1 = f*D*(1-cos(alpha))
      a2 = k*D*cos(alpha)
      D1 = 2*f*D*sin(alpha)
      s = (k*D*sin(alpha))**2
      t = 2*a2
      def V1(h):
          u = h-f*D*(1-cos(alpha))
          v1 = pi/4*(2*a1**3/3. + a1*D1**2/2.) + pi*u*((D/2.-k*D)**2 +s)
          v1 += pi*t*u**2/2. - pi*u**3/3.
          v1 += pi*D*(1-2*k)*((2*u-t)/4.*(s+t*u-u**2)**0.5 + t*s**0.5/4.
          + k**2*D**2/2.*(acos((t-2*u)/(2*k*D)) -alpha))
          return v1
      def V2(h):
          v2 = pi*h**2/4.*(2*a1 + D1**2/(2.*a1) - 4*h/3.)
          return v2
      if 0 <= h < a2:
          Vf = pi*D**2*h/4 - V1(a1+a2) + V1(a1+a2-h)
      elif a2 <= h < a1 + a2:
          Vf = pi*D**2*h/4 - V1(a1+a2) + V2(a1+a2-h)
      else:
          Vf = pi*D**2*h/4 - V1(a1+a2)
      return Vf