Hot answers tagged

7

Rule-replacement with x^n_. :> Derivative[n,0][a][y,z] (as done in Kuba's answer) has two drawbacks: if your polynomial has a constant term, then it will not be replaced by the zero-th derivative a[y,z], and if your polynomial is not expanded the result is incorrect. Namely, (1+x)(2+x) becomes (1+a'[y,z])(2+a'[y,z]) rather than 2a[y,z]+3a'[y,z]+a''[y,z] (...


5

Applying Fourier to a multi-dimensional array does a multi-dimensional FFT, so your first case generates the 2D FFT of all the trajectories. In your case you want to map the 1D FFT over each trajectory. ampFFT = Abs[Fourier[#,FourierParameters->{-1,1}]&/@(Transpose@x); Now each element of ampFFT is the 1D FFT of one trajectory, i.e. ampFFT[[i]] == ...


4

{x, x^2, x^2 + x} /. x^n_. :> Derivative[n, 0][a][y, z]



Only top voted, non community-wiki answers of a minimum length are eligible