Is anyone familiar with mathematica?

pray4mojo

Diamond Member
Mar 8, 2003
3,647
0
0
How do I plot the 3d function f(x,y) = -x^2/2 - y^2 + 25/8 ? I keep getting syntax errors and I don't know why.
 

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
oops i'm stupid...i thought it said 'mathematics' instead of 'mathematica' :eek:

i can do this in maple, but not mathematica, sorry dude
 

Brian M

Senior member
Oct 9, 1999
791
0
0
Code like this should work if I recall correctly:
f[x_,y_] = -x^2/2 - y^2 + 25/8
Plot[f[x,y], {x,-10,10},{y,-10,10}, PlotRange->{-5,5}, AxesLabel->{"x","y"}]
 

pray4mojo

Diamond Member
Mar 8, 2003
3,647
0
0
Originally posted by: Brian M
Code like this should work if I recall correctly:
f[x_,y_] = -x^2/2 - y^2 + 25/8
Plot[f[x,y], {x,-10,10},{y,-10,10}, PlotRange->{-5,5}, AxesLabel->{"x","y"}]

It gives this error.
Plot::nonopt: Options expected (instead of {y, -10, 10}) beyond position 2 in
Plot[f[x, y], {x, -10, 10}, {y, -10, 10}, PlotRange -> {-5, 5}, AxesLabel ->
{x, y}]. An option must be a rule or a list of rules.
 

Brian M

Senior member
Oct 9, 1999
791
0
0
Maybe you have to list the function for each variable range? Like:

f[x_,y_] = -x^2/2 - y^2 + 25/8
Plot[{f[x,y],{x,-10,10},{f[x,y]},{y-10,10}, PlotRange->{-5,5}, AxesLabel->{"x","y"}]
 

pray4mojo

Diamond Member
Mar 8, 2003
3,647
0
0
Actually I got it.

F[x_, y_] := -x^2/2 - y^2 + 25/8;
Plot3D[ F[x, y], {x, 0, 3}, {y, 0, 3},
AxesLabel -> {"x", "y", "z"}]

thanks for your help