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

Mathematica not plotting

  1. Feb 10, 2016 #1
    1. The problem statement, all variables and given/known data
    I've entered the following piecewise equation into Mathematica:

    Plot[Piecewise[{{sin (t), 0 <= t < \[Pi]}, {5 + 5 cos (t) + sin (t), \[Pi] <= t < 4*\[Pi]}, {10 cos (t) + sin (t), 4*\[Pi] <= t}}], {t, 0, 20*\[Pi]}]

    But I am getting a blank graph in return. I've proofread my input many times and can't find anything wrong with it. Can anyone help me get a graph generated?

    2. Relevant equations


    3. The attempt at a solution
     
  2. jcsd
  3. Feb 10, 2016 #2

    jedishrfu

    Staff: Mentor

  4. Feb 10, 2016 #3

    e.bar.goum

    User Avatar
    Science Advisor
    Education Advisor

    jedishrfu is correct. You should also use square brackets, not round brackets in functions. Sin[t] is the correct syntax. If you make those two modifications, it will work, as shown below. Screenshot from 2016-02-11 13:35:01.png
     
  5. Feb 10, 2016 #4
    Thanks to both of you! This ended up working just fine and I got the same graph that you did e.bar.goum
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica not plotting
  1. Mathematica plotting (Replies: 4)

  2. Mathematica plot (Replies: 1)

  3. Plot in mathematica (Replies: 2)

Loading...