Troubleshooting Mathematica Plotting Problem

kevmac
Messages
6
Reaction score
2

Homework Statement


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?

Homework Equations

The Attempt at a Solution

 
Physics news on Phys.org
kevmac said:

Homework Statement


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?

Homework Equations

The Attempt at a Solution


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
 
Thanks to both of you! This ended up working just fine and I got the same graph that you did e.bar.goum
 
  • Like
Likes   Reactions: e.bar.goum

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K