This week I updated my PR#11277 to find the period of a general function.
In the past few weeks, I dedicated a lot of my time reading about the property of periodicity of a function.
Earlier, I had implemented a trivial(and restricted) functionality for this task.
This motivated me to study this topic as I planned to generalise the function.
Here are my notes on periodicity which were the literature reference for the development of the method:
2πis a period of
sin(x)has many other periods, such as
6π, and so on.
sin(x)has no (positive) period shorter than
pis a period of
His any function, then
pis a period of
For sums and products, the general situation is complicated.
pbe a period of
qbe a period of
g(x). Suppose that there are positive integers
ris a period of
f(x)+g(x), and also of
However, the point to note here is that
rneed not be the shortest period of
For example: The shortest period of
2π, while the shortest period of
Another example: Let
g(x)=−sin(x). Each function has smallest period
2π. But their sum is the
0-function, which has every positive number
pas a period!
qare periods of
g(x)respectively, then any common multiple of
qis a period of
H(f(x),g(x))for any function
H(u,v), in particular when
His addition, multiplication or division. However, it need not be the smallest period.
The sum of two periodic functions need not be periodic.
For example: Let
f(x)=sin(x)+cos(2πx). The function is not periodic.
The problem is that
2πare incommensurable. There do not exist positive integers
I am abstracting the details of implementation so as not to make the post even further boring.
During the period of development, I faced few issues and had a lot of queries to make.
The new implementation returns a value which might not be the fundamental period of the given function.
The previous implementation, though limited, returned the fundamental period of the given function.
The ability to find the LCM of irrationals.
We will be dealing with the iconic
π(and its multiples) in many of our cases(as is evident from the example above).
Currently, we donot have the functionality to find the LCM of
irrational numbers. A method needs to be developed to handle this issue.
Issue with automatic simplification while verifying the result.
I am looking forward to addressing all these issues in tonight's meeting.
Apart from that, implementing this was a lot of fun.
I got to learn about inheritance and abstraction while implementing instance methods for periodic functions.
Hopefully, all my effort doesn't go in vain.
Till next time !