MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot and evaluate help

>        I am a novice mathematica user having difficulty plotting a
> simple
> function.  I am trying to plot the functions f[x_] = c1 / (c1 + c2)
> and f'[x_]
> over an arbitrary range for c1 and c2.  The Plot syntax specifies
> Plot[f, {x,
> min, max}].  I hate to ask such a basic question, but how does one
> plot a
> function of more than one variable?

    The function you need is Plot3D, the syntax is:
Plot3D[f, {x, xmin, xmax}, {y, ymin, ymax}]

In your case, then, you could write:

f = c1 / (c1 + c2)
Plot3D[f, {c1, -5, 5}, {c2, -5, 5}]

There are two different partial derivatives, given by
f1 = D[f, c2]
f2 = D[f, c2]

then you can Plot3D f1 and f2 as well.

If you want to use f, f1, and f2 in different ways, you may want to
define a function,
f[c1_, c2_] := c1 /(c1 + c2)

Then you can type f[1,1] and get the response 0.5, for example, or do
the plots like:

Plot3D[f[c1, c2], {c1, -5, 5}, {c2, -5, 5}]

notice now you need to say f[c1, c2], not just f.

Hope this helps,

Content-Description: Card for Eric Nichols
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Eric Nichols
n:              Nichols;Eric
email;internet: raoul at
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
end:            vcard


  • Prev by Date: Re: Sinusoidal Nonlinear Fit
  • Next by Date: What's up with Input?
  • Previous by thread: Re: Sinusoidal Nonlinear Fit
  • Next by thread: Re: Plot and evaluate help