|
"Ziwen " <yzwcroco@gmai.com> wrote in message
<g4n8el$edn$1@fred.mathworks.com>...
> thanks for your reply. I really have a lot of things to
> learn.
>
> You mentioned 'Since rank(A,0) = 675, A*X = 0 has no exact
> solution'. Here, I just got rank(A,8.6E4)=674 and rank
> (A,8.5E4)=675. Then what should I do next? It seems there
> is no parameter for null to change the tolerance, and rank
> (rref(A,9E4) is still 675, while the result of rref(A,9E4)
> is a identity matrix
>
> In fact, the only thing I want is to get a rational X as
> the numerical wavefunction.
>
>
>
> Greg Heath <heath@alumni.brown.edu> wrote in message
> <56856cbd-0f9f-47e2-9d72-
> ea95cbd67114@b1g2000hsg.googlegroups.com>...
> > On Jul 5, 1:19 am, "Ziwen " <yzwcr...@gmai.com> wrote:
> > > Hi, is there anyone who can give me some advices?
> > >
> > > I met a problem when solving linear equations with the
> form
> > > of A*X=0, in which A is a 675*675 matrix with a very
> high
> > > cond(A)=9.5694e+016. Then it seems that I can not use
> those
> > > standard methods and commands to solve this matrix.
> >
> > ...solve this equation.
> >
> > > >>size(A)
> > >
> > > ans =
> > > 675 675
> > > >> rank(A)
> > >
> > > ans =
> > > 674
> > > >> rank(rref(A))
> > >
> > > ans =
> > > 675
> > > >> cond(A)
> > >
> > > ans =
> > > 9.5694e+016
> > >
> > > When ever I used 'rref' or 'null' to deal with this
> matrix,
> > > the rank of this matrix will change to 675.
> >
> > eps
> > svd(A)
> > norm(A)
> > cond(A)
> > rank(A) % = 674
> > rank(A,0) % = 675
> >
> > doc rank
> >
> > > Is there any method to solve this problem? Or is there
> any
> > > other commands or methods that can be used to deal with
> > > this problem perfectly?
> > >
> > > thanks for anyone's help.
> >
> > Why do you expect a computer to give you perfect answers
> > when it cannot perfectly represent floating point numbers
> > that are not integer powers of 2?
> >
> > Since rank(A,0) = 675, A*X = 0 has no exact solution.
> >
> > However, with cond(A) = 9.5694e+016, You can find a
> reasonable
> > approximation that minimizes norm(A*X)/norm(X) via
> >
> > [E L] = eig(A)
> >
> > Review the following
> >
> > doc eps
> > doc svd
> > doc norm
> > doc cond
> > doc rank
> > doc eig
> >
> > Hope this helps.
> >
> > Greg
>
Hey, You are trying to solve an eigen value problem. Your
wave equation is probably of the type: H*f=lam*f, where H is
a differential operator, isn't it? AX=0,has the trivial
solution X=0.
You should use:
[V,D]=eig(A);
[lam,ix]=sort(diag(D));
V=V(:,ix);%sort eigen vectors to match lam
n=1; %first eigen value
lambda=lam(n)
X=V(:,n)
where you have not taken A=H-I*lam, but only H, because you
don't know the eigen value lam before you have solved the
full problem! That could be the reason why you get a weird
rank, because you put in a wrong eigen value.
|