Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong computations of Fourier series #19382

Merged
merged 3 commits into from May 25, 2020

Conversation

sylee957
Copy link
Member

@sylee957 sylee957 commented May 20, 2020

References to other Issues or PRs

Fixes #19375
Fixes #19044

Brief description of what is fixed or changed

If the center of the integration limits are not origin, detecting whether the function is even or not is more complicated, and it may not even be worth testing it out because substituting x to some shifted values of x can have the issues of equality.

Other comments

I've also made the docs clear about the definitions because it was unclear how limits is supposed to do, and made some plotting examples for it.

image

Release Notes

  • series
    • Fixed wrong computations of fourier_series for even or odd functions with limits that are specified non-central.

@sympy-bot
Copy link

sympy-bot commented May 20, 2020

Hi, I am the SymPy bot (v158). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • series
    • Fixed wrong computations of fourier_series for even or odd functions with limits that are specified non-central. (#19382 by @sylee957)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.7.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Fixes #19375
Fixes #19044 


#### Brief description of what is fixed or changed

If the center of the integration limits are not origin, detecting whether the function is even or not is more complicated, and it may not even be worth testing it out because substituting `x` to some shifted values of `x` can have the issues of equality.

#### Other comments

I've also made the docs clear about the definitions because it was unclear how limits is supposed to do, and made some plotting examples for it.

![image](https://user-images.githubusercontent.com/34944973/82438764-88f93880-9ad4-11ea-8266-af5255d6daaf.png)

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
- series
  - Fixed wrong computations of `fourier_series` for even or odd functions with `limits` that are specified non-central.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@codecov
Copy link

codecov bot commented May 20, 2020

Codecov Report

Merging #19382 into master will increase coverage by 0.147%.
The diff coverage is 100.000%.

@@              Coverage Diff              @@
##            master    #19382       +/-   ##
=============================================
+ Coverage   75.618%   75.766%   +0.147%     
=============================================
  Files          651       652        +1     
  Lines       169418    170795     +1377     
  Branches     39973     40322      +349     
=============================================
+ Hits        128112    129406     +1294     
- Misses       35703     35774       +71     
- Partials      5603      5615       +12     

@sylee957 sylee957 closed this May 21, 2020
@sylee957 sylee957 reopened this May 21, 2020
@oscarbenjamin
Copy link
Contributor

Looks good

@oscarbenjamin oscarbenjamin merged commit e69d8ca into sympy:master May 25, 2020
@mfripp
Copy link

mfripp commented May 25, 2020

Thanks! This will help a lot if I start teaching Fourier series with sympy in SageMath, CoCalc or Jupyter.

@sylee957 sylee957 deleted the fix_fourier_series branch June 25, 2020 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants