Opened 4 years ago
Closed 4 years ago
#23672 closed defect (fixed)
Improve documentation and user interface of Fourier series
Reported by:  egourgoulhon  Owned by:  

Priority:  major  Milestone:  sage8.1 
Component:  documentation  Keywords:  Fourier series, piecewise functions 
Cc:  wdj  Merged in:  
Authors:  Eric Gourgoulhon  Reviewers:  Richard L Lozes 
Report Upstream:  N/A  Work issues:  
Branch:  8cb8a4d (Commits, GitHub, GitLab)  Commit:  8cb8a4d58dd74922a5b66d6b20f0b3a7507ea611 
Dependencies:  Stopgaps: 
Description
As discussed in https://groups.google.com/forum/#!topic/sagedevel/b1pWen3lrKA, the documentation of Fourier series as implemented in piecewisedefined functions needs some improvement. This ticket provides it, as well as a simplification of the user interface: the halfperiod is now an optional argument; if not provided, it is inferred from the domain of the piecewisedefined function:
sage: f = piecewise([((0, 2*pi), cos(x))]) sage: f.fourier_series_cosine_coefficient(1) # results in TypeError in Sage 8.0 1 sage: f.fourier_series_cosine_coefficient(1, pi) # compatible with Sage 8.0 1
The ticket also corrects two bugs:
 computation of Fourier coefficients when the domain width does not coincide with the period:
sage: f = piecewise([((0, 4*pi), cos(x))]) sage: f.fourier_series_cosine_coefficient(1, pi) # yields 2 in Sage 8.0 1
 despite what it claimed, the method
fourier_series_partial_sum
did not return S_{N}(x) but S_{N1}(x) (this is because the summation was governed bysrange(1, N)
instead ofsrange(1, N+1)
); we have nowsage: f = piecewise([((0, 2*pi), cos(x))]) sage: f.fourier_series_partial_sum(1, pi) # yields 0 in Sage 8.0 cos(x)
Change History (6)
comment:1 Changed 4 years ago by
 Branch set to public/23672Fourier_series
 Cc wdj added
 Commit set to de1bb7029195085c36dc9ae2de8d969aa0119e18
 Status changed from new to needs_review
comment:2 Changed 4 years ago by
 Commit changed from de1bb7029195085c36dc9ae2de8d969aa0119e18 to 8cb8a4d58dd74922a5b66d6b20f0b3a7507ea611
Branch pushed to git repo; I updated commit sha1. New commits:
8cb8a4d  Rewrite the Fourier series sections in Sage Constructions

comment:3 Changed 4 years ago by
 Status changed from needs_review to positive_review
Changes documented with explanatory texts and tests. Now behaves as one expects of a Fourier series.
comment:4 Changed 4 years ago by
Thank you for the review!
comment:6 Changed 4 years ago by
 Branch changed from public/23672Fourier_series to 8cb8a4d58dd74922a5b66d6b20f0b3a7507ea611
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
Improve documentation and user interface of Fourier series