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

Plotting arbitrary constants in mathematica

  1. Jul 31, 2011 #1
    How do you plot arbitrary constants in mathematica? for example r(psi)=a(1-eCos(psi)), where a and e are some constant.

    Thanks in advance for the help.
     
  2. jcsd
  3. Jul 31, 2011 #2

    Dale

    Staff: Mentor

    Well, you cannot plot a function with arbitrary constants. Where would the computer draw the line? However, what you can do is do a Plot inside a Manipulate, like this:

    Manipulate[Plot[a (1 - e Cos[psi]), {psi, -1, 1}], {{a, 1}, -2, 2}, {{e, 1}, -2, 2}]
     
  4. Jul 31, 2011 #3
    OK thanks.
     
  5. Jul 31, 2011 #4
    Some constants can be absorbed into variables by defining dimensionless variables.
    This basically treats the constant as the "natural scale" for that dimension.

    In your example, you can define the dimensionless, s = r/a
    But e is dimensionless and can't really be absorbed anywhere.

    So

    Manipulate[ Plot[ 1 - e Cos[psi], {psi, -1, 1}, AxesLabel->{"psi","s=r/a"}], {{e,1}, -2, 2}]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Plotting arbitrary constants in mathematica
  1. Mathematica Plot (Replies: 1)

  2. Mathematica plotting (Replies: 4)

  3. Mathematica plot (Replies: 1)

  4. Plot in mathematica (Replies: 2)

Loading...