1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Extending a 2-dimensional nonlinear objective problem to 50-dimensions

  1. Sep 18, 2015 #1

    FOIWATER

    User Avatar
    Gold Member

    Hi,

    I have a small two dimensional nonlinear objective that has a very well defined minimum and maximum. Here is the function:
    $$f(x,y)=2(1-x)^{2}e^{-x^{2}-(y+2)^{2}}-9(\frac{x}{5}-x^{3}-y^{5})e^{-x^{2}-y^{2}}-\frac{1}{5}e^{-(x-1)^{2}-y^{2}}$$

    Attached is it's plot and contour.

    Notice this nonlinear function is only 2 dimensional in its arguements.

    I am trying to code my own MATLAB function that will solve nonlinear optimizations (no constraints, at the moment) faster than the standard solver.

    I want to test it against a large objective, I am thinking 50 or 60 arguements. I would like a function which has a well defined global minimum. Does anyone know of one which is?

    I could extend the one above, but I want to be sure before I test with it..

    Any help appreciated!

    Plot1.png Contour1.png
     
  2. jcsd
  3. Sep 18, 2015 #2

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    What about the following, for ##\vec{x}## a ##n##-vector?

    $$f(\vec{x})\equiv \exp\left(\sum_{i=1}^n {x_i}^2\right)$$

    It's nonlinear and has a global minimum at ##\vec{x}=\vec{0}##.

    Or did you want something that's not monotonic and hence has local extrema distinct from the global ones?
     
  4. Sep 19, 2015 #3

    FOIWATER

    User Avatar
    Gold Member

    That's a good function to keep in mind I will definitely do it thanks. I would love one that has various well defined local minima as well as a well defined global one, if I can find one
     
  5. Sep 19, 2015 #4

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I think this might give you what you want, for ##n## of the order of 50 or 60:

    $$
    f(\vec{x})\equiv \prod_{i=1}^n\left( a_i\prod_{j=1}^4 (x_i-b_{ij})\right)
    $$

    where ##\forall i:\,a_{i}>0##. Just choose any bunch of coefficients ##a_i## and ##b_{ij}##. You could get the computer to do this with random number generation, or you could choose a pattern for them. All that matters is that they are mostly different from one another.

    ##f## is a product of ##n## quartic polynomials with positive leading coefficient. Each of the quartics will have a global minimum as well as possibly a local non-global minimum. Let the two local minima of the ##i##th quartic be ##m_i^1## and ##m_i^2##, where those two numbers are equal if the quartic has only one local minimum (eg ##x^4##).

    Then the set of local minima of ##f## is

    $$S=\left\{(m_1^{k_1},m_2^{k_2},...,m_n^{k_n})\ |\ \forall i\ k_i\in\{1,2\}\right\}$$

    ##S## has cardinality of at most ##2^n##, so you can easily identify all the local minima and work out which one gives the global minimum.

    You can then run it through your optimiser to see if it finds the correct minimum.
     
  6. Sep 24, 2015 #5

    FOIWATER

    User Avatar
    Gold Member

    That's awesome, is it a function that has any actual real world application or just something you've constructed
     
  7. Sep 24, 2015 #6

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I just made it up - especially for you. :smile:
     
  8. Sep 24, 2015 #7

    FOIWATER

    User Avatar
    Gold Member

    I am going to test it against this. Thankyou.

    I am also trying to find a nonlinear function of about 50 variables, could be more could even be 100, that has a real world application with no constraints. Could even be a constrained problem where the constraints have been added to the objective as penalties. Do you know of any? I think most real world problems are going to be constrained at such a large number of variables, though.
     
  9. Sep 24, 2015 #8

    FOIWATER

    User Avatar
    Gold Member

    You see, I am trying to construct some of my own, but everytime I test them, they are unbounded. for example, I have been trying variations on:
    $$\sum_{i=1}^{25}(0.25+0.5x_{i}+x_{i}^2)+constant\times \sum_{i=26}^{50}\sum_{j=26}^{50}x_{i}(x_{i}-x_{j})*constant$$
    Or something like that. But when I test them in 'fminunc' it's always unbounded. I am noticing I need to make them with exp(-ve arguement) so that as I move away from the origin in any direction, the function goes to zero. So the optimum is close to the origin.
     
  10. Sep 25, 2015 #9

    FOIWATER

    User Avatar
    Gold Member

    I am starting to realize the difficulty in constructing nonlinear functions without constraints that are bounded? Everything I am creating...is unbounded. Everything that's mostly nonlinear and not quadratic
     
  11. Sep 25, 2015 #10

    andrewkirk

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Try using sin and cos functions, which are bounded, non-linear and non-quadratic.

    eg ##\sum_{i=1}^n a_i\sin(b_i x_i+c_i)## will have an infinite number of local extrema, but will be bounded by ##\pm\sum_{i=1}^n |a_i|##.

    If you want to ensure a unique global maximum and minimum, multiply it by
    $$e^{-\sum_{i=1}^n {x_i}^2}$$.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Extending a 2-dimensional nonlinear objective problem to 50-dimensions
  1. 2 for 1 is 50% off? (Replies: 18)

Loading...