Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-14 Thread Alan Bromborsky
Thank you for your comment.  In my write up I am proselytizing two things.  Firstly, the Asymptote software package makes really nice plots (I will attach the code I wrote to this email). Secondly, the difference between the FFT (inverse FFT) and the Fourier transform (inverse Fourier transform

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-14 Thread 'Tom van Woudenberg' via sympy
Hi Brombo, That's a very nice result. I'll use it in my education! Regarding your previous questions: The correct statement in Python/SymPy should be: solution = 2 * sp.integrate(sp.re(solution_in_frequency_domain*sp.exp(sp.I*2*sp.pi*phi*t)),(phi,0,4)) I arbitrarily chose 4 as an cutoff value fo

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-10 Thread Alan Bromborsky
In your numerical solution your integration statement (I am not familiar with Maple or is this sympy where "import sympy as sp" is used) is - solution_numeric = 1 / sp.pi * sp.integrate(sp.re (solution_in_frequency_domain_numeric*sp.exp(sp.I*2*phi*t)),(phi,0,4)) Does that statem

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-10 Thread Alan Bromborsky
I will make sure I translated you code to the correct fromula. On 2/10/23 11:32 AM, 'Tom van Woudenberg' via sympy wrote: This is the result in Python (same as in Maple): downloaden (5).png Op vrijdag 10 februari 2023 om 17:31:50 UTC+1 schreef Tom van Woudenberg: Hi Brombo, Thank you

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-10 Thread 'Tom van Woudenberg' via sympy
This is the result in Python (same as in Maple): [image: downloaden (5).png] Op vrijdag 10 februari 2023 om 17:31:50 UTC+1 schreef Tom van Woudenberg: > Hi Brombo, > > Thank you for the update. It seems my previous posts didn't show up. > Anyway, you result doesn't match the result in Maple and

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-10 Thread 'Tom van Woudenberg' via sympy
Hi Brombo, Thank you for the update. It seems my previous posts didn't show up. Anyway, you result doesn't match the result in Maple and the numerical evalution of the integral in Python: Would be wonderful if we'd find an analytical solution. Op vrijdag 10 februari 2023 om 01:08:56 UTC+1 schre

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-08 Thread Alan Bromborsky
I think what I have done is correct up to the point of taking the convolution product.  Both G(t) and H(t) are piecewise functions. You have to be super careful when convolving them.  I think that is where I messed up.  I am working on a sympy class to convolve piecewise functions.  Currently i

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-08 Thread Alan Bromborsky
Is the plot shown here a numerical integration of your entire function or is it a plot of my H(t)?  I am going to redo the convolution using a package for convolution of piecewise functions I wrote for sympy.  I love doing this sort of stuff in my retirement. On 2/8/23 4:24 AM, 'Tom van Wouden

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-07 Thread 'Tom van Woudenberg' via sympy
Thank you brombo, I'll take a closer look at the file you send me! Op maandag 6 februari 2023 om 22:29:25 UTC+1 schreef brombo: > I cleaned things up here is what the notebook looks like (see attached > html) - > > > On 2/6/23 10:36 AM, 'Tom van Woudenberg' via sympy wrote: > > Hi there, > > Wh

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-06 Thread Alan Bromborsky
You can use residues but I made a mistake.  You have to do a partial fraction decomposition of the reciprocal quadratic factor.  Then both poles of your integrand lie in the lower half plane so that the inverse transform is zero for t<0.  For t>0 you have calculate the residue of each component

Re: [sympy] Evaluating integral in manual inverse fourier transform

2023-02-06 Thread Alan Bromborsky
Also note if you use the residue theorem there is a different path depending on whether t>0 or t<0.  This means when you calculate the residue you only use one pole (phi+ or phi-) depending on the path.  The path chosen makes sure that the part of it not on the real axis does not contribute to