Open Llewelyn62 opened 9 years ago
The first example doesn't evaluate now:
In [7]: fourier_transform(exp(-n*x),x,k, noconds=False)
Out[7]:
⎛ -n⋅x ⎞
FourierTransform⎝ℯ , x, k⎠
The second example I guess is
In [18]: a, b = symbols('a b')
In [19]: k = Symbol('k', integer=True, positive=True)
In [20]: n = Symbol('n', integer=True, positive=True)
In [21]: 1/sqrt(2*pi)*Integral(a*exp(-n*x)*exp(b*I*x*k), (x, 0, oo)).subs(a,1).subs(b,1).doit()
Out[21]:
√2
──────────────────
⎛ ⅈ⋅k ⎞
2⋅√π⋅n⋅⎜- ─── + 1⎟
⎝ n ⎠
Note that this comes out with a complicated Piecewise expression if k, n are no declared positive.
Does that seem correct to you?
As an example, the Fourier Transform of
(e^-n*x , x=>0)
is1/sqrt(2*pi)*(1/(n-ik))
. Using :fourier_transform(exp(x*-n),x,k, noconds=False)
Got Result =0. This is incorrect, largely I think due to the interval -oo to oo. By hand, this discontinuous equation is calculated as two parts around 0. Also output had the warning: Expected a delimiter (at char 34), (line:1, col:35) FormatterWarning, Using the source code as below (which allows limits to be set),1/sqrt(2*pi)*Integral(a*exp(-n*x)*exp(b*I*x*k), (x, 0, oo)).subs(a,1).subs(b,1).doit()
the result is not an especially readable solution, but correct. Result:1/(n(-ik/n + 1))
, which of course is1/(n-ik)
simplified.1/sqrt(2*pi)
. http://en.wikipedia.org/wiki/Fourier_transform#Other_conventionsApologies if the suggestions are not appropriate -- am newish to Python.