Redian新闻
>
问一个MATLAB数值精确度的问题
avatar
问一个MATLAB数值精确度的问题# Computation - 科学计算
j*n
1
用MATLAB解一个较大的linear system, 有大概1000个未知数吧, 也就是要求一个size
1000x1000 的matrix的inverse.
觉得未知数的解不很不精确, 不过不觉得是matrix size大的原因, 而是因为未知数本
身的解的数值太大, 大约有10^16 到 10^17 那么大. 请问有什么方法可以知道未知数
的解是不是因为太大而不够精确? MATLAB最多能handle多大的解?
谢谢!
avatar
h*z
2
Your matrix is probably poorly conditioned. Use cond(matrix) to check the
condition number of your matrix.

size

【在 j**n 的大作中提到】
: 用MATLAB解一个较大的linear system, 有大概1000个未知数吧, 也就是要求一个size
: 1000x1000 的matrix的inverse.
: 觉得未知数的解不很不精确, 不过不觉得是matrix size大的原因, 而是因为未知数本
: 身的解的数值太大, 大约有10^16 到 10^17 那么大. 请问有什么方法可以知道未知数
: 的解是不是因为太大而不够精确? MATLAB最多能handle多大的解?
: 谢谢!

avatar
j*n
3
thanks for your reply, and what does it mean to say that a matrix is poorly
conditioned?

【在 h***z 的大作中提到】
: Your matrix is probably poorly conditioned. Use cond(matrix) to check the
: condition number of your matrix.
:
: size

avatar
l*i
4
That means your matrix will be hard to invert. Even if you can do it, it's g
onna be inaccurate.

poorly

【在 j**n 的大作中提到】
: thanks for your reply, and what does it mean to say that a matrix is poorly
: conditioned?

avatar
j*n
5
Thanks.
And I am using sparse matrix, so am using condest(X) instead, and it returns
values as large as 4.6328e+020, what does this number exactly tell me? I
mean, how large is too large for X to be inverted accurately?

g

【在 l*****i 的大作中提到】
: That means your matrix will be hard to invert. Even if you can do it, it's g
: onna be inaccurate.
:
: poorly

avatar
c*h
6
this condition number is definitely too large.
to solve your system, i suggest you look at a number of sparse solvers,
such as pcg, bicgstab, gmres etc, and see which one suits your matrix.
also, do try some pre-conditioners to lower down the condition number.

returns

【在 j**n 的大作中提到】
: Thanks.
: And I am using sparse matrix, so am using condest(X) instead, and it returns
: values as large as 4.6328e+020, what does this number exactly tell me? I
: mean, how large is too large for X to be inverted accurately?
:
: g

avatar
j*n
7
Can you give more details? what are the pre-conditioners for? how to use
them? any useful link you'd suggest that gives a good explanation of it?
thanks.

【在 c*******h 的大作中提到】
: this condition number is definitely too large.
: to solve your system, i suggest you look at a number of sparse solvers,
: such as pcg, bicgstab, gmres etc, and see which one suits your matrix.
: also, do try some pre-conditioners to lower down the condition number.
:
: returns

avatar
t*s
8
are you sure your matrix is full rank and invertable?
and in any case, don't do inverse. solve the system directly.

returns

【在 j**n 的大作中提到】
: Thanks.
: And I am using sparse matrix, so am using condest(X) instead, and it returns
: values as large as 4.6328e+020, what does this number exactly tell me? I
: mean, how large is too large for X to be inverted accurately?
:
: g

avatar
c*h
9
what you are in front of is an entire area of sparse matrix computation.
unless you have taken a course on it, it is unlikely that you understand
the details from just a few words from me.
in short, what i was proposing to you are a few iterative algorithms to
solve your sparse linear system. you can use the `help' command in matlab
to read the instructions on how to use these algorithms, to get a feel
which algorithm is suitable for your matrix, and to get to know (and
try) more algorithms from

【在 j**n 的大作中提到】
: Can you give more details? what are the pre-conditioners for? how to use
: them? any useful link you'd suggest that gives a good explanation of it?
: thanks.

avatar
j*n
10
Yes, I am sure the matrix of of full rank, and I was solving it direct by
X = SPARSE \ B

【在 t***s 的大作中提到】
: are you sure your matrix is full rank and invertable?
: and in any case, don't do inverse. solve the system directly.
:
: returns

avatar
p*h
11
选择合理的物理单位重建矩阵,使未知数落在合理的区间

size

【在 j**n 的大作中提到】
: 用MATLAB解一个较大的linear system, 有大概1000个未知数吧, 也就是要求一个size
: 1000x1000 的matrix的inverse.
: 觉得未知数的解不很不精确, 不过不觉得是matrix size大的原因, 而是因为未知数本
: 身的解的数值太大, 大约有10^16 到 10^17 那么大. 请问有什么方法可以知道未知数
: 的解是不是因为太大而不够精确? MATLAB最多能handle多大的解?
: 谢谢!

avatar
h*z
12
A matrix M is poorly conditioned if a small change in vector v can lead to a
large change in inv(M)*v.

poorly

【在 j**n 的大作中提到】
: thanks for your reply, and what does it mean to say that a matrix is poorly
: conditioned?

avatar
t*s
13
but a condition # in the order of 10^20 indicates it's not full rank,
especially in the numerical sense, considering your machine epsilon
is probably 2.22e-16.

【在 j**n 的大作中提到】
: Yes, I am sure the matrix of of full rank, and I was solving it direct by
: X = SPARSE \ B

avatar
h*z
14
With a condition number of 4.6328e+020, your matrix might still technically
be full rank, but for all practical purposes, it is essentially rank-
deficient. For example, consider the matrix
A = [ 1e-20 0; 0 1 ]
A is technically full rank with a condition number of 1e+20, but in
practice, it really is very similar to the rank deficient matrix [ 0 0;
0 1]. For example, consider the vectors
u = [ 0 , 1 ]' and v = [ 1e-10 , 1 ]'
u and v are very similar and should

【在 j**n 的大作中提到】
: Yes, I am sure the matrix of of full rank, and I was solving it direct by
: X = SPARSE \ B

avatar
m*2
15
As far as I knew, Matlab can't handle 1000 by 1000 problem: some are memory
issue some are "never think about it". You may knew that Matlab steals
Fortran Linpack with its own modifications. Go find the orginal Fortran code
for the high dimension problem, you may get better answers.
avatar
m*2
16
Or try SVD based algorithm. Matlab has subroutines for it.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。