Good morning,
I am trying to create a fourier series of a triangular wave through sympy.
The period is from 0 to 1, with f=0 in x=0 and f=1 in x=1. The code is below.
However, it seems as if fourier_series automatically assumes that f=0 in the middle of the interval, at x=0.5. So it assumes that x=0->f=-0.5 and x=1->f=0.5, even though that is not the function I have defined
Could anybody explain me what the problem is?
Thanks
from sympy import fourier_series, pi
from sympy import *
from sympy.abc import x
f = x
s = fourier_series(f, (x, 0, 1))
s1 = s.truncate(n=5)
p = plot(f, s1, (x, 0, 1), show=False, legend=True)
p.show()