docs: def V_vertical_torispherical(D, f, k, h):
      r'''Calculates volume of a vertical tank with a convex torispherical bottom,
      according to [1]_. No provision for the top of the tank is made here.
  
      .. math::
          V_f = \frac{\pi h^2}{4}\left(2a_1 + \frac{D_1^2}{2a_1}
          - \frac{4h}{3}\right),\; 0 \le h \le a_1
  
      .. math::
          V_f = \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]
          ,\; a_1 < h \le a_1 + a_2
  
      .. math::
          V_f = \frac{\pi}{4}\left(\frac{2a_1^3}{3} + \frac{a_1D_1^2}{2}\right)
          +\frac{\pi t}{2}\left[\left(\frac{D}{2}-kD\right)^2 +s\right]
          +\frac{\pi  t^3}{12} + \pi D(1-2k)\left[\frac{t\sqrt{s}}{4}
          + \frac{k^2D^2}{2}\sin^{-1}(\cos\alpha)\right]
          + \frac{\pi D^2}{4}[h-(a_1+a_2)] ,\;  a_1 + a_2 < h
  
      .. 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(D=132., f=1.0, k=0.06, h=24)/231.
      904.0688283793511
  
      References
      ----------
      .. [1] Jones, D. "Calculating Tank Volume." Text. Accessed December 22, 2015.
         http://www.webcalc.com.br/blog/Tank_Volume.PDF'''
      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
      u = h - f*D*(1 - cos(alpha))
  
      if 0 <= h <= a1:
          Vf = pi*h**2/4*(2*a1 + D1**2/2/a1 - 4*h/3)
      elif a1 < h <= a1 + a2:
          Vf = (pi/4*(2*a1**3/3 + a1*D1**2/2.) + pi*u*((D/2. - k*D)**2 + s)
          + pi*t*u**2/2. - pi*u**3/3. + 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)))
      else:
          Vf = pi/4*(2*a1**3/3. + a1*D1**2/2.) + pi*t/2.*((D/2 - k*D)**2
          + s) + pi*t**3/12. + pi*D*(1 - 2*k)*(t*s**0.5/4
          + k**2*D**2/2*asin(cos(alpha))) + pi*D**2/4*(h - (a1 + a2))
      return Vf