I want to evaluate the laplace transform using "Integrate" rather than "LaplaceTransform". However, for some reason the two don't give the same output.
I want to do
F[s_] := Integrate[E^(-s*t)*f[t], {t, 0, Infinity}]
Instead of
F[s_] := LaplaceTransform[f[t], t, s]
However, it gives me the following error:
Integrate::ilim: Invalid integration variable or limit(s) in {0.000102143,0,[Infinity]}. >>
What am I doing wrong?
ps. here is my complete code:
ClearAll[t, s, f, F, T]
k0 = 0.01;
g = 1;
k[t_] := 1/(1 + (1/k0 - 1)*E^(-g*t))
f[t_] := (1/3) (k[t])^(-2/3)
F[s_] := Integrate[E^(-s*t)*f[t], {t, 0, Infinity}]
Plot[{f[t], F[t]}, {t, 0.01, 5}]
The above code works now, but when I add an "NSolve" line, I get a similar problem:
F[s_, T_] := Block[{t}, NIntegrate[E^(-s*t)*f[t], {t, T, Infinity}]]
iir[t_] := NSolve[F[s, t] == 1, s]
Plot[{iir[x]}, {x, 0.01, 5}]
This gives the following error:
NIntegrate::inumr: "The integrand E^(-s\t)/(3\(1/(1+99. E^-t))^(2/3)) has evaluated to non-numerical values for all sampling points in the region with boundaries {{\[Infinity],0.0101019}}. \!\(\*ButtonBox[\">>\",
Appearance->{Automatic, None},
BaseStyle->\"Link\",
ButtonData:>\"paclet:ref/message/NIntegrate/inumr\",
ButtonNote->\"NIntegrate::inumr\"]\)"
thas a value. UseClear[t]or restart your kernel (Quit[]). – Szabolcs May 15 '17 at 10:15tis given a value byPlot. Use a different variable, or localizetwithinFthroughBlock. That said,Integrateshould not be used with inexact values (i.e. anything that has a decimal point in it). Compute the integral first, ensuring exact values only. AddAssumptionswhen necessary, e.g.s>0. Then take that result, assign it to a function, and plot it. Here you are re-computing the integral for every single argument value, and also risking problems due to inexact values. – Szabolcs May 15 '17 at 10:28