Get an accurate answer by using the ''NIntegrate''?

Posted 6 months ago
611 Views
|
4 Replies
|
1 Total Likes
|
 The function contains an Error function.Theoretically, M should be infinity. But the function is almost 0 at t<-M and t>M. So I choose to calculate it in the interval [-M,M].I have tried M=50; M=100; and M=200, then the Mathematica gave different answers. I don't know how to get an accurate answer. Thanks very much for any comments.
4 Replies
Sort By:
Posted 6 months ago
 People here generally like users to post code as Mathematica code instead of images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you.
Posted 6 months ago
 Sorry for the inconvenience, the codes has been copied as follows, thanks for your reply. Remove["Global*"] M = 100; \[CapitalOmega] = 1; \[Xi][t_] := (\[CapitalOmega]^2/(2 Pi))^(1/4)* Exp[-\[CapitalOmega]^2/4*(t^2)]; \[Eta][t_] := \[Xi][t] - \[Kappa]*(\[CapitalOmega]^2/(2 Pi))^(1/4)*\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$-\[Infinity]$$, $$t$$]$$Exp[ \*FractionBox[\(-\[Kappa]$$, $$2$$] $$(t - r)$$]*Exp[ \*FractionBox[$$-\[CapitalOmega]^2$$, $$4$$]*$$(r^2)$$] \ \[DifferentialD]r\)\); tbar = Simplify[NIntegrate[t*(\[Eta][t]^2), {t, -M, M}]/ NIntegrate[\[Eta][t]^2, {t, -M, M}]]; tsquare = Simplify[NIntegrate[(t^2)*(\[Eta][t]^2), {t, -M, M}]/ NIntegrate[\[Eta][t]^2, {t, -M, M}]]; \[CapitalDelta]t = Sqrt[tsquare - (tbar)^2]; FindMaximum[\[CapitalDelta]t*(\[CapitalOmega]/2), {\[Kappa], 0, 0.1}]