Last active
November 28, 2015 06:05
-
-
Save nobonobo/c2b1b415f7585f0f93dd to your computer and use it in GitHub Desktop.
sympyで矩形波関数をフーリエ級数展開
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sympy import * | |
| # fourier 5回級数展開 | |
| l = [-mpmath.pi, mpmath.pi] | |
| f0 = lambda x:sign(sin(x)) | |
| cs = mpmath.fourier(f0, l, 5) | |
| f1 = lambda x: mpmath.fourierval(cs, l, x) | |
| mpmath.plot([f0, f1], xlim=l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment