0
$\begingroup$

I'm running the following code:

G = 0.01;
ωc = 15;
β = 1;
ω0 = 11;
integral1[t_, ω_?NumericQ] = 
G ω Exp[-ω/ωc] Sinc[(ω - 1) t/2]^2;

Plot[1 - 2 t^2 NIntegrate[
integral1[t, ω], {ω, 0, Infinity}, 
Method -> "LocalAdaptive", MaxRecursion -> 15], {t, 0, 100}]

But i get the errors:

enter image description here

What could be causing the errors? I have used the _?NumericQ command and I think the syntax is correct too.

$\endgroup$
  • 3
    $\begingroup$ Clear all your variables and try again. If need be, start in a fresh session. $\endgroup$ – J. M. will be back soon Jul 4 '16 at 19:00
2
$\begingroup$
ClearAll["Global`*"]
Remove["Global`*"]

G = 1/100;
ωc = 15;

f[t_ , ω_] := G ω Exp[-ω/ωc] (Sin[(ω - 1) t/2]/((ω - 1) t/2))^2

Int[t_?NumericQ] := NIntegrate[f[t , ω], {ω, 0, Infinity}]

Plot[1 - 2*t^2*Int[t], {t, 10^-15, 100}]

enter image description here

MMA has problems with function Sinc give some error messages:

f[t_ , ω_] := G ω Exp[-ω/ωc] (Sinc[(ω - 1) t/2])^2

Int2[t_?NumericQ] := NIntegrate[f[t , ω], {ω, 0, Infinity}]

Int2[1]

enter image description here that so I changed to Sinc[x] -> Sin[x]/x,but gives correct result.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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