bugGNU Octave - Bugs: bug #55292, qp function error for valid inputs

 
 

bug #55292: qp function error for valid inputs

Submitter:  None
Submitted:  Wed 26 Dec 2018 10:45:42 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Need Info Assigned to:  None
Originator Name:  Daniel Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 4.4.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 27 Dec 2018 11:42:36 PM UTC, comment #10: 

Regarding comment #8.  What makes you sure the error is related to the qp command?  Can you dump Octaves output including all commands you typed in to get this error, like Rik and I did in comment #3 and comment #4.  This will help us a lot to reproduce your error.

Kai Torben Ohlhus <siko1056>
Group Member
Thu 27 Dec 2018 09:59:06 PM UTC, comment #9: 

I'm guessing you probably just want to transpose y so that instead of being 120x1 it is 1x120.  You can multiply a 1x120 vector with a 120x120 matrix.  But I'll leave it to you to debug the code and provide a working example.

Rik <rik5>
Group administrator
Thu 27 Dec 2018 09:58:25 PM UTC, comment #8: 

By the way! You got the error: "ERAOKIDMPC: operator *: nonconformant arguments (op1 is 120x1, op2 is 120x120)"

And I got the error
"warning: operator *: nonconformant arguments (op1 is 18x18, op2 is 19x1)" "

That error comes from the qp-command.

Anonymous
Thu 27 Dec 2018 09:52:39 PM UTC, comment #7: 

Rik.

Hmmm...it must be the pinv command then? pinv uses the least square method via the SVD I think.

Can I use another than pinv? to solve b = A*x where A is non inverted.

Anonymous
Thu 27 Dec 2018 09:27:40 PM UTC, comment #6: 

Yes, line 5 of ERAOKIDMPC.m when called by testERAOKIDMPC.

Rik <rik5>
Group administrator
Thu 27 Dec 2018 09:16:13 PM UTC, comment #5: 

It is the codeline that produce the error?

g = y*pinv(triu(toeplitz(u)));

Anonymous
Thu 27 Dec 2018 09:06:23 PM UTC, comment #4: 

Confirmed.  The test script has a problem before qp is even reached.


octave:14> debug_on_error (1)
octave:15> testERAOKIDMPC
error: ERAOKIDMPC: operator *: nonconformant arguments (op1 is 120x1, op2 is 120x120)
error: called from
    ERAOKIDMPC at line 5 column 5
    testERAOKIDMPC at line 26 column 59
stopped in /home/rik/wip/Projects_Mine/octave-stable/ERAOKIDMPC.m at line 5
5:   g = y*pinv(triu(toeplitz(u)));
debug> size (y)
ans =

   120     1



Rik <rik5>
Group administrator
Thu 27 Dec 2018 08:45:37 PM UTC, comment #3: 

When running the tests of file #45750 I get:


>> pkg load control
>> testERAOKIDMPC
error: ERAOKIDMPC: operator *: nonconformant arguments (op1 is 120x1, op
2 is 120x120)
error: called from
    ERAOKIDMPC at line 5 column 5
    testERAOKIDMPC at line 26 column


The error is not related to qp yet.

Kai Torben Ohlhus <siko1056>
Group Member
Thu 27 Dec 2018 07:14:49 PM UTC, comment #2: 

Hi Rik!

I uploaded two .m files. Just run "testERAOKIDMPC.m" The error can be found at "ERAOKIDMPC.m" file where the qp command is.

Anonymous
Thu 27 Dec 2018 06:17:51 PM UTC, comment #1: 

You'll need to supply the matrices you used in order to check anything.  You can save them to a file using 'save' and then upload that.

Also, try using


debug_on_error (1)


before running your qp optimization.  This will drop you in to the debugger as soon as you encounter an error and you can poke around to find out why there is a problem.

If you want to solve systems of equations quickly it helps to start with a guess for X0 which is close to the original solution.  Since you're doing adaptive control it's probable that the new solution is close to the previous solution.  Therefore, you would be better off using the old solution, instead of '[]', as the first argument to qp.

Rik <rik5>
Group administrator
Wed 26 Dec 2018 10:45:42 PM UTC, original submission:  

Hello!

When I use qp-command in octave, I got this error when I'm using to large matricies:

"ans =

   19   19

ans =

   19    1

ans =

   19    1

ans =

   19    1

warning: operator *: nonconformant arguments (op1 is 18x18, op2 is 19x1)"

I'm using this code:

    size(H)
    size(q)
    size(LB)
    size(UB)
    x = qp([], H, q, [], [], LB, UB)

It's like the H matrix loses one row and one column. Why? Do I compute to fast? I trying to compute as fast as possible because I want to do adaptive control for real time controllers.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45750:  Adaptive Constrained MPC.zip added by None (2KiB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-27 None Attached File- Added Adaptive Constrained MPC.zip, #45750
    2018-12-27 rik5 Summary qp function error for valid inputs
    2018-12-27 rik5 CategoryNone Octave Function
        StatusNone Need Info
        SummaryQuadratic programming Octave: Cannot have large matrices

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code