Skip to main content

fourier analysis - FourierTransform and Partial Derivatives?


I have a function of three variables $f(x,y,z)$, and it obeys a linear partial differential equation. I'm checking my by-hand calculations with Mathematica. I want to convert the PDE into the Fourier-spectral domain, but Mathematica isn't playing nice. I find the following behavior baffling.


FourierTransform[D[f[x, y, z], x], {x, y, z}, {kx, ky, kz}]


-I kx FourierTransform[FourierTransform[FourierTransform[f[x,y,z],x,kx],y,ky],z,kz]




FourierTransform[D[f[x, y, z], y], {x, y, z}, {kx, ky, kz}]


FourierTransform[Derivative[0, 1, 0][f][x, y, z],{x,y,z},{kx,ky,kz}]



FourierTransform[D[f[x, y, z], z], {x, y, z}, {kx, ky, kz}]


FourierTransform[Derivative[0, 0, 1][f][x, y, z],{x,y,z},{kx,ky,kz}]




Essentially, it's like Mathematica uses $\mathcal{F}\left[\frac{\partial f}{\partial x}\right]=-i k_x \mathcal{F}\left[f\right]$ for the first argument $x$, but does not use the same rules/identities for partials w.r.t. second and third arguments, i.e. $\mathcal{F}\left[\frac{\partial f}{\partial y}\right]$ and $\mathcal{F}\left[\frac{\partial f}{\partial z}\right]$ are not simplified.


What's going on here? How can I force Mathematica to do this simplification for the other variables?



Answer



I also would expect Mathematica to simplify all Fourier transformed derivatives equally, but it may be understandable that the simplifications are harder to see when the derivative is not taken with respect to the innermost Fourier transform variable.


To work around this problem, you could change the order of integrations for the Fourier transform to always have the differentiation variable as the innermost integration variable, too. For example,


FourierTransform[D[f[x, y, z], y], {y, x, z}, {ky, kx, kz}]

(*
==> -I ky FourierTransform[
FourierTransform[FourierTransform[f[x, y, z], y, ky], x, kx], z, kz]

*)

Here I've made use of the assumption that the above order of integrations is equal to


FourierTransform[D[f[x, y, z], y], {x, y, z}, {kx, ky, kz}]

To explain why the different treatment happens, one would have to know more about the internals of the FourierTransform algorithm. That's not so trivial because this includes dealing with functions that may not be square-integrable (which Mathematica is able to do). For square-integrable functions, the relation you're expecting comes from the fact that the derivative can be removed using an integration by parts, where the boundary term at infinity is zero:



$$\begin{array}{ccl}&&\int_{-\infty}^{\infty}e^{ik_{y}y}\int_{-\infty}^{\infty}e^{ik_{x}x}\frac{d}{dx}f(x,y)\, dx\, dy\\&=&\int_{-\infty}^{\infty}e^{ik_{y}y}\left\{ \underbrace{\left[e^{ik_{x}x}f(x,y)\right]_{-\infty}^{\infty}}_{=0}-\int_{-\infty}^{\infty}\left(\frac{d}{dx}e^{ik_{x}x}\right)f(x,y)\, dx\right\} \, dy\\&=&-ik_{x}\int_{-\infty}^{\infty}e^{ik_{y}y}\int_{-\infty}^{\infty}e^{ik_{x}x}f(x,y)\, dx\, dy.\end{array}$$



However, when the differentiation is not with respect to the innermost integration variable, then the corresponding boundary term is itself a Fourier integral (say over $x$ in the above example), which must be evaluated in the limits for $y \to \pm \infty$:




$$\begin{array}{ccl}& & \int_{-\infty}^{\infty}e^{ik_{y}y}\int_{-\infty}^{\infty}e^{ik_{x}x}\frac{d}{dy}f(x,y)\, dx\, dy\\ & = & \left[e^{ik_{y}y}\int_{-\infty}^{\infty}e^{ik_{x}x}f(x,y)\, dx\right]_{-\infty}^{\infty}-ik_{y}\int_{-\infty}^{\infty}e^{ik_{y}y}\int_{-\infty}^{\infty}e^{ik_{x}x}f(x,y)\, dx\, dy\end{array}$$



This involves an assumption not about the square-integrability of $f$ alone, but of its Fourier integral with respect to a different variable. So maybe this is why Mathematica doesn't like to make that simplification. As I said, things are more complicated if I want to include non-normalizable functions whose transforms involve Dirac delta functions etc. Therefore, this isn't a complete explanation.


Comments

Popular posts from this blog

plotting - Filling between two spheres in SphericalPlot3D

Manipulate[ SphericalPlot3D[{1, 2 - n}, {θ, 0, Pi}, {ϕ, 0, 1.5 Pi}, Mesh -> None, PlotPoints -> 15, PlotRange -> {-2.2, 2.2}], {n, 0, 1}] I cant' seem to be able to make a filling between two spheres. I've already tried the obvious Filling -> {1 -> {2}} but Mathematica doesn't seem to like that option. Is there any easy way around this or ... Answer There is no built-in filling in SphericalPlot3D . One option is to use ParametricPlot3D to draw the surfaces between the two shells: Manipulate[ Show[SphericalPlot3D[{1, 2 - n}, {θ, 0, Pi}, {ϕ, 0, 1.5 Pi}, PlotPoints -> 15, PlotRange -> {-2.2, 2.2}], ParametricPlot3D[{ r {Sin[t] Cos[1.5 Pi], Sin[t] Sin[1.5 Pi], Cos[t]}, r {Sin[t] Cos[0 Pi], Sin[t] Sin[0 Pi], Cos[t]}}, {r, 1, 2 - n}, {t, 0, Pi}, PlotStyle -> Yellow, Mesh -> {2, 15}]], {n, 0, 1}]

plotting - Plot 4D data with color as 4th dimension

I have a list of 4D data (x position, y position, amplitude, wavelength). I want to plot x, y, and amplitude on a 3D plot and have the color of the points correspond to the wavelength. I have seen many examples using functions to define color but my wavelength cannot be expressed by an analytic function. Is there a simple way to do this? Answer Here a another possible way to visualize 4D data: data = Flatten[Table[{x, y, x^2 + y^2, Sin[x - y]}, {x, -Pi, Pi,Pi/10}, {y,-Pi,Pi, Pi/10}], 1]; You can use the function Point along with VertexColors . Now the points are places using the first three elements and the color is determined by the fourth. In this case I used Hue, but you can use whatever you prefer. Graphics3D[ Point[data[[All, 1 ;; 3]], VertexColors -> Hue /@ data[[All, 4]]], Axes -> True, BoxRatios -> {1, 1, 1/GoldenRatio}]

plotting - Mathematica: 3D plot based on combined 2D graphs

I have several sigmoidal fits to 3 different datasets, with mean fit predictions plus the 95% confidence limits (not symmetrical around the mean) and the actual data. I would now like to show these different 2D plots projected in 3D as in but then using proper perspective. In the link here they give some solutions to combine the plots using isometric perspective, but I would like to use proper 3 point perspective. Any thoughts? Also any way to show the mean points per time point for each series plus or minus the standard error on the mean would be cool too, either using points+vertical bars, or using spheres plus tubes. Below are some test data and the fit function I am using. Note that I am working on a logit(proportion) scale and that the final vertical scale is Log10(percentage). (* some test data *) data = Table[Null, {i, 4}]; data[[1]] = {{1, -5.8}, {2, -5.4}, {3, -0.8}, {4, -0.2}, {5, 4.6}, {1, -6.4}, {2, -5.6}, {3, -0.7}, {4, 0.04}, {5, 1.0}, {1, -6.8}, {2, -4.7}, {3, -1.