How do I plot this periodic step function with GNUplot?

Click For Summary

Discussion Overview

The discussion revolves around plotting a periodic step function using GNUplot, specifically focusing on a summation representation involving the step function and its graphical implications. Participants explore various methods and challenges associated with visualizing this function, including the use of programming languages and mathematical operations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a summation formula involving the step function, suggesting it produces a graph of repeating 45-degree lines.
  • Another participant introduces the modulo operation, questioning its relevance to the problem.
  • A different participant expresses skepticism about plotting the function in GNUplot, suggesting that it is better suited for a programming language like C, where iteration can be used to generate data for plotting.
  • One participant argues that using the modulo operation in GNUplot could simplify the plotting process, proposing that the function can be represented as f(t)=t%2.
  • Another participant raises concerns about the periodic nature of the summation, noting the need for two independent variables and the limitations of 2D graphing tools in handling this complexity.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of plotting the function in GNUplot, with some believing it can be done using the modulo operation, while others contend that the summation complicates the process and requires additional variables. The discussion remains unresolved regarding the best approach to take.

Contextual Notes

Participants highlight the potential limitations of GNUplot in handling the summation and periodic nature of the function, as well as the need for dynamic variable representation. There is also mention of alternative software options like Maple and Sage for plotting.

randombill
Messages
81
Reaction score
0
[tex]\sum_{k=0}^{∞} (t-2k) [u(t-2k)-u(t-2(k+1))] = f(t)[/tex]

where [tex]u[/tex] is the step function and the graph of this is supposed to be 45 degree lines repeating to infinity. Sort of like

/ / / / / / / / / ad infinitum. I took this equation out of this lecture note on page 10. Fig 5.4 is supposedly the graph of it and example 5.27 is where they ask to solve it.
 
Last edited:
Physics news on Phys.org
What do you know about the modulo operation?
 
A lot actually. Thats the % operator in C/C++ right? Actually I figured out that plotting this function is next to impossible in GNUplot based on my searches online and this was actually plotted with Maple. There is a free Maple (clone) called Sage and runs in Oracle VirtualBox but I haven't tried it. What I did figure out is that it would be easier to use iteration (for loop, while, etc) in a modern programming language such as C and substitute that for the summation part of the problem. From there the problem falls together by simply plotting the numerical result from a dat file in GNUplot. I think that solves it.
 
I don't think it is difficult to plot this function in gnuplot once you use the modulo operation (which is also in gnuplot represented by the % sign) as it is nothing else than f(t)=t%2
 
Okay but what about the periodic part using the summation. That usually requires two independent variables but most 2d graphers can only do one. For the summation you would need k and t to be both variables dynamically changing. I can easily graph one line using 2t but I would still need to repeat it iteratively using summation over k. And shouldn't it be f(t)=k%2?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
35K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K