Message Boards Message Boards

0
|
2213 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Integrate and plot a complex function: no plot produced

Posted 2 years ago

Dear Community, I am trying to integrate and plot the function C7 defined in the files below and plot its imaginary- and real part. But I do not know why my program is crashing and not showing any result (no plots are reproduced) I really would appreciate your help. Thanks NOTE:[what is commented out in the Notebook is not important to solve the problem.]

Attachment

Attachment

Attachments:
POSTED BY: Salman kasem
4 Replies
Posted 2 years ago

If you are attempting to plot a function that returns complex values then that may explain why you are not seeing a plot. Plot only accepts real values.

You can try

Plot[{Re[expression], Im[expression]},{var,low,high}]

and that will show two curves, one of the real value and the other of the imaginary value. There is also ReImPlot[] which will do the same thing if you have a new enough version of Mathematica.

But none of this is dealing with your seeing Mathematica crash. I don't know how to diagnose that.

POSTED BY: Bill Nelson
Posted 2 years ago

Well, if you see my previous code you will find out that I was plotting only the imaginary or real part of my function. But I have the problem solved now, when I changed the analytic integration by numerical integration:

NIntegrate[expression, {var, low, high}]
POSTED BY: Salman kasem
Posted 2 years ago

If your integration seems to be successfully completing and the problem seems to be that no plot appears then it is sometimes helpful to replace the

Plot[expression,{var,low,high}]

with

Table[expression,{var,low,high,(high-low)/10}]

and look at that result. If the result of that is anything other than a vector of real numbers then that perhaps explains why Plot does is not displaying a curve. Sometimes it takes more than ten points to show the problem. If you can't figure out how to fix it with that information then showing us what the table returned might let someone suggest what to try next.

POSTED BY: Bill Nelson
Posted 2 years ago

Thanks for your answer, but if I do so I will get a complex vector since my integrants are complex and for 10 values no discontinuities are shown, the same is with 100 values too. Here is the result for a fixed z mass mz.

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

Group Abstract Group Abstract