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: sage-8.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:

Status badges


As discussed in!topic/sage-devel/b1pWen3lrKA, the documentation of Fourier series as implemented in piecewise-defined functions needs some improvement. This ticket provides it, as well as a simplification of the user interface: the half-period is now an optional argument; if not provided, it is inferred from the domain of the piecewise-defined function:

sage: f = piecewise([((0, 2*pi), cos(x))]) 
sage: f.fourier_series_cosine_coefficient(1)  # results in TypeError in Sage 8.0
sage: f.fourier_series_cosine_coefficient(1, pi)  # compatible with Sage 8.0

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
  • despite what it claimed, the method fourier_series_partial_sum did not return SN(x) but SN-1(x) (this is because the summation was governed by srange(1, N) instead of srange(1, N+1)); we have now
    sage: f = piecewise([((0, 2*pi), cos(x))])
    sage: f.fourier_series_partial_sum(1, pi)  # yields 0 in Sage 8.0

Change History (6)

comment:1 Changed 4 years ago by egourgoulhon

  • Branch set to public/23672-Fourier_series
  • Cc wdj added
  • Commit set to de1bb7029195085c36dc9ae2de8d969aa0119e18
  • Status changed from new to needs_review

New commits:

de1bb70Improve documentation and user interface of Fourier series

comment:2 Changed 4 years ago by git

  • Commit changed from de1bb7029195085c36dc9ae2de8d969aa0119e18 to 8cb8a4d58dd74922a5b66d6b20f0b3a7507ea611

Branch pushed to git repo; I updated commit sha1. New commits:

8cb8a4dRewrite the Fourier series sections in Sage Constructions

comment:3 Changed 4 years ago by rllozes

  • 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 egourgoulhon

Thank you for the review!

comment:5 Changed 4 years ago by rllozes

  • Reviewers set to Richard L Lozes

Filled in "Reviewers" field.

comment:6 Changed 4 years ago by vbraun

  • Branch changed from public/23672-Fourier_series to 8cb8a4d58dd74922a5b66d6b20f0b3a7507ea611
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.