1

I'm currently doing optimization in a high dimensional space. I was thinking of giving FindMinimum (or NMinimize not certain yet) a shot, however what bugs me is how I can state the command, given that its input a vector of size ~200.

Most examples for FindMinimum have functions of at most 2 variables.

Now I've seen this answer on StackOverflow where the user generates all his variables using

vars = Array[Symbol["x$" <> ToString[#]] &, n];

However reading the comments showed that there were certain concerns with this method:

I would not recommend doing it in a program, but it is safe to do in an interactive session.

So is this standard, or is there a more clever solution to get to it ?

Literal
  • 383
  • 1
  • 10

1 Answers1

1

The point being made in the quoted answer was to not use the name$number convention, because Module usues it, and who knows what conflicts might happen internally if you were to generate such variables. Using x$$$s in place of x$ would be fine.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Kuba
  • 136,707
  • 13
  • 279
  • 740