[sympy] Re: Inverse Fourier transform of a partial fraction decomposition looks to give a wrong answer

2018-04-10 Thread Janko Slavič
the normalization is not a problem. Dear Suominen, than you for the try, 
but this was not the point.

Sympy uses the unitary, ordinary-frequency inverse Fourier transform and 
there should be not 1/2pi.

The problem is much deeper; that final result (without the normalization) 
is different from the theoretical result when the assumption Re[lambda]>0 
or Re[lambda]<0 and t>0 or t<0 are used.

Hope for help.

On Tuesday, April 10, 2018 at 1:44:29 PM UTC+2, Kalevi Suominen wrote:
>
> There are two common definitions of inverse Fourier transform depending on 
> how the frequency variable is interpreted. (See 
> https://en.wikipedia.org/wiki/Fourier_transform#Other_conventions) The 
> stackexchange post is using the angular frequency ω that differs by the 
> factor 2π from frequency variable assumed by SymPy. The transforms are also 
> differently normalized. That may explain the differing results.
>
> Kalevi Suominen
>
> On Tuesday, April 10, 2018 at 9:16:57 AM UTC+3, Janko Slavič wrote:
>>
>> I am trying to replicate this:
>>
>> https://math.stackexchange.com/questions/2280196/inverse-fourier-transform-of-a-partial-fraction-decomposition
>> with sympy.
>>
>> With Mathematica I get just the same behavior as the above theory 
>> suggest. 
>>
>> With sympy I it looks wrong. At t<0, I get the result close to the 
>> correct one for t>0. (I was not able to include all the assumptions in 
>> sympy).
>>
>> Here is the sympy code:
>>
>> import sympy as sym
>> sym.init_printing()
>> ω = sym.symbols('omega', real=True, positive=True) 
>> R, λ = sym.symbols('R, lambda', complex=True)
>> t = sym.symbols('t', real=True, positive=True)
>> α = R/(sym.I*ω-λ)+sym.conjugate(R)/(sym.I*ω-sym.conjugate(λ))
>> α
>> sym.inverse_fourier_transform(α, ω, -t)
>>
>>
>> and the Mathematica:
>>
>> a = InverseFourierTransform[ R/(I omega - lambda) +  Conjugate[R]/(I 
>> omega - Conjugate[lambda]), omega, t,
>>   FourierParameters -> {1, -1}]
>> Simplify[a, {Re[lambda] < 0, t > 0}]
>>
>> Is the sympy result really wrong?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/ac10a06e-7070-427c-861f-f4590f3c4613%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Re: Inverse Fourier transform of a partial fraction decomposition looks to give a wrong answer

2018-04-10 Thread Kalevi Suominen
There are two common definitions of inverse Fourier transform depending on 
how the frequency variable is interpreted. (See 
https://en.wikipedia.org/wiki/Fourier_transform#Other_conventions) The 
stackexchange post is using the angular frequency ω that differs by the 
factor 2π from frequency variable assumed by SymPy. The transforms are also 
differently normalized. That may explain the differing results.

Kalevi Suominen

On Tuesday, April 10, 2018 at 9:16:57 AM UTC+3, Janko Slavič wrote:
>
> I am trying to replicate this:
>
> https://math.stackexchange.com/questions/2280196/inverse-fourier-transform-of-a-partial-fraction-decomposition
> with sympy.
>
> With Mathematica I get just the same behavior as the above theory suggest. 
>
> With sympy I it looks wrong. At t<0, I get the result close to the correct 
> one for t>0. (I was not able to include all the assumptions in sympy).
>
> Here is the sympy code:
>
> import sympy as sym
> sym.init_printing()
> ω = sym.symbols('omega', real=True, positive=True) 
> R, λ = sym.symbols('R, lambda', complex=True)
> t = sym.symbols('t', real=True, positive=True)
> α = R/(sym.I*ω-λ)+sym.conjugate(R)/(sym.I*ω-sym.conjugate(λ))
> α
> sym.inverse_fourier_transform(α, ω, -t)
>
>
> and the Mathematica:
>
> a = InverseFourierTransform[ R/(I omega - lambda) +  Conjugate[R]/(I omega 
> - Conjugate[lambda]), omega, t,
>   FourierParameters -> {1, -1}]
> Simplify[a, {Re[lambda] < 0, t > 0}]
>
> Is the sympy result really wrong?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/119a93ac-a193-49e6-92cf-6872ca99b2cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.