Help with using IFFT to calculate radial distribution function g(r) ! PLEASE help
Show older comments
Hi all, I am trying to use ifft function to evaluate the radial distribution function g(r), r is distance (nm), by using the structure factor s(q) , which is function of wave vector q (1/nm) :

I did this by using normal integration (quad) but it takes long time to calculate it. So I believe I can use ifft to do this since the function s(q) is a discrete function.
I do not know what input I have to use in ifft() ? do I have to put q*s(q) ? what about sin (q r) ? Is it just : image (ifft()) ? Do I have to take in my account Nyquist frequency in my data ?
I am sorry there are too many questions but I am REALLY confused ):
Any help will be appreciated!
Thanks a lot .
2 Comments
Youssef Khmou
on 24 Mar 2013
Edited: Youssef Khmou
on 24 Mar 2013
hi, did you try other functions /methods for intergating : "trapz" as example ?
I think FFT/iFFT would be a good choice if the equation has convolution then in frequency domain it becomes simple produc .
talaab
on 24 Mar 2013
Answers (1)
Youssef Khmou
on 24 Mar 2013
Edited: Youssef Khmou
on 24 Mar 2013
can you try "trapz" as example ?
r=(0:0.1:2)*1e-9; % distance in NM
rho=5e-3; % charge density maybe .
K=1./(2*pi^2*r*rho); % factor
q_max=1;
N=length(r);
q=linspace(0,q_max,N); % wave factor .
sq=2*q; % example of the structure factor
f=q.*sq.*sin(q.*r); % the function
F=trapz(q,f);
F=F*K;
g=1+F;
figure, plot(r,g), title(' RADIAL FUNCTION'), grid on
xlabel(' Distance (m)'), ylabel(' magnitude');
In the program, we choose the radius so start from the origin, so the plot G(r) makes sens as we move forward, the distribution function decreases .
waiting for others users to clarify the use of FFT/IFFT....
1 Comment
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!