Optimization Formulation Issues

Discussion in 'MATLAB' started by Scott Page, Jan 14, 2005.

  1. Scott Page

    Scott Page Guest

    Hi,

    I'm trying to minimise the following function of the variable X =
    [X(1) X(2) X(3) X(4)]

    F =-(((X(1)-X(3))^2)+((X(2)-X(4))^2))

    The function attempts to maximise the difference between X(1) and
    X(3) and also X(2) and X(4). The problem is bounded by the following
    limits

    LB=[0 0 0 0] UB = [1000 1000 1000 1000]

    I am using the following nonlinear constraints which essentially
    ensure that abs(X(1)-X(3)) and abs(X(1)-X(3)) are both >5.

    c=(-(X(1)-X(3))^2)+5) ( -(X(2)-X(4))^2)+5)

    When I try to minimse this using the fmincon function in the
    optimization toolbox the performance is heavily dependant on the
    initial point. The fmincon function either does not find a solution
    that satisfies the constraints, or does not converge to a good
    solution.

    Perhaps the solution could be posed in a different fashion that would
    avoid the problems encountered. Unfortuantly I do not have much
    experience of this and would appreciate any suggestions or
    recommendations, any ideas?

    Many thanks!
    Scott
     
    Scott Page, Jan 14, 2005
    #1
    1. Advertisements

  2. Scott Page

    Randy Poe Guest

    You didn't square the 5, so this sets sqrt(5) as
    a lower bound.

    There's a lot of symmetry here. Given a solution
    X, then X([3 2 1 4]), X([1 4 3 2]), X([3 4 1 2]),
    X([2 1 4 3]), X([4 1 2 3]), and X([4 3 2 1]) are
    all solutions as well.

    (I can interchange 1<->3, 2<->4, or the pair
    1,3 <-> 2,4).

    So I wonder if some of your many solutions are
    just rearrangements of other ones.

    - Randy
     
    Randy Poe, Jan 14, 2005
    #2
    1. Advertisements

  3. The objective captures that the differences between the
    variables have to be as large as possible, so the
    constraint, which requires that these same differences
    be > 5 looks redundant.

    I'd try minimizing your F subject to the bounds only.
    This simpler problem is quadratic; try the function
    quadprog instead of fmincon.

    -marcelo
     
    Marcelo Marazzi, Jan 14, 2005
    #3
  4. Hmmmm, now I realize that I must be missing something.

    Isn't the problem of maximizing the (magnitude of the) differences
    between x(1) and x(3), and between x(2) and x(4), inside the bounds
    LB = [0 0 0 0] and
    UB = [1000 1000 1000 1000] trivially solved by either

    x(1) = 0, x(3) = 1000
    x(2) = 0, x(4) = 1000

    or

    x(1) = 1000, x(3) = 0
    x(2) = 1000, x(4) = 0

    -marcelo
     
    Marcelo Marazzi, Jan 15, 2005
    #4
  5. this is a convex maximization problem on a disconnected domain
    and hence has several solutions, the global solutions obviously being
    (0,1000,0,1000), (0,1000,1000,0), (1000,0,0,1000), (1000,0,1000,0).
    maybe fmincon comes into trouble if you start at (0,0,0,0)
    since there all gradients are zero and the first order Lagrangian
    condition is satisfied there.
    you never should formulate some abs(x-y)>=c as 0>=c-(x-y)^2
    because this obscures the structure of the feasible set and introduces
    points at which the Jacobian becomes singular
    hth
    peter
     
    Peter Spellucci, Jan 17, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.