Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica question - Beginner.

  1. May 27, 2005 #1
    Hi,
    when I run those commands in mathematica:
    y[x_,A_]:=Sin[x]+A+5
    Plot[{y[x,5],y[x,6]},{x,0,5}]
    z[x_]:=D[y,x]

    Everything seems to go well.
    But when I trie to plot the derivative:

    Plot[{y[x,5],z[x]},{x,0,5}]

    I allways have these errors:
    Plot::plnrz[x] is not a machine-size real number at x= 2.0833333333333333`*^-7
    ....

    What am I doing wrong ?
    I allready tried to change the arguments of z[] to z[x,4], z[x,A] etc...
    There's nothing about plotting derivatives on the quick tutorial.
    Any help is really appreciated.
    I uploaded my mathematica file here http://s47.yousendit.com/d.aspx?id=0LG6F35A7OTY2SVEC7L1T6GXA

    Thanks in advance
     
  2. jcsd
  3. May 27, 2005 #2
    You take the derivative of y but y has no meaning as y is just an empty variable, y[x,a] does have meaning however, also why is z[x_] a function? if you do D[y[x,a],x] you are taking the derivative of y[x,a] with respect to x, correct, I believe its the 3'rd parameter to have it take the n'th derivative? I will be at work in an hour or so and can check it out, as I'm pretty new to Mathematica myself and dont have a copy here to check myself.
     
  4. May 27, 2005 #3
    I'm afraid it's not correct. I've just tried what you said and it didn't worked either :confused:
     
  5. May 27, 2005 #4
    z[n_] = D[y[x, 10], {x, n}]; is saying you want a function of the nth derivative of y[x,10] with respect to x. Plot[{z[2]}, {x, 0, 5}] is a plot of the 2nd derivative of x from 0 to 5.
     
  6. May 27, 2005 #5
    Thanks a lot.

    Now it works indeed!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Mathematica question - Beginner.
  1. Mathematica Question (Replies: 1)

  2. Mathematica questions (Replies: 10)

  3. Mathematica question (Replies: 10)

  4. Mathematica question (Replies: 1)

  5. Mathematica question (Replies: 4)

Loading...