Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
8 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Trying to plot a function in Mathematica

Posted 12 years ago
POSTED BY: Yaj Bhattacharya
8 Replies
POSTED BY: Marco Thiel

Hi Yaj,

no the Manipulate is not necessarily to check where the function is defined. I used Manipulate only so that the Plot function would have values for all parameters. The main problem in your command was that if you do not specify k and m Mathematica cannot plot anything. (Well, technically it can, but its not what you wanted.) Manipulate masks that by providing values for k and m that you can later change.

Regarding the domain of the function: If you use the Wolfram Cloud (highly recommended), or Mathematica on the Raspberry Pi or Mathematica 10, and type in

FunctionDomain[p^2/((p^2 - k^2) (p^2 + m^2)),p]

you get

enter image description here

which is the Domain. You can also get essentially the same result if you consult WolframAlpha in Mathematica

== Domain p^2/((p^2 - k^2) (p^2 + m^2))

or via the internet

http://www.wolframalpha.com/input/?i=domain+p%5E2%2F%28%28p%5E2+-+k%5E2%29+%28p%5E2+%2B+m%5E2%29%29

you should get

enter image description here

which is the same result. You also might find this thread useful.

Hope this helps,

Marco

POSTED BY: Marco Thiel

Thank you Marco!

[Thanks everyone who replied]

This is exactly what I needed: Question: Is the command "Manipulate" enough/essential to check where the graph exists i.e. what the constraints on the three variables are?

POSTED BY: Yaj Bhattacharya

I am not quite sure what you want to achieve, but this might help:

Manipulate[If[k == 0, "Not Defined", Plot[p^2/((p^2 - k^2) (p^2 + m^2)), {p, 0, k}]], {m, -10, 10}, {k, -10, 10}]

enter image description here

To plot the function it "pre-sets" m and k for you, but you can change them with the sliders. I also added a "not defined" output when k==0.

M.

POSTED BY: Marco Thiel
Posted 12 years ago

I think the function you want to plot consist in three variables, so plot is as follows

Plot[f[x,y,z],{x,xmin,xmax},{y,ymin,ymax},{z,zmin,zmax}]

in your case the vairables are m,k,p

but maybe one of them is constant or two of them. you know If is three dimensional is Plot3D[.....]

POSTED BY: Charls Mejía

Plot can not be called with multiple variables. Only one.

POSTED BY: Sander Huisman

And the value of m!

POSTED BY: Sander Huisman

You didn't tell it the value of k.

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