Group Abstract Group Abstract

Message Boards Message Boards

Plot and numerically integrate a function?

Posted 10 years ago
POSTED BY: Alessio Lapolla
4 Replies
Posted 10 years ago

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

POSTED BY: Alessio Lapolla
Posted 10 years ago
POSTED BY: Bill Simpson
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

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