MATLAB Fft in matlab

I have to solve a differential equation in MATLAB in (x,y) involving partial derivatives. My solution is a function of (x,y). I want to use fft differentiation( spectral method) to solve my partial derivatives.But i am stuck. I am using the following algorithm


% fderiv = ifft((i*k).^p .* fft(f)); % pth derivative of f(matrix containing functional values).
But when i try this for size(f)=2 ..it is not showing me the correct result.

my x is symmetric (-L,L)

1. does this method work with periodic f only or non periodic functions can be differentiated as well? If yes..how?
2. How to choose k in above program?
 

Want to reply to this thread?

"Fft in matlab" You must log in or register to reply here.

Related Threads for: Fft in matlab

Replies
0
Views
5K
Replies
0
Views
3K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top