0
$\begingroup$

I am trying to do the numerical laplace inverse of a very complicated transfer function, subject to a trapezoidal pulse input. For the sake of understanding, I will use a simple transfer function to pose my question. I want to find out the output value during pulse on times, but numerical laplace inverse gives highly erroneous results for such time scales. Here is the pulse input that I am givingenter image description here

The mathematica code is the following:

Gtransfer[s_] = 1/(1 + s);
T1 = 10^-9;
T2 = 10*10^-9;
T3 = 10^-9;
Eo = 1;

Eint[t_] = Eo*10^9*t;
Enet[t_] = 
  Eint[t] - Eint[t - T1]*UnitStep[t - T1] - 
   Eint[t - T1 - T2]*UnitStep[t - T1 - T2] + 
   Eint[t - T1 - T2 - T3]*UnitStep[t - T1 - T2 - T3];
Eins[s_] = LaplaceTransform[Enet[t], t, s];
fun1[s_] = Eins[s] Gtransfer[s];

thisDir = 
  ToFileName[("FileName" /. 
      NotebookInformation[EvaluationNotebook[]])[[1]]];
SetDirectory[thisDir];
<< FixedTalbotNumericalLaplaceInversion.m
t0 = 25 10^-9;
Vnumerical = FT[fun1, t0](*Numerical*)
Vanalytical = 
 N[InverseLaplaceTransform[fun1[s], s, t] /. t -> 25 10^-9](*Analytical*)

You will find that for values of t0<12*10^(-9), numerical inverse laplace is extremely erroneous. Could anyone suggest me as to why this is so and how to fix this? My original transfer function is just too complicated to invert analytically. Thanks in advance!

$\endgroup$
3
  • 2
    $\begingroup$ We do not have the file FixedTalbotNumericalLaplaceInversion.m or the definition of FT. But my guess is that this tool will use numerical integration in one or the other way. A step function of width 10^-9 is just hard to integrate. Its support is probably so narrow that it lies between two quadrature points so that it cannot be detected appropriately by the method. $\endgroup$ Sep 26, 2019 at 11:48
  • $\begingroup$ I go the file from the wolfram library itself. library.wolfram.com/infocenter/MathSource/5026 This is the relevant URL. Could you also suggest me any way in which I can achieve what I want? Do remember that my transfer function is extremely complicated and mathematica is not being able to handle it by its usual InverseLaplaceTransform function $\endgroup$ Sep 26, 2019 at 17:52
  • $\begingroup$ You can use: InverseLaplaceTransform[fun1[s], s, 25.0 10^-9, Method -> "Talbot", WorkingPrecision -> 20] in Mathematica 12.2.0.Works perfectly. $\endgroup$ Jan 29, 2021 at 15:00

1 Answer 1

1
$\begingroup$

In version 12.0 works fine

G[s_] := 1/(1 + s);
u[t_] := (HeavisideTheta[t] - HeavisideTheta[t - delta]) a t +
         (HeavisideTheta[t - delta] - HeavisideTheta[t - delta - base]) +
         (HeavisideTheta[t - delta - base] - HeavisideTheta[t - 2 delta - base]) (-a (t - 2 delta - base)) 

ys = LaplaceTransform[u[t], t, s];
yt = InverseLaplaceTransform[ys G[s], s, t];

delta = 10^-9;
base = 10 10^-9;
a = 10^9;

Plot[u[t], {t, -delta, 3 delta + base}, PlotRange -> All]
Plot[yt, {t, 0, 2 base},  PlotRange -> All, WorkingPrecision -> 20]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.