| Author |
Comment/Response |
Rayne
|
01/27/07 01:18am
Hi all,
I want to plot the cubic equation f(x) = x^3 - 16x^2 + 3x + 1 = 0. I had:
f=x^3-16 x^2+3 x+1 == 0
Plot[f,{x,-1,20}]
but I was unable to get the plot. The error message says
Plot::plnr: f is not a machine-size real number at x = -0.999999.
Plot::plnr: f is not a machine-size real number at x = -0.148093.
Plot::plnr: f is not a machine-size real number at x = 0.780985.
General::stop: Further output of Plot::plnr
will be suppressed during this calculation.
How do I get around this problem?
Also, I need to define a set of functions for vector calculus. Two of them are the gradient (equivalent to Del[f] in Mathematica) and the laplacian (equivalent to [CapitalDelta]).
I have:
gradient[f_]:={D[f,x],D[f,y],D[f,z]}
and
laplacian[f_]:=D[f,{x,2}]+D[f,{y,2}]+D[f,{z,2}]
As you can see, this only works if the function f has 3 variables. How do I make it more general, that is, for an arbitrary number of variables?
Also, how do I use the Del and CapitalDel functions in Mathematica? I tried Del[f] when f is 2x^3-3y^2+4z and only got \[Del](2 x^3 - 3 y^2 + 4 z) as output.
Thank you.
Regards,
Rayne
URL: , |
|