Group Abstract Group Abstract

Message Boards Message Boards

1
|
11.1K Views
|
20 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Determine inverse Laplace transforms of these expressions?

Posted 5 years ago

Hi, I have a new problem with determining inverse Laplace transforms. The following code generates a series expansion of a certain expression, and then attempts to calculate inverse Laplace transforms of the successive series coeffcients. The coefficients are functions of the Laplace variable s that appear rather hard (for me) to be expressed by any recursive formula, so that I do not see a way to represent them in an alternative way. The problem is that the InverseLaplaceTransform[] command manages to invert only the first three coefficients, and I need at least 40. I believe all these inverses should contain the DawsonF[] function. Application of Apart[] makes things even worse, and diminishes the number of inverted coefficients. Is there any other method that could be applied to rearrange the expressions in some systematic way so that the inverses can be obtained? Leslaw. The code:

    nmax=5;
    F[s_]:=(((1+s)^2+3*s^(3/2)*(1+s)^(1/2)*th-4*s*(1+s)*th+3*s^(1/2)*(1+s)^(3/2)*th+s^2*th^2))/
            (8 (s^(3/2)*(1+s)^(1/2)*((1+s)^(1/2)+s^(1/2)*th)^3));
    ser0=Simplify[Series[F[s],{th,0,nmax}]];
    coeffs0=Table[SeriesCoefficient[ser0,n],{n,0,nmax}];
    coeffs1=InverseLaplaceTransform[coeffs0,s,t]
POSTED BY: Leslaw Bieniasz
20 Replies

Many thanks, this is an extremely helpful result. Leslaw

POSTED BY: Leslaw Bieniasz

Hi, a year ago, within this thread, Mariusz Iwaniuk posted a code combining Laplace and Mellin transforms, that effectively obtained the inverse Laplace transform of a certain complicated function that I considered. I am hopelessly trying to apply the same code to one more similar function, namely:

F[s_]:=((Sqrt[s] - Sqrt[s+1])^2)/((th*Sqrt[s] + Sqrt[s+1])^3)/s

where th>0 is a parameter and s is a Laplace variable. The program produces some output, seemingly without error messages, but the result appears incorrect, so that I must be doing something wrong. Unfortunately, I am unable to make meaningful interactive tests, as I have only access to Mathematica 12 in batch mode. Mariusz: if you still read these messages, may I ask you to try to apply your program to the above function? I would be happy to learn what I do wrong. Leslaw

POSTED BY: Leslaw Bieniasz

See attached file.

Regards.

Attachments:
POSTED BY: Mariusz Iwaniuk

I have tried to run the code posted by Mariusz (once again many thanks, the results generated by the code are extremely useful for me), but it does not want to run under MATHEMATICA 11. There are lots of error/warning messages, and at some point the program appears to stop doing anything. Therefore I am unable to try out the same approach for calculating the inverse transform of the another function that I need:

F[s_]=(1+s+s*th)/(2*s*((Sqrt[1+s]+Sqrt[s]*th)^2))

where again th > 0. May I ask Mariusz or someone else to make a run and generate analogous results for this function? Leslaw

POSTED BY: Leslaw Bieniasz

I tried many methods(tricks) and failed to solve your problem.If I can solve the problem, I will let you know.

POSTED BY: Mariusz Iwaniuk

I have found only:

HoldForm[InverseLaplaceTransform[(1 + s + s th)/(
   2 s (Sqrt[1 + s] + Sqrt[s] th)^2), s, t] == 
  Integrate[(
   E^-x (-2 th Sqrt[x] + 
      E^(th^2 x)
        Sqrt[\[Pi]] (1 + 2 th^2 x) Erfc[
        th Sqrt[x]]) ((1 + th) Hypergeometric0F1[1, -t x] + 
      t Hypergeometric0F1[2, -t x]))/(
   2 Sqrt[\[Pi]]), {x, 0, Infinity}] == 
  Sum[1/2 (-1)^n (1 + n) th^
    n ((1 + th) Hypergeometric1F1[1 + n/2, 1, -t] + 
      t Hypergeometric1F1[1 + n/2, 2, -t]), {n, 0, Infinity}]]

for: Integral: -1 < th < Infinity

for: Sum: -1< th <1

Probably no-closed form solution.

POSTED BY: Mariusz Iwaniuk

" But I am afraid it is out of my reach to understand what you have done"

An simple example:

 InverseLaplaceTransform[1/(s^2 + s), s, t]
 (*1 - E^-t*)
 InverseMellinTransform[
 InverseLaplaceTransform[MellinTransform[1/(s^2 + A*s), A, q], s, t],q, A] /. A -> 1
 (*1 - E^-t*)

Different methods the same result.

" Is this a 100% exact result, or a very accurate approximation "

Yes it's a 100% exect result, no approximation.

"why the InverseLaplaceTransform[] command is not able to derive such a result directly from F[s]"

Mathematica is not a magic box that'll spit out a solution to any problem.Mathematica need a litle a Human assistance to solve any problem.It does not yet have artificial intelligence.

POSTED BY: Mariusz Iwaniuk

Mariusz: I am trying to understand your analytical inversion code, but I found a certain problem. In the application of the Mellin transform you make an assumption that 0 < Re[q] < 1. Later on, in the integral formula for the hypergeometric function you assume that Re[b] > Re[a]. However, some of the hypergeometric terms have a = 2-q/2 and b=3/2, so that for q sufficiently close to zero the condition Re[b] > Re[a] would not be satisfied. Is this indeed a problem? Leslaw

POSTED BY: Leslaw Bieniasz

Well, thank you very much, your result is absolutely amazing and turns upside down all my recent work! But I am afraid it is out of my reach to understand what you have done. Is this a 100% exact result, or a very accurate approximation (I see that some sort of expansions is involved)? Another question is why the InverseLaplaceTransform[] command is not able to derive such a result directly from F[s]? I am also not sure about the range of applicability. For example, I notice that there are expressions involving Sqrt[1-th^2]. What happens if th > 1? Is there also no restriction on t? Your result also makes me wonder about the possibilities of obtaining the analytical inverse of a simpler function that I considered several months ago:

F[s_]=(1+s+s*th)/(2*s*((Sqrt[1+s]+Sqrt[s]*th)^2))

Would that be possible to use the same approach in this case? Leslaw

POSTED BY: Leslaw Bieniasz
POSTED BY: Leslaw Bieniasz

Hi

A found a Analytical solution for your function.See attached file.

Regards M.I

Attachments:
POSTED BY: Mariusz Iwaniuk

Hi Leslaw,

-Do I understand correctly that it does a sort of a parsing of the input expression into addends and addends into products of constant coefficients and s-dependent functions, and then applies InverseLaplaceTransform to the s-dependent functions, with the exception of the particular function from the table of Laplace transforms, for which the inverse is directly provided?

Yes, that is exactly what ILT function is doing.

Basically it is just the InverseLaplaceTransform function augmented with the particular table look-up function that I have mentioned in my previous reply.

Hrach

Hi,

Indeed, in Mathematica version 12.2.0 I managed to get the Inverse Laplace transform for the k-th coefficient using Apart[], as suggested by larawag. I chose k to be from 1 to 40, albeit slow it eventually gives the correct result.

However this trick is not enough for solving the problem if you use older versions of Mathematica. I suggest following workaround. I found this useful InverseLaplaceTransform from the book "Tables of Integral Transforms: Based, in Part, on Notes Left by Harry Bateman": Marked in black

Using it I wrote a small code:

In[1]:= $Version

Out[1]= "11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)"

In[2]:= ILT[f_, s_, t_] /; Head[f] === Plus := ILT[#, s, t] & /@ f;
ILT[a_ f_, s_, t_] /; FreeQ[a, s] := a*ILT[f, s, t];
ILT[s_^mu_ *(s_ + b_)^nu_, s_, t_] := Simplify[
   ConditionalExpression[
    1/Gamma[-nu - mu] t^(-nu - mu - 1)
      Hypergeometric1F1[-nu, -nu - mu, -b t], nu + mu < 0]];
ILT[f_, s_, t_] := InverseLaplaceTransform[f, s, t];

In[6]:= nmax = 7;

In[7]:= F[
   s_] := (((1 + s)^2 + 3*s^(3/2)*(1 + s)^(1/2)*th - 4*s*(1 + s)*th + 
      3*s^(1/2)*(1 + s)^(3/2)*th + 
      s^2*th^2))/(8 (s^(3/2)*(1 + s)^(1/2)*((1 + s)^(1/2) + 
          s^(1/2)*th)^3));

In[8]:= ser0 = Simplify[Series[F[s], {th, 0, nmax}]];

In[9]:= coeffs0 = Table[SeriesCoefficient[ser0, n], {n, 0, nmax}];

In[10]:= coeffs1 = ILT[Apart[#], s, t] & /@ coeffs0;

In[11]:= Simplify[coeffs1]

Out[11]= {Sqrt[t]/(4 Sqrt[\[Pi]]), (
 E^-t (3 Sqrt[t] - 2 Sqrt[\[Pi]] Erfi[Sqrt[t]]))/(4 Sqrt[\[Pi]]), (
 E^-t (-8 (-3 + E^t) Sqrt[t] + 
    Sqrt[\[Pi]] (-7 + 8 t) Erfi[Sqrt[t]]))/(8 Sqrt[\[Pi]]), (
 E^-t ((23 - 12 E^t - 10 t) Sqrt[t] + 
    6 Sqrt[\[Pi]] (-1 + 2 t) Erfi[Sqrt[t]]))/(4 Sqrt[\[Pi]]), (
 E^-t (2 Sqrt[t] (80 (3 - 2 t) + 9 E^t (-15 + 4 t)) - 
    9 Sqrt[\[Pi]] (11 - 34 t + 8 t^2) Erfi[Sqrt[t]]))/(
 48 Sqrt[\[Pi]]), (
 E^-t (2 Sqrt[t] (354 - 376 t + 56 t^2 + 45 E^t (-5 + 2 t)) - 
    45 Sqrt[\[Pi]] (3 - 12 t + 4 t^2) Erfi[Sqrt[t]]))/(
 48 Sqrt[\[Pi]]), (1/(320 Sqrt[\[Pi]]))
 E^-t (-2 Sqrt[
     t] (-224 (15 - 20 t + 4 t^2) + 5 E^t (439 - 294 t + 32 t^2)) + 
    5 Sqrt[\[Pi]] (-225 + 1140 t - 620 t^2 + 64 t^3) Erfi[Sqrt[
      t]]), (1/(120 Sqrt[\[Pi]]))
 E^-t (-2 Sqrt[
     t] (35 E^t (33 - 28 t + 4 t^2) + 
       3 (-555 + 950 t - 316 t^2 + 24 t^3)) + 
    35 Sqrt[\[Pi]] (-15 + 90 t - 60 t^2 + 8 t^3) Erfi[Sqrt[t]])}

The first two lines in In[2] are just to ensure linearity for the function ILT, which will be used to find the Inverse Laplace transform.

I also put nmax=40 and on my machine it took only couple of seconds to get the final result.

Hope this was useful, Hrach

I tried your code formulation, but it produces only the inverses of the first two expansion terms, so it is worse than my original code. I am not sure which version of MATHEMATICA I have access to; it is probably 10.2.0. Is there any other approach? Leslaw

POSTED BY: Leslaw Bieniasz
Posted 5 years ago

If you do the transformation for each coefficient separately, Mathematica seems to work with Apart[].

Take

f[s_] :=(((1 + s)^2 + 3*s^(3/2)*(1 + s)^(1/2)*th - 4*s*(1 + s)*th + 3*s^(1/2)*(1 + s)^(3/2)*th + s^2*th^2))/(8 (s^(3/2)*(1 + s)^(1/2)*((1 + s)^(1/2) + s^(1/2)*th)^3));
fCoeff = Table[Expand[SeriesCoefficient[f[s], {th, 0, k}]], {k, 0, 40, 1}];

which is a list of 41 coefficients with respect to "th". Then

InverseLaplaceTransform[Apart[fCoeff[[k]]], s, t]

gives the k-th coefficient.

Honestly, the computation time for some coefficients is quite long. So if you are brave, you can do something like

Table[InverseLaplaceTransform[Apart[fCoeff[[k]]], s, t], {k, 1, 10}]

which still works pretty well on my computer. This list contains the coefficients with respect to your variable th.

POSTED BY: lara wag
POSTED BY: Leslaw Bieniasz
InverseLaplaceTransform[Expand[Apart[Asymptotic[f, {th, 0, 10}], s]], s, t](*10 terms*)

The computation time is quite long.

POSTED BY: Mariusz Iwaniuk

Thank you for a response, but I am afraid this is not a response to my question. I do not have a series expansion around s=Infinity, but an expansion around th=0 where th is a parameter in F[s]. Numerical inversion is also not an option for me in this case, as I need analytical expressions for the inverses of the successive series expansion terms. Leslaw.

POSTED BY: Leslaw Bieniasz

function ff is analytical expressions for the inverses of the successive series expansion terms ?

POSTED BY: Mariusz Iwaniuk
f = (((1 + s)^2 + 3*s^(3/2)*(1 + s)^(1/2)*th - 4*s*(1 + s)*th + 
      3*s^(1/2)*(1 + s)^(3/2)*th + 
      s^2*th^2))/(8 (s^(3/2)*(1 + s)^(1/2)*((1 + s)^(1/2) + 
          s^(1/2)*th)^3));
ff = InverseLaplaceTransform[Series[f, {s, Infinity, 20}] // Normal, 
   s, t];(*With 20 terms*)
N[ff /. t -> 1 /. th -> 1, 20](*for th=1, t=1*)
(*0.065780620406027739102*)

We can now compute InverseLaplaceTransfrom numerically in Mathematica 12.2.0:

InverseLaplaceTransform[f /. th -> 1, s, 1.0, WorkingPrecision -> 20](*for th=1, t=1*)
(*0.065780620406027739079*)

We can see 18 correct digits with 20 terms.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard