Re: How to evaulate a function and graph it
- To: mathgroup at smc.vnet.net
- Subject: [mg43235] Re: How to evaulate a function and graph it
- From: "Peter Pein" <peter1963 at totalise.co.uk>
- Date: Wed, 20 Aug 2003 22:25:56 -0400 (EDT)
- References: <bht3hi$n22$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Rebeca Choy" <rchoy at ula.ve> schrieb im Newsbeitrag news:bht3hi$n22$1 at smc.vnet.net... > Hi everyone, > > How can I evaluate a function of 2 variables, say: > > f(x,y) = x^4 + 3 x^2 + 5 y^2 + x + y > > in an interval of [-3.0,4.0] and[-3.0,4.3] for x and y? > > I need all the points between these two ranges to plot it > > > Thanks > > Rebeca > Hi Rebecca, All points? That would last far too long (approx. 1.3 to 2.02 eternities ;-) ). I suggest a finite grid. f[x_,y_]:=x^4 + 3 x^2 + 5 y^2 + x + y Table[{x,y,f[x,y]},{y,-3,4.3,0.1},{x,-3,4,0.1}] will give you 74*71=5254 Points. You can alter the stepsize, to get more or less points. If you don't have to plot it by hand, I suggest Plot3D[x^4 + 3 x^2 + 5 y^2 + x + y,{x,-3,4},{y,-3,4.3}] (* see online help for options *) Peter