octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63286] [octave forge] (optim) fmincon fails f


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #63286] [octave forge] (optim) fmincon fails for Rosenbrock example
Date: Sat, 29 Oct 2022 08:22:54 -0400 (EDT)

Update of bug #63286 (project octave):

                  Status:               Need Info => Confirmed              
                 Release:                   7.1.0 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: [octave forge]  (optim) fmincon error with anonymous
function  => [octave forge]  (optim) fmincon fails for Rosenbrock example

    _______________________________________________________

Follow-up Comment #8:

I am getting completely bizarre results for the Rosenbrock function, so I'm
marking this as Confirmed. Also retitling it since it is unrelated to
anonymous functions. (I got the same results when I created a standalone fun.m
with the same expression as the anonymous function.)

This is all with Octave 8 (hg id ee03da4812fd), optim 1.6.2, statistics 1.5.0,
and struct 1.0.18.

Test:


clear all
fun = @(x) 100*(x(2) - x(1)^2) + (1 - x(1))^2;
A = [1 2];
b = 1;
x0 = [1 0]';
x = fmincon (fun, x0, A, b)


This gives the result:

x =
   1.457337448511223e+17
  -7.286687242556115e+16


Changing x0 to [-1 0]' changes the output to:

x =
  -3.19965837099897e+152
  -2.654287402237436e+151


Changing x0 to the example's value of [-1 2]' gives the error as described by
the OP:

error: Initial parameters violate constraints.
error: called from
    __lm_feasible__ at line 92 column 5
    fmincon at line 456 column 24


Regarding the output causing an error for the OP, that only causes a problem
for me if x0, LB and UB are row vectors, but if they are passed as column
vectors then it works properly, so that does not look like a bug:


>> clear all; fun = @(x) 100*(x(2) - x(1)^2) + (1 - x(1))^2; [x,fval,cvg,outp]
= fmincon (fun, [0 0]', [],[], [],[], [0 0]', [1 1]')
x =
                       1
                       0

fval =             -100
cvg =                2
outp =
  scalar structure containing the fields:
    user_interaction =
      scalar structure containing the fields:
        stop = [](0x1)
        info = {}(0x1)
    niter =                2
    nobjf =                2
    constrviolation =                0




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63286>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]