1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Graphing with Mathematica and Parameters

  1. Apr 5, 2009 #1
    1. The problem statement, all variables and given/known data

    Problem.jpg

    Second part of Part C is: Use mathematica to draw graphs for a few values of the parameters. [ Consider the cases b > 0 and b< 0]

    2. Relevant equations
    I think you use the answer to Part A
    PartA.jpg



    3. The attempt at a solution
    Not sure how to graph with mathematica with parameters
     
  2. jcsd
  3. Apr 6, 2009 #2

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    You don't, that's why it says "for a few values of the parameters."

    So you can use your favorite method to assign the parameters,
    varying from the ugly
    Code (Text):

    a = 1;
    b = -1;
    A = 6;
    Plot[P[t], {t, .., ...}]
     
    or the better
    Code (Text):

    Block[
     {a = 1, b = -1, A = 6},
     Plot[P[t], {t, .., ...}]
    ]
     
    to my preferred
    Code (Text):

    Plot[P[t] /. {a -> 1, b -> -1, A -> 6}, {t, .., ...}]
     
    Using something like
    Code (Text):

    Plot[P[t] /. {a -> {1, 2, 3, 4}, b -> 1, A -> -2} // Evaluate, {t, 1,
      6}]
     
    you can even plot multiple ones in the same plot.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Graphing with Mathematica and Parameters
  1. For the Graph (Replies: 7)

  2. Eliminating parameter (Replies: 1)

  3. Variation of Parameters (Replies: 13)

Loading...