I'm having problem taking the numerical definite integral of a numerical Laplace transform that depends on two variables due to NIntegrate:inumr errors:
nlap1[f_, u_?NumericQ, s_?NumericQ] :=
NIntegrate[f[u, t] Exp[-s*t], {t, 0, ∞}]
coshint[s_?NumericQ] := NIntegrate[Cosh[Sqrt[s]*u]*nlap1[intertau, u, s], {u, 0, 1}]
Modifying the wonderful suggestion of flinty in Numerical Laplace Transform of InterpolatingFunction, nlap1
takes the numerical Laplace transform of an InterpolatingFunction intertau
that is a function of both u and t but ONLY transforms the variable t. coshint
attempts to take the numerical definite integral with respect to u but no matter what values are entered, I get the error NIntegrate: The integrand [e^(-random number*t) in nlap1
] has evaluated to non-numerical values for all sampling points in the region {{}}. However, nlap1
itself seems to work fine for the most part.
It's important to note that the region specified in the error is outside of the range of the InterpolatingFunction intertau
, but I didn't think this would really matter? I was wondering if anyone had any suggestions for changing coshint
so that it accomplishes its intended purpose -- again, Mathematica is quite new to me so I'd greatly appreciate any help!
intertau
shouldn't take u as a parameter right. You changed the definition of nlap1 to add f[u, t] but this is incorrect - it should be f[t] $\endgroup$nlap1
back to what you originally suggested with only f[t] and called that version incoshint
but am still getting the same error unfortunately -- is that what you meant? $\endgroup$u
then changenlap1[f_, u_?NumericQ, s_?NumericQ]
tonlap1[f_, s_?NumericQ]
, changef[u,t]
tof[t]
and changeNIntegrate[Cosh[Sqrt[s]*u]*nlap1[intertau, u, s], {u, 0, 1}]
toNIntegrate[Cosh[Sqrt[s]*u], {u, 0, 1}]*nlap1[intertau, s]
$\endgroup$intertau
is 2d and does have a dependence onu
butu
isn't transformed -- onlyt
is (so the Laplace transform only transforms one variable) $\endgroup$