Balancing linear systems
Marco Caliari
marco.caliari at univr.it
Tue Oct 21 07:55:53 CDT 2008
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
More information about the Help-octave
mailing list