Scaling dependence using equilibrate function

조회 수: 11 (최근 30일)
Nicholas
Nicholas 2024년 5월 24일
편집: praguna manvi 2024년 8월 8일
I want to use the function equilibrate, but I don't understand the following written in Rescaling to Solve a Linear System.
"equilibrate is most useful when the scales of the b and x vectors in the original system x = A\b are irrelevant. However, if the scales of b and x are relevant, then using equilibrate to rescale A only for the linear system solve is not recommended. The obtained solution does not generally yield a small residual for the original system, even if expressed using the original basis vectors."
Could someone explain the meaning of this with an example?
  댓글 수: 3
Nicholas
Nicholas 2024년 8월 7일
Thanks for the explanation!
So with this in mind, when would we have a system of equations to solve where the scale is irrelevant? Maybe I have a hard time thinking about this because I come from an engineering background where units are almost always included.
Umar
Umar 2024년 8월 8일
Hi @Nicholas,
That is a very good question. Let me consider an example where you create a matrix A with varying scales in its diagonal elements. By solving the original system x = A\b and then equilibrating matrix A using the equilibrate function, you can compare the solutions x and xeq to observe the impact of rescaling on the linear system's solution elucidating the implications of rescaling when the scales of b and x are relevant. Please bear in mind that rescaling in linear systems, as mentioned in the context of equilibration, becomes crucial when the scales of the vectors b and x in the original system x = A\b are insignificant. Hope this helps.

댓글을 달려면 로그인하십시오.

답변 (1개)

praguna manvi
praguna manvi 2024년 8월 7일
편집: praguna manvi 2024년 8월 8일
Equilibration is a technique used to rescale the matrix A to improve numerical stability and conditioning while solving a Linear system. However, if the scales of b and x are important (i.e., they have physical or meaningful units that must be preserved), then rescaling (A) alone can lead to inaccurate results. This is because the rescaled system may not yield a solution that fits well with the original scales of b and x.
Below is an example demonstrating how the residuals can increase for a larger values of b using “equilibration”:
n = 10; % Size of the matrix
A = diag(linspace(1e-5, 1e5, n)); % Diagonal matrix with values ranging from 1e-5 to 1e5
b = linspace(1e7, 1e15, n)'; % Vector with values ranging from 1e7 to 1e15
% Use the equilibrate function to get P, R, and C
[P, R, C] = equilibrate(A);
% Rescale the matrix A and vector b
A_eq = R * P * A * C;
b_eq = R * P * b;
% Solve the rescaled system
x_eq = A_eq \ b_eq;
% Transform the solution back to the original scale
x_original_scale = C * x_eq;
% Compute the residual
residual = norm(A * x_original_scale - b);
x = A \ b;
disp("Residual Without equilibrate: " + norm(A * x - b))
Residual Without equilibrate: 0.0625
disp("Residual With equilibrate: " + residual);
Residual With equilibrate: 0.28641

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by