help-octave
[Top][All Lists]
Advanced

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

Balancing linear systems


From: Marco Caliari
Subject: Balancing linear systems
Date: Tue, 21 Oct 2008 14:55:53 +0200 (CEST)

Dear all,

I would like to discuss the following example. Consider the (badly scaled) matrix A given by

n = 10;
B = rand(n);
d = 10.^linspace(-14,4,n)';
A = diag(d)*B;

and the right hand side b

b = d.*(B*ones(n,1));

It is clear that the exact solution of Ax=b is ones(n,1). If you try

x = A\b

you get the following warning

warning: matrix singular to machine precision, rcond = 8.1733e-20
warning: attempting to find minimum norm solution

(which is fine to me, the matrix A is really ill-conditioned). On the other hand, if you balance your system

d1 = max(A,[],2);
A = diag(1./d1)*A;
b = b./d1;

then x = A\b gives you a good solution. Is there any drawback in balancing, in any case, a linear system? I can't imagine a counter-example.

Best regards,

Marco


reply via email to

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