Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Constraint System of Linear Eq.

2 views
Skip to first unread message

cgs Spindler

unread,
Feb 9, 2010, 4:09:19 PM2/9/10
to
Hi folkes,

I've got to solve the linear system AX=B with all three A, X and B being matrices. As constraints, there are equations x_ij + x_kl = 1 for some of the elements of X. Altogether, the system is overdetermined (i.e., columns of A are time series with ~180 time steps, rows of A are 24 parameters, to be mapped down at 4 parameters in B).

Might I get any hint how to enter this in MatLab? I searched through the Optimization Toolbox tutorial but could not find really what I want.

Thanks a lot for helping!

Matt J

unread,
Feb 9, 2010, 5:02:02 PM2/9/10
to
"cgs Spindler" <christian...@gmx.de> wrote in message <hksitv$ac8$1...@fred.mathworks.com>...

> Hi folkes,
>
> I've got to solve the linear system AX=B with all three A, X and B being matrices. As constraints, there are equations x_ij + x_kl = 1 for some of the elements of X. Altogether, the system is overdetermined (i.e., columns of A are time series with ~180 time steps, rows of A are 24 parameters, to be mapped down at 4 parameters in B).
================


Why not use quadprog() to do find a constrained least squares solution?

John D'Errico

unread,
Feb 9, 2010, 5:53:04 PM2/9/10
to
"Matt J " <mattja...@THISieee.spam> wrote in message <hksm0q$rca$1...@fred.mathworks.com>...

lsqlin is far easier to use in this sense, since it takes
the problem in the form of A*x = b, without needing
to reformulate it into the quadprog form.

As far as entering it into matlab, you need to formulate
the problem in the form of

A*X = b

where X and B are (column) vectors. This is the standard
form that lsqlin will require.

John

John D'Errico

unread,
Feb 9, 2010, 6:18:05 PM2/9/10
to
"John D'Errico" <wood...@rochester.rr.com> wrote in message <hksp0g$7j7$1...@fred.mathworks.com>...

Let me expand on this a bit. The OP will need to
convert A into a new matrix (sparse!!!!) as well as
form a constraint system that is sparse.

Kron will aid in this task as I recall.

John

Bruno Luong

unread,
Feb 10, 2010, 3:11:04 AM2/10/10
to
"cgs Spindler" <christian...@gmx.de> wrote in message <hksitv$ac8$1...@fred.mathworks.com>...

Extend your system as block diagonal (put X & B as long vectosr, repeating A on diagonal using KRON or BLKDIAGS for example). The constraints can be formulated as linear. If you have QUADPROG use it, otherwise written the new system in the basis of the orthogonal of the constraints to make the new system unconstrained, then solve using "\".

Bruno

cgs Spindler

unread,
Feb 10, 2010, 5:30:05 AM2/10/10
to
Great,

this should be valuable hints for me to get me along. Thanks all for the fast reply, have a nice time!

Christian

John D'Errico

unread,
Feb 10, 2010, 6:12:03 AM2/10/10
to
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <hktpmo$7o9$1...@fred.mathworks.com>...

I'll still argue that the use of quadprog here is,
while not technically incorrect, it is numerically
improper.

Effectively, in order to use quadprog, one must
form A'*A. You will minimize a quadratic form,
after all. So you are squaring the condition
number of the problem, just as if you had formed
the normal equations.

Use lsqlin instead to avoid that operation. Only
use quadprog when your problem is already in
the nominal form that it is designed for.

John

0 new messages