I think that we need to improve the integrator capability, but usually that 
is one of the most difficult thing to do.
For Fourier transformation to give general functional results (DiracDelta) 
than improperly integrable functions, I'm not sure meijerint is sufficient 
for that.
But if that is possible, then this can be one of the reason why we should 
have separate implementation for `fourier_transform` 
than `integrate(f(t)*exp(I*w*t), (t, -oo, oo))`.

On Friday, April 23, 2021 at 11:51:57 PM UTC+9 [email protected] wrote:

> Ah yes, thanks for this. Will the Sympy include these symbolic fourier 
> transform results?
>
> The last two: -1/t^2 and 2/t^3 can be solved using the time 
> differentiation and the 'duality' property of Fourier transform. In matlab 
> this can be done by 
> syms t w
> fourier(-1/t^2) 
> I used Maple but it does not work either, only for sin and cos which is 
> just 0.5 amplitude dirac delta pulses. 
>
>
> On Wednesday, April 21, 2021 at 5:29:50 PM UTC+1 [email protected] 
> wrote:
>
>> Le mardi 20 avril 2021 à 13:01:13 UTC+2, [email protected] a écrit :
>>
>>> Fourier transform is currently implemented in SymPy only for integrable 
>>> functions. None of those functions is integrable
>>>
>>
>> I beg your pardon ?
>>
>> >>> from sympy import fourier_transform, exp, cos, sin, integrate
>> >>> from sympy.abc import t,w,o 
>> >>> integrate(sin(o*t),t)
>> Piecewise((-cos(o*t)/o, Ne(o, 0)), (0, True))
>> >>> integrate(cos(o*t),t)
>> Piecewise((sin(o*t)/o, Ne(o, 0)), (t, True))
>> >>> integrate(1/t**2,t)
>> -1/t
>> >>> integrate(2/t**3,t)
>> -1/t**2
>>
>> so SymPy cannot be used find the transform.
>>>
>> Please…
>>
>> >>> from sympy import fourier_transform, exp, cos, sin, integrate, I, pi, 
>> >>> oo, latex
>> >>> from sympy.abc import t,w,o 
>> >>> integrate(sin(o*t)*exp(-2*I*pi*w*t),(t,-oo,oo))
>> Piecewise((o/(4*pi**2*w**2*(-o**2/(4*pi**2*w**2) + 1)) + 1/(o*(1 - 
>> 4*pi**2*w**2/o**2)), Eq(2*Abs(arg(o)), 0) & (Abs(2*arg(w) + pi) < pi) & 
>> (Abs(2*arg(w) - pi) < pi)), (Integral(exp(-2*I*pi*t*w)*sin(o*t), (t, -oo, 
>> oo)), True))
>> >>> integrate(cos(o*t)*exp(-2*I*pi*w*t),(t,-oo,oo))
>> Piecewise((I/(2*pi*w*(-o**2/(4*pi**2*w**2) + 1)) + 2*I*pi*w/(o**2*(1 - 
>> 4*pi**2*w**2/o**2)), Eq(2*Abs(arg(o)), 0) & (Abs(2*arg(w) + pi) < pi) & 
>> (Abs(2*arg(w) - pi) < pi)), (Integral(exp(-2*I*pi*t*w)*cos(o*t), (t, -oo, 
>> oo)), True))
>> >>> integrate(1/(t**2)*exp(-2*I*pi*w*t),(t,-oo,oo))
>> Integral(exp(-2*I*pi*t*w)/t**2, (t, -oo, oo))
>> >>> integrate(2/(t**3)*exp(-2*I*pi*w*t),(t,-oo,oo))
>> 2*Integral(exp(-2*I*pi*t*w)/t**3, (t, -oo, oo))
>>
>> So sympy *can* compute at least the first two, but not via 
>> fourier_transform.
>>
>> BTW, according to Wolfram Alpha, 
>>
>>    - sin(o*t) has transform -I*sqrt(1/2)*sqrt(pi)*(dirac_delta(o + w) - 
>>    dirac_delta(-o + w)) 
>>    - cos(o*t) has transform sqrt(1/2)*sqrt(pi)*(dirac_delta(o + w) + 
>>    dirac_delta(-o + w)) 
>>    - t^(-2) has transform sqrt(1/2)*sqrt(pi)*w*sgn(w) 
>>    - 2/t^3 has transform -I*sqrt(1/2)*sqrt(pi)*w^2*sgn(w) 
>>
>>
>> HTH,
>>  
>>
>>> Kalevi Suominen
>>>
>>> On Tuesday, April 20, 2021 at 11:38:08 AM UTC+3 aTPer wrote:
>>>
>>>> I am trying to compute the integral fourier transform of 
>>>> sin(t),cos(t),-1/t^2 and 2/t^3(look at screenshot). This for checking 
>>>> answers for maths homework/tutorials.
>>>> So, I went to the Sympy documentation page and learned the code from 
>>>> there to compute the FTs of the functions defined above but none of it 
>>>> actually works. Then, I tried using the noconds=False This is my code:
>>>>
>>>> from sympy import fourier_transform, exp, cos, sin
>>>> from sympy.abc import t,w,o 
>>>> fourier_transform(sin(o*t), t, w, noconds=False) 
>>>> fourier_transform(cos(o*t), t, w, noconds=False)
>>>>  fourier_transform(-1/t**2, t, w, noconds=False)
>>>>  fourier_transform(2/t**3, t, w, noconds=False)
>>>>
>>>> https://i.stack.imgur.com/90eo8.png
>>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/a9feb71d-cbb2-41ef-be47-26fb437b6a10n%40googlegroups.com.

Reply via email to