docstr: Compute time-domain Stehfest algorithm solution.
  
  .. math ::
  
      f(t,M) = \frac{\log 2}{t} \sum_{k=1}^{M} V_k \bar{f}\left(
      p_k \right)
  
  where
  
  .. math ::
  
      V_k = (-1)^{k + N/2} \sum^{\min(k,N/2)}_{i=\lfloor(k+1)/2 \rfloor}
      \frac{i^{\frac{N}{2}}(2i)!}{\left(\frac{N}{2}-i \right)! \, i! \,
      \left(i-1 \right)! \, \left(k-i\right)! \, \left(2i-k \right)!}
  
  As the degree increases, the abscissa (`p_k`) only increase
  linearly towards `\infty`, but the Stehfest coefficients
  (`V_k`) alternate in sign and increase rapidly in sign,
  requiring high precision to prevent overflow or loss of
  significance when evaluating the sum.
  
  **References**
  
  1. Widder, D. (1941). *The Laplace Transform*. Princeton.
  2. Stehfest, H. (1970). Algorithm 368: numerical inversion of
     Laplace transforms. *Communications of the ACM* 13(1):47-49,
     http://dx.doi.org/10.1145/361953.361969
docstr_tok: ["Compute","time-domain","Stehfest","algorithm","solution",".","..","math",":",":","f","(","t",",","M",")","=","\\frac","{","\\log","2","}","{","t","}","\\sum_","{","k=1","}","^","{","M","}","V_k","\\bar","{","f","}","\\left","(","p_k","\\right",")","where","..","math",":",":","V_k","=","(","-1",")","^","{","k","+","N\/2","}","\\sum^","{","\\min","(","k",",","N\/2",")","}","_","{","i=\\lfloor","(","k+1",")","\/2","\\rfloor","}","\\frac","{","i^","{","\\frac","{","N","}","{","2","}","}","(","2i",")","!","}","{","\\left","(","\\frac","{","N","}","{","2","}","-i","\\right",")","!","\\",",","i","!","\\",",","\\left","(","i-1","\\right",")","!","\\",",","\\left","(","k-i\\right",")","!","\\",",","\\left","(","2i-k","\\right",")","!","}","As","the","degree","increases",",","the","abscissa","(","`","p_k","`",")","only","increase","linearly","towards","`","\\infty","`",",","but","the","Stehfest","coefficients","(","`","V_k","`",")","alternate","in","sign","and","increase","rapidly","in","sign",",","requiring","high","precision","to","prevent","overflow","or","loss","of","significance","when","evaluating","the","sum",".","*","*","References","*","*","1",".","Widder",",","D.","(","1941",")",".","*","The","Laplace","Transform","*",".","Princeton",".","2",".","Stehfest",",","H.","(","1970",")",".","Algorithm","368",":","numerical","inversion","of","Laplace","transforms",".","*","Communications","of","the","ACM","*","13","(","1",")",":47-49",",","http",":","\/\/dx.doi.org\/10.1145\/361953.361969"]
code: def calc_time_domain_solution(self, fp, t, manual_prec=False):
      r"""Compute time-domain Stehfest algorithm solution.
  
      .. math ::
  
          f(t,M) = \frac{\log 2}{t} \sum_{k=1}^{M} V_k \bar{f}\left(
          p_k \right)
  
      where
  
      .. math ::
  
          V_k = (-1)^{k + N/2} \sum^{\min(k,N/2)}_{i=\lfloor(k+1)/2 \rfloor}
          \frac{i^{\frac{N}{2}}(2i)!}{\left(\frac{N}{2}-i \right)! \, i! \,
          \left(i-1 \right)! \, \left(k-i\right)! \, \left(2i-k \right)!}
  
      As the degree increases, the abscissa (`p_k`) only increase
      linearly towards `\infty`, but the Stehfest coefficients
      (`V_k`) alternate in sign and increase rapidly in sign,
      requiring high precision to prevent overflow or loss of
      significance when evaluating the sum.
  
      **References**
  
      1. Widder, D. (1941). *The Laplace Transform*. Princeton.
      2. Stehfest, H. (1970). Algorithm 368: numerical inversion of
         Laplace transforms. *Communications of the ACM* 13(1):47-49,
         http://dx.doi.org/10.1145/361953.361969
  
      """
  
      # required
      self.t = self.ctx.convert(t)
  
      # assume fp was computed from p matrix returned from
      # calc_laplace_parameter(), so is already
      # a list or matrix of mpmath 'mpf' types
  
      result = self.ctx.fdot(self.V, fp) * self.ctx.ln2 / self.t
  
      # setting dps back to value when calc_laplace_parameter was called
      if not manual_prec:
          self.ctx.dps = self.dps_orig
  
      # ignore any small imaginary part
      return result.real
  
label_desc: Use image node_id 3 for calling the Stehfest obj's underlying member method code with example usage: obj.calc_time_domain_solution(fp, t, manual_prec) and returns: result