Error with Finding Maximum in Mathematica

Click For Summary
SUMMARY

The discussion revolves around an error encountered in Mathematica when attempting to find the maximum of a function derived from the discrete Fourier transform of a list of functions dependent on a variable x. The user is trying to maximize the sum of the Fourier-transformed list, but receives an error indicating that the input is not a valid numeric list. The issue arises because Mathematica cannot evaluate the Fourier transform of a symbolic variable. A solution involves ensuring that the input to the Fourier function is numeric or converting the list to a numerical form before applying the transform.

PREREQUISITES
  • Understanding of Mathematica syntax and functions
  • Familiarity with discrete Fourier transform concepts
  • Knowledge of symbolic computation in Mathematica
  • Basic understanding of optimization techniques in Mathematica
NEXT STEPS
  • Learn how to convert symbolic lists to numerical lists in Mathematica
  • Explore the use of InterpolatingFunction in Mathematica
  • Study the FindMaximum function in Mathematica for optimization tasks
  • Investigate error handling in Mathematica, specifically related to Fourier transforms
USEFUL FOR

Mathematica users, data analysts, and researchers working with Fourier transforms and optimization who need to resolve issues related to symbolic and numerical computations.

madness
Messages
813
Reaction score
69
I want to find the maximum of the total of a list of numbers, of which each depends on some variable x. I'm taking the discrete Fourier transform of a set of points of a function, and trying to maximise the sum of the resulting list. Although I can plot the sum of the list as a function of x, when I try to maximise it Mathematica tells me Fourier::fftl:Argument{my list} is not a non-empty list or rectangular array of numeric quantities. The error seems to be associated with taking the discrete Fourier transform of a non-numerical quantity. It should be taking this Fourier transform with a range of possible numbers and finding the maximum, but seems to be getting it wrong. Can anyone help?
 
Physics news on Phys.org
I'm not sure i understand the problem but you can perhaps convert the set to an interpolating funciton which is essentially a list of numbers to MM.
 
That's not quite it. I have a list L={a(x), b(x),...,n(x)}, the discrete Fourier transform gives Fourier[L]={A(x), B(x),..., N(x)} and my function is f(x)=A(x)+B(x)+...+N(x). This function plots perfectly and I can clearly see the maximum, but I want Mathematica to find it for me. So I say FindMaximum[F[x],{x,0}] and get the error mentioned above. It can't evaluate Fourier of x, when x isn't a number.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K