bugGNU Octave - Bugs: bug #38875, strange errors using sqp

 
 

bug #38875: strange errors using sqp

Submitted by:  Urs Hackstein <uhackstein>
Submitted on:  Fri 03 May 2013 10:53:49 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 3.6.4Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 10 Nov 2013 10:05:44 PM UTC, comment #4:

Here is a snippet that reproduces the _qp_ error:

(file #29590)

Julien Bect <jbect>
Sun 10 Nov 2013 09:50:53 PM UTC, comment #3:

Mea culpa: this is not the same as bug #32717.

After applying the patch proposed here:

https://savannah.gnu.org/bugs/index.php?40536

the error that was originally described in this bug report re-appears. It seems to be a problem in _qp_.

Julien Bect <jbect>
Fri 08 Nov 2013 09:15:07 PM UTC, comment #2:

The same problem (or so it seems) is discussed here:

https://savannah.gnu.org/bugs/?32717

Julien Bect <jbect>
Fri 08 Nov 2013 09:08:13 PM UTC, comment #1:

The proposed example still fails in Octave 3.7.7+ (3851e5fde76d), but the error message has changed:

Julien Bect <jbect>
Fri 03 May 2013 10:53:49 AM UTC, original submission:

Hello,

I wrote a program grenzlinietest2.m which uses sqp and produces strange errors.

If I use octave version 3.2.4, everything works fine. After we updated to version 3.6.4 and installed the package optim, we received the following error

warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
warning: sqp: QP subproblem failed to converge in 200 iterations
error: _qp_: operator *: nonconformant arguments (op1 is 6x6, op2 is 7x1)
error: called from:
error: /usr/local/share/octave/3.6.4/m/optimization/qp.m at line 393, column 26
error: /usr/local/share/octave/3.6.4/m/optimization/sqp.m at line 414, column 32
error: /home/hackstein/Dominantepole5/minimize6test2.m at line 9, column 5
error: /home/hackstein/Dominantepole5/verschiebungize3test2.m at line 8, column 3
error: /home/hackstein/Dominantepole5/grenzlinietest2.m at line 10, column 7

For the functions, see the attachment. As I can attach only four functions, I post three of them here:

function erg=funp6test2(x,p)
erg=(p(1)-real(dominant2(roots(polytest2(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2+(p(2)-imag(dominant2(roots(polytest2(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2
endfunction

function mini=minimize6test2(b)
funp6test2wrap = @(x)funp6test2(x,[real(b),imag(b)])
y0 = 2*ones(7,1);
lbound = [0.5,0.5,0.5,0.5,0.5,0.5,5]';
ubound = [20,20,20,20,20,20,200]';
mini=sqp (y0,funp6test2wrap,[],[],lbound,ubound)
endfunction

function poly=polytest2(la, lb, lc, Ia, Ib, Ic, RC)
poly=[1 la+lbRC45la.^7 lb+lc-RC-3IbIc IaRC+Ib+87RC IbIc.^3+Ic/(Ia+Ic-la) RC-IaIalc laRCIb+Ia*RC koeff0(la,lb,lc,Ia,Ib,Ic,RC)]
endfunction

Minimize6test2.m minimizes the function
(real(b)-real(dominant2(roots(polytest2(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2+(imag(b)-imag(dominant2(roots(polytest2(x(1),x(2),x(3),x(4),x(5),x(6),x(7)))))).^2

Here b is a complex number and polytest2(x(1),x(2),x(3),x(4),x(5),x(6),x(7)) is a polynomial of degree 7, parametrized by the seven real parameters x(1),x(2),x(3),x(4),x(5),x(6) and x(7).
dominant2 selects the root of the polynomial with the biggest real part. The term should be minimized with respect to 0.5<=x(1),x(2),x(3),x(4),x(5),x(6)<=20 and 5<=x(7)<=200.

The error above is produced by the function call grenzlinietest2(2,4,6,1,2,6,50). Note that more strange errors occur if one takes a polynomial more complicated than polytest2. See the discussion on help-octave for more details.
Thanks a lot in advance!

Urs Hackstein <uhackstein>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #29590:  qp_data.mat added by jbect (2kB - application/octet-stream)
file #28007:  polytest2.m added by uhackstein (201B - text/x-matlab - Here are the three other functions)
file #28008:  funp6test2.m added by uhackstein (204B - text/x-matlab - Here are the three other functions)
file #28009:  minimize6test2.m added by uhackstein (308B - text/x-matlab - Here are the three other functions)
file #28003:  grenzlinietest2.m added by uhackstein (636B - text/x-matlab)
file #28004:  verschiebungize3test2.m added by uhackstein (2kB - text/x-matlab)
file #28005:  dominant2.m added by uhackstein (2kB - text/x-matlab)
file #28006:  koeff0.m added by uhackstein (1kB - text/x-matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jbect (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by uhackstein (Submitted the item)
  • -unavailable- added by uhackstein
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 10 Nov 2013 10:05:44 PM UTCjbectAttached File-=>Added qp_data.mat, #29590
    Mon 28 Oct 2013 02:14:53 AM UTCmtmillerCategoryNone=>Octave Function
    Fri 03 May 2013 10:57:55 AM UTCuhacksteinAttached File-=>Added polytest2.m, #28007
      Attached File-=>Added funp6test2.m, #28008
      Attached File-=>Added minimize6test2.m, #28009
    Fri 03 May 2013 10:53:49 AM UTCuhacksteinAttached File-=>Added grenzlinietest2.m, #28003
      Attached File-=>Added verschiebungize3test2.m, #28004
      Attached File-=>Added dominant2.m, #28005
      Attached File-=>Added koeff0.m, #28006
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup