Group Abstract Group Abstract

Message Boards Message Boards

Plot and numerically integrate a function?

Posted 10 years ago

Dear Mathematica community, in a study about a Bose fluid, the vacuum density of energy (using coordinates to reduce the problem in 1D) is:

emod[k_, \[Mu]_, g0_, g1_, \[Lambda]_] := 
 k^2 (k^2/2 (k^2/2 + 
      2 \[Mu] (g0 + (4 \[Pi] g1)/(k^2 + \[Lambda]^2))/(
       g0 + (4 \[Pi] g1)/\[Lambda]^2)))^(1/2)

and after a renormalization procedure, in order to absorb the UV divergence (k->infinity), the density becomes:

emodrin1[k_, \[Mu]_, g0_, g1_, \[Lambda]_] := 
 k^2 (k^2/2 (k^2/2 + 
       2 \[Mu] (g0 + (4 \[Pi] g1)/(k^2 + \[Lambda]^2))/(
        g0 + (4 \[Pi] g1)/\[Lambda]^2)))^(1/2) - 
  1/2 k^4 - (
   g0 \[Mu])/(g0 + (4 g1 \[Pi])/\[Lambda]^2)  k^2 - ((
    4 g1 \[Pi] \[Mu])/(g0 + (4 g1 \[Pi])/\[Lambda]^2) - (
    g0^2 \[Mu]^2)/(g0 + (4 g1 \[Pi])/\[Lambda]^2)^2)

My aim is to numerically integrate:

NIntegrate[emodrin1[k, 1, 3, -1, 1], {k, 0, \[Infinity]}]

the parameter are chosen in order to don't have problem with the square root ( any other good choice could be fine), but my version (Mathematica 10.0 Student Editon) is not able to solve the calculation, I also tried changing the integration method, the WorkingPrecision and the Maxrecursion but without any results. So is there a smarter way to solve the integral? In addition I tried to plot:

Plot[emodrin1[k, 1, 3, -1, 1], {k, 0, 1000}, 
PlotRange -> {-0.0003, 0.0003}]

And the result is strange because for high k there are a lot of oscillations that present a fractal behavior, if I zoom in a region of high k the oscillations have the same aspect. In addition the amplitude of oscillations is increasing with k. Because of the renormalization procedure ( I am quite confident it is right) I expect that the function is going to 0 for k to infinity enough fast to be integrated. May you help me with this problems? are they correlated? Thanks you for the attention and the answers.

POSTED BY: Alessio Lapolla
4 Replies
Posted 10 years ago

Thanks you very much, of course it is working. But how do you choose the parameter of numerical calculus? Why for example you put WorkingPrecision 32 for the integral and 64 for the plot? Do you just go on for trials and errors or do you choose the parameters following some rules?

POSTED BY: Alessio Lapolla
Posted 10 years ago

Some experience from past trial and error, some studying the information hidden behind "Details and Options" on each documentation page and sometimes more trial and error.

You can use trial and error to modify what I did and try to learn what is essential and what will break it.

POSTED BY: Bill Simpson
Posted 10 years ago

Thanks you very much, you have been very useful to me.

POSTED BY: Alessio Lapolla
Posted 10 years ago

Perhaps this

In[1]:= emodrin1[k_, ?_, g0_, g1_, ?_] := k^2 (k^2/2 (k^2/2 + 2 ? (g0 + (4 ? g1)/(k^2 + ?^2))/(g0 +
  (4 ? g1)/?^2)))^(1/2) - 1/2 k^4 - (g0 ?)/(g0 + (4 g1 ?)/?^2) k^2 - ((4 g1 ? ?)/(g0 + (4 g1 ?)/?^2) -
  (g0^2 ?^2)/(g0 + (4 g1 ?)/?^2)^2);

In[2]:= NIntegrate[emodrin1[k, 1, 3, -1, 1], {k, 0, Infinity},
  AccuracyGoal->6, WorkingPrecision->32, MaxRecursion->20]

Out[2]= -1.6472094715634783351760906128371

In[3]:= Plot[emodrin1[k, 1, 3, -1, 1], {k, 0, 1000}, PlotRange->{-0.0003, 0.0003}, WorkingPrecision->64]

enter image description here

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