Matrix numeric inversion, very bad conditioned
15 次查看(过去 30 天)
显示 更早的评论
I have a matrix
A= [-1.14420182157714e-05 3.97106112979063e-09 1.71528761347565e-09 3304.87922280846 -6.43946234919730;
3.97106112979063e-09 -7.42484390057452e-13 -5.95484638418163e-13 -0.618994914206821 5.75841022133480e-05;
1.71528761347565e-09 -5.95484638418163e-13 -2.57140914558130e-13 -0.495586332063353 0.000965957682109416;
3304.87922280846 -0.618994914206821 -0.495586332063353 -516040787150.579 51574737.9623166;
-6.43946234919730 5.75841022133480e-05 0.000965957682109416 51574737.9623166 3814318.88267676];
and i want to calculate the inverse matrix. This matrix is very bad contitioned.
Normal inv oder pinv function doesnt give a stable solution. Which functions can use?
Thank you!
0 个评论
回答(2 个)
Bhanu Prakash
2023-10-10
Hi Martin,
I understand that you want to calculate the inverse of the matrix ‘A’.
For a square matrix to be invertible, it should be a full row rank that means the rank of the matrix is equal to the size of the matrix.
But the rank of the given matrix ‘A’ is 2, which is not equal to its size (8).
>> rank(A)
ans =
2
To get the inverse of the matrix, which corresponds to a manual calculation, you can use the ‘vpa’ function from the Symbolic Math Toolbox.
For more information on the above-mentioned functions, kindly refer to the following documentation:
For ‘vpa’ function:
For ‘rank’ function:
3 个评论
Torsten
2023-10-10
I guess that your model parameters depend on each other.
In the simplest case, imagine you want to determine two parameters a and b to fit a function of the form
y = (a+b)*x
Now this is a model with two parameters, but you can fit only one, namely (a+b).
So the model can be reduced to
y = c*x
with only one parameter c to be determined.
If you compute the Jacobian of the "overdetermined" model in a and b, you will see that it is singular.
Askic V
2023-10-10
I would also investigate if I can use SVD.
Please have a look at this material:
Walter Roberson
2023-10-10
Your array is sensitive enough that it matters that your text entries do not represent the full double precision values stored in the variables. When you use format long g to display a variable, it displays 15 significant digits, not the 16 (sometimes 17!) needed to fully resolve a decimal number to binary. For example the decimal value -0.495586332063353 (row 4 column 3) is displayed the same for -0.495586332063353 .* (1+(-4:4)*eps)
format long g
A= [-1.14420182157714e-05 3.97106112979063e-09 1.71528761347565e-09 3304.87922280846 -6.43946234919730;
3.97106112979063e-09 -7.42484390057452e-13 -5.95484638418163e-13 -0.618994914206821 5.75841022133480e-05;
1.71528761347565e-09 -5.95484638418163e-13 -2.57140914558130e-13 -0.495586332063353 0.000965957682109416;
3304.87922280846 -0.618994914206821 -0.495586332063353 -516040787150.579 51574737.9623166;
-6.43946234919730 5.75841022133480e-05 0.000965957682109416 51574737.9623166 3814318.88267676];
Ainv = inv(sym(A))
Ainvd = double(Ainv)
Ainv * A
Ainvd * A
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!