Message Boards Message Boards

2
|
4699 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

TriangleWave automatic simplification question

Dear All,

I have the following code:

TriangleWave[{-10, 10}, Subdivide[0, 1, 50]/2]

With the output:

{0,2/5,4/5,6/5,8/5,10 TriangleWave[1/20],12/5,14/5,16/5,18/5,4,22/5,24/5,26/5,28/5,10 TriangleWave[3/20],32/5,34/5,36/5,38/5,8,42/5,44/5,46/5,48/5,10,48/5,46/5,44/5,42/5,8,38/5,36/5,34/5,32/5,10 TriangleWave[7/20],28/5,26/5,24/5,22/5,4,18/5,16/5,14/5,12/5,10 TriangleWave[9/20],8/5,6/5,4/5,2/5,0}

As you can see, there are 4 values that are not automatically simplified. Using Simplify of FullSimplify it simplifies though. I was wondering why it is not automatically simplified? Seems quite trivial for TriangleWave.

If I do FunctionExpand on one of the expressions though:

10 TriangleWave[1/20]//FunctionExpand
(20 ArcSin[1/4 (-1+Sqrt[5])])/\[Pi]

Which turns it into an ArcSin expression (!!). Maybe this is why it is not simplified automatically... But why is it implemented like this?

POSTED BY: Sander Huisman

I think the second argument of TriangleWave is supposed to be a variable, not a list. Maybe you want

In[4]:= TriangleWave[{-10, 10}, #] & /@ Subdivide[0, 1, 50]/2

Out[4]= {0, 2/5, 4/5, 6/5, 8/5, 2, 12/5, 14/5, 16/5, 18/5, 4, 22/5, \
24/5, 24/5, 22/5, 4, 18/5, 16/5, 14/5, 12/5, 2, 8/5, 6/5, 4/5, 2/5, \
0, -(2/5), -(4/5), -(6/5), -(8/5), -2, -(12/5), -(14/5), -(16/5), -(
  18/5), -4, -(22/5), -(24/5), -(24/5), -(22/5), -4, -(18/5), -(16/
  5), -(14/5), -(12/5), -2, -(8/5), -(6/5), -(4/5), -(2/5), 0}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract