Fourier Transform Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Fourier Transform « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
New member
Username: rambharose

Post Number: 1
Registered: 12-2006
Posted on Tuesday, December 12, 2006 - 09:09 pm:   

Hi,

I am a new user of FlexPDE 5 and I like using it very much. Thanks for such an amazing product.

I am solving a simple 1D parabolic equation and getting a complex electric field E(x, t) as a solution. I want to compute the Fourier Transform (FT) of this complex Field (FT in space not in time). I am not able to do this integral in FlexPDE. Please help.

Then need to plot (cos (theta)*FT) vs. time. Where ‘theta’ is a user defined array. I did not find any function in FlexPDE which calculates the FT. Also all the integrals commands appear to be valid in 2D only!

Please help.

Ram
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 712
Registered: 06-2003
Posted on Wednesday, December 13, 2006 - 03:17 pm:   

FlexPDE does not have any internal facilities for Fourier Transforms.

We will give consideration to adding them in future versions, but there are semantic difficulties in how to incorporate the transformed domain specification into the FlexPDE script model.

In the meantime, you will have to use TABLE output with a POINTS=1024 specification (or some other convenient size) and process the data with an external FFT program.

The TABLE output will generate uniform sampling intervals suitable for FFT processing.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
New member
Username: rambharose

Post Number: 2
Registered: 12-2006
Posted on Wednesday, December 13, 2006 - 05:41 pm:   

I donot have any other FFT program.

If want to calculate the following:

E(theta,t)= integral[E(x,t)exp(-2i.pi.sin(theta))], where 'theta' is a user defined array.

Is there no way that this can be done in FlexPDE?

Ram
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 715
Registered: 06-2003
Posted on Wednesday, December 13, 2006 - 09:14 pm:   

Sure, you can form that integral (I assume that the integral is over X) for a specific t and a specific theta. But that's not the same as producing a Fourier transform.

Also, you'll have to name the result something different than the factor in the integrand, or you'll get an infinite recursion.

You might want to check the web for FFT programs. There must be a lot of them.

Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
Junior Member
Username: rambharose

Post Number: 3
Registered: 12-2006
Posted on Thursday, December 14, 2006 - 02:24 pm:   

Yes, its not exactly a FT but I can do with it.
However, I am little confused as how to implement this integral in a 1D analysis (parabolic problem).

Can you please help.

I need to evaluate the following:

FF = Integral[f(x,theta,t)dx]

where I have named the result as 'FF' ,where FF is FF(theta,t) .

and f(x)= E(x,t)*exp(-2*i*pi*sin(theta)).

Now the problem is E(x,t) is a complex quantity as is the argument of the exponential. As a solution of my parabolic PDE I am getting the real and imaginary part of E(x,t) from FlexPDE. But, how do I implement the integral i.e how do I sepaerate the integral in real and imaginary parts in FlexPDE?

Basically I need to evaluate the integral at each 't' and each 'theta' and plot FF(theta,t) vs t as an elevation plot.

How do I define the theta array? Will the elevation plot work in my case?

Please give me some suggestions

Ram
Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
Member
Username: rambharose

Post Number: 4
Registered: 12-2006
Posted on Monday, December 18, 2006 - 02:34 pm:   

I am having difficulty with integration in 1D. Please help me with the above problem too. Is the syntax same in 1D as for 2D?

RAM
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 720
Registered: 06-2003
Posted on Thursday, December 21, 2006 - 07:32 pm:   

Algebra tells us that
exp(i*p) = cos(p) + i*sin(p)

Letting p = -2*pi*sin(theta) defines the real and imaginary parts of your exponential.

Algebra also tells us that
(a+i*b)*(c+i*d) = (a*c-b*d) + i*(b*c+a*d)

If you have real and imaginary parts of E(x,t), then letting a=Er(x,t) b=Ei(x,t)
c=cos(p) and d=sin(p)
and following the rules of algebra,
the result is
fr(x,t)=Er(x,t)*cos(p)-Ei(x,t)*sin(p)
fi(x,t)=Ei(x,t)*sin(p)+Er(x,t)*cos(p)

The real and imaginary parts of FF are then
FFr = INTEGRAL(fr(x,t))
FFi = INTEGRAL(fi(x,t))

If you are solving a time dependent system, then both x and t are implicitly known, and need not be written as explicit arguments of Er,Ei,fr and fi.

Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
Member
Username: rambharose

Post Number: 7
Registered: 12-2006
Posted on Friday, December 22, 2006 - 03:06 pm:   

Thanks for the reply. The decomosition of FF into real and imaginary parts was trivial, but I thought the command 'integral' was valid only in 2D. So I did not give it a try. Thanks for the help.

However,I still have a problem. How do I plot (abs(FF))^2 (= FFr^2 + FFi^2 ) as a function of 'theta' array. I need to plot with 'theta' in the abscissa in an elevation plot.
The theta array is to be defined as :

th= -pi/2 to pi/2 in steps of (say) pi/512
theta = 180*th/pi (conversion to degrees)

Specifically how do I define this 'theta' as an array in FlexPDE.

One thing, I think I can do is define this array externally, and input it as a 'table' in FlexPDE.
Can the 'array' command in FlexPDE be used for this purpose?

But then, how do I plot (abs(FF))^2 vs theta with theta in abscissa in FlexPDE. Is such an operation suported in elevation plot.

Please Help.

Ram
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 721
Registered: 06-2003
Posted on Friday, December 22, 2006 - 04:31 pm:   

Since you have not sent your script, I can only guess what you have in mind.

But it appears to me that what you want is a STAGED problem, in which THETA varies between stages. In this case, you can plot a HISTORY of FF components VERSUS THETA.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ram (rambharose)
Member
Username: rambharose

Post Number: 8
Registered: 12-2006
Posted on Friday, December 22, 2006 - 04:46 pm:   

Thanks for the reply.

Well, 'theta' is just an auxiliary coordinate and I want to plot the quantity ‘(abs(FF))^2’ evaluated at the auxiliary coordinate vs. the auxiliary coordinate as abscissa. Is an elevation plot possible in this case? Please help.


Ram
Top of pagePrevious messageNext messageBottom of page Link to this message

Matthew Hills (mdhills)
New member
Username: mdhills

Post Number: 2
Registered: 01-2007
Posted on Tuesday, January 09, 2007 - 10:26 pm:   

Just wanted to add that FlexPDE's export options can be read in with MATLAB. If you have convenient access to that, it would be a good option for your FFTs.

Octave is a freeware option that should have similar capabilities (although I haven't used it extensively).

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration