I want to do a Fourier transform to the below function by Mathematica. How can I do it? Here $c$, $d$, $a$, $L$ are constants.

$$ w(r)= \left\{ \begin{array}{ll} -\frac{c}{\epsilon r} & r> L \\ -\frac{c}{\epsilon d}\left[\frac{a}{r}-\ln\left(\frac{r}{L}\right)\right] & a < r\leq L \\ -\frac{c}{\epsilon d}\left[\ln\left(\frac{a}{L}\right)\right] & r \leq a \\ \end{array} \right. $$


It looks like Mathematica can do this. Define something like this (I've simplified your version slightly)

w[r_] := Piecewise[{{-1/r, r > L}, {-1/d (a/r - Log[r/L]), 
    a < r <= L}, {-1/d Log[a/L], r <= a}}]

Mathematica will return a continuous Fourier transform

Assuming[0 < a < L, FourierTransform[w[r], r, k]]

I suggest you check the help for FourierTransform to ensure that the definition used is the one you want.

| improve this answer | |
  • $\begingroup$ Thank you @mikado! Is this 'Assuming[0 < a < L, FourierTransform[w[r], r, k]]' code only for the travel from 0 to L, exclude the r>L and r<= L? $\endgroup$ – aluuzz Sep 8 '19 at 22:50
  • $\begingroup$ No, I'm just saying that a is positive and less than L $\endgroup$ – mikado Sep 9 '19 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.