Numerical Inversion of Laplace Transforms: 
The Fourier Series Approximation
Author's Data: Housam BINOUS
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA
Email: binoushousam@yahoo.com

Acknowledgement :
Rice and Do, Applied Mathematics and Modeling for Chemical Engineers, Wiley, 1995.

Off[General::"spell1"]

Analytical Solution using the built-in function of Mathematica: InverseLaplaceTransform

F[s_] := 1/(s^2 + 1)

fexact[t_] := InverseLaplaceTransform[F[s], s, t] // Expand

fexact[t]

plt1 = 
      Plot[fexact[t], {t, 0, 18}, 
        PlotStyle ->  RGBColor[1, 0, 0]]

Numerical Solution using the Fourier Series Approximation gives the same result as the exact solution

t = Table[i, {i, 0.5, 18, 2}]

fexact [t] // Chop

Er = 10^-8;

σ0 = 0.001;

T = 50;

σ = σ0 - Log[Er]/(2 T)

finv = 
      Exp[σ t]/
          T (1/2 F[σ] + (∑_(k = 1)^2000)(Re[
                      F[σ + k Pi I/T]] Cos[k Pi t/T] - 
                  Im[F[σ + k Pi I/T]] Sin[
                      k Pi t/T]))

TableForm[Transpose[{t, fexact[t], finv}]] // Chop

t = Table[i, {i, 0.5, 18, 0.1}];

finv = 
        Exp[σ t]/
            T (1/2 F[σ] + (∑_(k = 1)^2000)(Re[
                        F[σ + k Pi I/T]] Cos[k Pi t/T] - 
                    Im[F[σ + k Pi I/T]] Sin[
                        k Pi t/T]));

plt2=ListPlot[Transpose[{t, finv}], 
        PlotStyle ->  {PointSize[0.025], 
            RGBColor[0, 0, 1]}]

Show[plt1, plt2]