HP Forums
Fourier Series - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Fourier Series (/thread-5885.html)



Fourier Series - toshk - 03-17-2016 11:23 PM

Bug/error: Prime
eg. function x (-pi <x< pi); enter as fourier_bn(x,x,2*pi,n)
Prime: fourier_bn(x,x,2*π,n)---->((-2*n*pi*cos(2*n*pi)+sin(2*n*pi))/(n^2*pi)) WRONG
[attachment=3245]


Correct Answer Should Be:
((-2*n*pi*cos(n*pi)+sin(n*pi))/(n^2*pi)) which is true for code written by Salvomic
[attachment=3246]


RE: Fourier Series - Dirk.nl - 03-18-2016 01:24 AM

PocketCASpro on my iPad gives the same answer as the Prime.


RE: Fourier Series - parisse - 03-18-2016 07:42 AM

You must add an additional parameter a if the function is defined on [a,a+T] instead of [0,T] where T is the period. You should also do assume(n,integer) before calling fourier_bn.


RE: Fourier Series - toshk - 03-18-2016 09:55 AM

[attachment=3247]
Prime doesn't, well i think the source code must be revisited and the Help info improve:
eg; if one wants the value for a0 prime outputting a0/2.
Prime DO NOT:
[attachment=3248]


Salvomic DOES IT;
[attachment=3249]


RE: Fourier Series - parisse - 03-18-2016 11:24 AM

I don't think you understand my answer, compare
Code:
assume(n,integer); fourier_bn(x,x,2*π,n,-pi)
and
Code:
assume(n,integer); fourier_bn(x,x,2*π,n)