<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, Numerical Inverse Laplace Transform</title>
    <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 16:25:42 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 16:25:42 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, Numerical Inverse Laplace Transform</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform</link>
    </image>
    <item>
      <title>Numerical Inverse Laplace Transform</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment79258</link>
      <itunes:summary>Greetings.  From the link above, the description of Post's formula states, 

"As can be seen from the formula, the need to evaluate derivatives of arbitrarily high orders renders this formula impractical for most purposes."  

With all of that said, using the Bromwich Integral might be a better method for higher orders of "s".  

&gt; # Example 1 with small value of exponent(3):
&gt; restart:
&gt; L(s):=2/s^3;
&gt; ls:=exp(s*t)*L(s);
&gt; denominator:=factor(denom(ls));
&gt; p:=solve(denom(ls)=0,s);
&gt; res:=px-&gt;residue(ls,s=p[px]);
&gt; res1:=res(1);
&gt; evalf(subs(t=10.0,res1));

The answer matches your procedure above.

&gt; # Example 2 with larger value of exponent(5):
&gt; restart:
&gt; L(s):=2/s^5;
&gt; ls:=exp(s*t)*L(s);
&gt; denominator:=factor(denom(ls));
&gt; p:=solve(denom(ls)=0,s);
&gt; res:=px-&gt;residue(ls,s=p[px]);
&gt; res1:=res(1);
&gt; evalf(subs(t=10.0,res1));

Here we get an answer that matches what intrans(invlaplace) yields with the substitution of t=10.  Because of the higher order of s, the procedure you have listed above does not return a numerical value.

Regards,
Georgios Kokovidis

P.S.  Welcome back to Maple.  I missed your posts.  Most of what I know in Maple I learned from studying examples like yours.  Thanks.</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>79258</guid>
      <pubDate>Fri, 27 Oct 2006 05:40:22 Z</pubDate>
      <itunes:author>gkokovidis</itunes:author>
      <author>gkokovidis</author>
    </item>
    <item>
      <title>Floating values</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment86267</link>
      <itunes:summary>It returns the answer if the entered value is a float, &lt;pre&gt;ILT(2/s^5,s)(10.);
                             &lt;maple&gt;833.3333333&lt;/maple&gt;&lt;/pre&gt;Thank you for mentioning that, I'll add convertion to floats.

The inverse Laplace transform is an ill-posed numerical problem, so there is no a solution that is good for all cases. Bromwich integral requires knowing the maximum real part of the poles. It also has numerical problems related to calculating of large exponentials. Is a method practical or not, is a matter of opinion. Every method has it's own boundaries. 

Thank you for welcoming me back. Who knows how long that will last this time... 

__________
Alec Mihailovs 
&lt;a href="http://mihailovs.com/Alec/"&gt;http://mihailovs.com/Alec/&lt;/a&gt;</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>86267</guid>
      <pubDate>Fri, 27 Oct 2006 11:04:38 Z</pubDate>
      <itunes:author>alec</itunes:author>
      <author>alec</author>
    </item>
    <item>
      <title>Stehfest algorithm</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment79252</link>
      <itunes:summary>&lt;pre&gt;
num_invLaplace_1:=proc(F,tau)
# Stehfest algorithm, according to Kou
#option remember;
local oldDigits, w,g, result, n,nMax, r,k, t;

nMax:=20;
oldDigits:=Digits: Digits:=oldDigits + max(80, 2*nMax);

w:= unapply( (-1)^(n-k)*k^n/k!/(n-k)!, k,n);
g:= unapply( ln(2)/t*(2*k)!/k!/(k-1)!*Sum( (-1)^r*binomial(k,r)*F((k+r)*ln(2)/t)  ,r=0..k), k,t):

t:=evalf(tau);
result:= 0;

k:=1;
while ( k LE nMax ) do
  result:= evalf(result + w(k, nMax)*g(k,t));
  k := k+1;
end do;

return evalf[oldDigits](result);
end proc;

Read 'LE' as less or equal (i never understand how to input that here ...)

some test functions:

#F:= s -&gt; 1 / (s + 0.5);  F:= s -&gt; 1/((s^2-1)^(1/2)); F:= s -&gt; s^2/(s^2+2^2)^(3/2);
F:= s -&gt; 2/s^8;
inttrans[invlaplace](F(s), s, T):
f:=unapply(%,T); #plot( f(t), t=0..8);

                                       2
                            F := s -&gt; ----
                                        8
                                       s

                                           7
                         f := T -&gt; 1/2520 T
some test values:

tTst:=10;
num_invLaplace_1(F,tTst); #num_invLaplace(F,tTst); 
evalf(f(tTst)); 
`approximation error` = evalf(%-%%);
                              tTst := 10

                           3968.2539682541
                           3968.2539682540
                                                -9
                   approximation error = -0.1 10

The other test functions involve Bessel functions and need more steps.
&lt;/pre&gt;</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>79252</guid>
      <pubDate>Fri, 27 Oct 2006 19:10:59 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>LE</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment86264</link>
      <itunes:summary>Axel, 

Thank you again. 

The input here is in html, so html entities should be used for special characters, see the list of them at &lt;a href="http://www.w3schools.com/tags/ref_entities.asp"&gt;HTML 4.01 Entities Reference&lt;/a&gt; or at &lt;a href="http://www.bbsinc.com/iso8859.html"&gt;ASCII - ISO 8859-1 (Latin-1) Table with HTML Entity Names&lt;/a&gt;. In particular, less-than sign can be entered as &amp;amp;lt; 

__________
Alec Mihailovs 
&lt;a href="http://mihailovs.com/Alec/"&gt;http://mihailovs.com/Alec/&lt;/a&gt;</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>86264</guid>
      <pubDate>Fri, 27 Oct 2006 23:42:03 Z</pubDate>
      <itunes:author>alec</itunes:author>
      <author>alec</author>
    </item>
    <item>
      <title>Whitt</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment79246</link>
      <itunes:summary>&lt;pre&gt;
http://www.columbia.edu/~ww2040/JoC.pdf &amp; his page for more concurrent work of Whitt ...

The input: Thx, but i hate that HTML cryptics - other boards provide copy &amp; paste for code.
&lt;/pre&gt;</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>79246</guid>
      <pubDate>Sat, 28 Oct 2006 01:40:29 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>Stehfest algorithm, vector format</title>
      <link>http://www.mapleprimes.com/posts/42361-Numerical-Inverse-Laplace-Transform?ref=Feed:MaplePrimes:Numerical Inverse Laplace Transform:Comments#comment79235</link>
      <itunes:summary>&lt;pre&gt;
Here is the same in 'vector format', which is faster.

If the function to be input is real without singularities then the procedure is
converging after ~ 20 steps (but for the example where Bessels are involved the
evaluations may result in complex values, dito for 1/sqrt(s-1)) and the thing
becomes not very reliable (just try the last examples in a point T=12 or so).
But for good situations is is fine.

As a variant I played with (pre-)computing the factorials with high precision and
then to continue with working precision. It was not convincing (and needs to take
too much care for the number of steps), 60 - 80 digits seems to be needed at least.

  num_invLaplace_2:=proc(F,tau) #option remember;
  local oldDigits, n, r,k, t, result, Y,B,W,G;
  
  n:=80; # max of fct evaluations and summands
  oldDigits:=Digits: 
  Digits:=oldDigits + max(80, 2*n);
  
  t:= evalf(tau);
  Y:= Vector((0+1)..(n+n), (k) -&gt; F(k*ln(2.0)/t) ); 
  B:= Matrix(1 .. n, 1+0 .. 1+n, (i,j) -&gt; binomial(i,j-1) );
  W:= Vector(1 .. n, (k) -&gt; (-1)^(n-k)*k^n/k!/(n-k)!  *  (2*k)!/k!/(k-1)! );
  G:= Vector(1 .. n, (k) -&gt; add((-1)^r*B[k,r+1]*Y[k+r], r = 0 .. k) );
  
  result:= ln(2.0)/t * add( evalf(W[k]*G[k]), k=1 .. n);

  return Re( evalf[oldDigits](result) );
  end proc;


Likewise one can use a recursion to get the weights (a bit faster):

  W:= Vector(1 .. n);
  W[1]:= 2*(-1)^(n-1)/(n-1)!;
  for k from 1 to n-1 do
    W[k+1] := ( 2*(2*k+1)*(k-n)*((k+1)/k)^(n-1)/k^2 ) * W[k];
  end do; k:='k';
&lt;/pre&gt;</itunes:summary>
      <description>The latest comments added to the Post, Numerical Inverse Laplace Transform</description>
      <guid>79235</guid>
      <pubDate>Sun, 29 Oct 2006 21:13:15 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
  </channel>
</rss>