Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 00:24:06

Message: 1 of 13

Hello,
I am trying to work out the determinant of a 20 by 20 matrix in Matlab. When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE EXPONENTIALS so I could theoretically take the log before fining the det, but I dont wanna do that.

Also, when I ask for the EIG(M), which is the eigenvectors, the precision I obtain from Matlab is close to abysmal, as I need to find a ridiculous number of eignvectors by averaging over entries of M, then adding such vectors. The trouble is, unless precision is high, errors add up exponentially fast in my problem.

CAN ANYONE HELP PLEASE?

I mean I have formulated things as simply as I possibly coul so please help.

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Roger Stafford

Date: 14 Apr, 2011 04:17:07

Message: 2 of 13

"Leo Kay" <anousleshommes@hotmail.com> wrote in message <io5er6$cos$1@fred.mathworks.com>...
> Hello,
> I am trying to work out the determinant of a 20 by 20 matrix in Matlab. When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE EXPONENTIALS so I could theoretically take the log before fining the det, but I dont wanna do that.
>
> Also, when I ask for the EIG(M), which is the eigenvectors, the precision I obtain from Matlab is close to abysmal, as I need to find a ridiculous number of eignvectors by averaging over entries of M, then adding such vectors. The trouble is, unless precision is high, errors add up exponentially fast in my problem.
>
> CAN ANYONE HELP PLEASE?
>
> I mean I have formulated things as simply as I possibly coul so please help.
- - - - - - - - - - -
  Your description of your problem does not make much sense to me. You mention that you could take the logarithm of the matrix entries before finding its determinant (but "dont wanna",) but this is surely not how to find a determinant. The determinant of element logarithms is not equal to the logarithm of the determinant, just as the logarithm of a product is not equal to the product of the logarithms of its factors.

  You state that your 20 x 20 matrix has a ridiculous number of eigenvectors. Is 20 a ridiculous number? That is the largest number it can have. If M has a full set of 20 independent eigenvectors, then its determinant will be equal to the product of its eigenvalues. Your statement that "The matrix has lots of 0s" would lead one to suspect that it might not have 20 independent eigenvectors, and it could well have a determinant value of zero.

Roger Stafford

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 10:02:05

Message: 3 of 13

"Roger Stafford" wrote in message <io5sg3$gmj$1@fred.mathworks.com>...
> "Leo Kay" <anousleshommes@hotmail.com> wrote in message <io5er6$cos$1@fred.mathworks.com>...
> > Hello,
> > I am trying to work out the determinant of a 20 by 20 matrix in Matlab. When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE EXPONENTIALS so I could theoretically take the log before fining the det, but I dont wanna do that.
> >
> > Also, when I ask for the EIG(M), which is the eigenvectors, the precision I obtain from Matlab is close to abysmal, as I need to find a ridiculous number of eignvectors by averaging over entries of M, then adding such vectors. The trouble is, unless precision is high, errors add up exponentially fast in my problem.
> >
> > CAN ANYONE HELP PLEASE?
> >
> > I mean I have formulated things as simply as I possibly coul so please help.
> - - - - - - - - - - -
> Your description of your problem does not make much sense to me. You mention that you could take the logarithm of the matrix entries before finding its determinant (but "dont wanna",) but this is surely not how to find a determinant. The determinant of element logarithms is not equal to the logarithm of the determinant, just as the logarithm of a product is not equal to the product of the logarithms of its factors.
>
> You state that your 20 x 20 matrix has a ridiculous number of eigenvectors. Is 20 a ridiculous number? That is the largest number it can have. If M has a full set of 20 independent eigenvectors, then its determinant will be equal to the product of its eigenvalues. Your statement that "The matrix has lots of 0s" would lead one to suspect that it might not have 20 independent eigenvectors, and it could well have a determinant value of zero.
>
> Roger Stafford

WHAT A STUPID AND HIGHLY PATRONIZING REPLY!!!


First off I am looking for the zero eigenvalue.
Secondly, by taking logarithm, I mean diagonalizing, then taking exponential of the log trace. BUT I DONT WANNA DO THAT BECAUSE I HAVE SYMBOLIC ENTRIES!!!

Please, let's not be patronizing, by ridiculous amount of eigenvectors, I meant after averaging (ie, randomize entries, and find a ridicuous amount fof eigenvectors, say 10 000), so I need high precision.

ALSO IF YOU ARE NOT GOING TO HELP, PLEASE DONT REPLY mmkay!!!

Anyways, can anyone tell me why finding the determininant of a 20 y 20 symbolic matrix fails?

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 10:02:05

Message: 4 of 13

"Roger Stafford" wrote in message <io5sg3$gmj$1@fred.mathworks.com>...
> "Leo Kay" <anousleshommes@hotmail.com> wrote in message <io5er6$cos$1@fred.mathworks.com>...
> > Hello,
> > I am trying to work out the determinant of a 20 by 20 matrix in Matlab. When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE EXPONENTIALS so I could theoretically take the log before fining the det, but I dont wanna do that.
> >
> > Also, when I ask for the EIG(M), which is the eigenvectors, the precision I obtain from Matlab is close to abysmal, as I need to find a ridiculous number of eignvectors by averaging over entries of M, then adding such vectors. The trouble is, unless precision is high, errors add up exponentially fast in my problem.
> >
> > CAN ANYONE HELP PLEASE?
> >
> > I mean I have formulated things as simply as I possibly coul so please help.
> - - - - - - - - - - -
> Your description of your problem does not make much sense to me. You mention that you could take the logarithm of the matrix entries before finding its determinant (but "dont wanna",) but this is surely not how to find a determinant. The determinant of element logarithms is not equal to the logarithm of the determinant, just as the logarithm of a product is not equal to the product of the logarithms of its factors.
>
> You state that your 20 x 20 matrix has a ridiculous number of eigenvectors. Is 20 a ridiculous number? That is the largest number it can have. If M has a full set of 20 independent eigenvectors, then its determinant will be equal to the product of its eigenvalues. Your statement that "The matrix has lots of 0s" would lead one to suspect that it might not have 20 independent eigenvectors, and it could well have a determinant value of zero.
>
> Roger Stafford

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Nasser M. Abbasi

Date: 14 Apr, 2011 10:57:59

Message: 5 of 13

On 4/14/2011 3:02 AM, Leo Kay wrote:

>
> Anyways, can anyone tell me why finding the determininant of a 20 y 20 symbolic matrix fails?

May be becuase there is not enough RAM to hold the result?


Running this in Mathematica shows the size of the generated symbolic expression

matrixSize = 6
A=Table[Sin[n m x],{n,matrixSize},{m,matrixSize}];
Det[A]

For matrixSize = 5, number of individual symbolic expressions 1,807 (10^3)
For matrixSize = 6, number of individual symbolic expressions 11,358 (10^4)
For matrixSize = 7, number of individual symbolic expressions 83,065 (10^5)
For matrixSize = 8, number of individual symbolic expressions 666,005 (10^6)
For matrixSize = 9, number of individual symbolic expressions 6,080,591 (10^7)

You see that it is a factor of 2 larger each time.

So, for 20 by 20 symbolic matrix, with very simple symbolic entries,
one will get about 10^18 entries.

Assuming each symbolic expression requires say 100 characters to store,
then this requires 10^20 bytes, or about

            100,000,000,000,000,000,000 bytes

this is about
          
            100,000,000,000 GIGA BYTES memory

or

            100 MILLION TERA BYTES of memory

I heared BestByes has sale now on RAM. May be time to go buy some?

--Nasser

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Nasser M. Abbasi

Date: 14 Apr, 2011 11:03:59

Message: 6 of 13

On 4/14/2011 3:57 AM, Nasser M. Abbasi wrote:
> On 4/14/2011 3:02 AM, Leo Kay wrote:
>
>>
>> Anyways, can anyone tell me why finding the determininant of a 20 y 20 symbolic matrix fails?
>
> May be becuase there is not enough RAM to hold the result?
>
>
> Running this in Mathematica shows the size of the generated symbolic expression
>
> matrixSize = 6
> A=Table[Sin[n m x],{n,matrixSize},{m,matrixSize}];
> Det[A]
>
> For matrixSize = 5, number of individual symbolic expressions 1,807 (10^3)
> For matrixSize = 6, number of individual symbolic expressions 11,358 (10^4)
> For matrixSize = 7, number of individual symbolic expressions 83,065 (10^5)
> For matrixSize = 8, number of individual symbolic expressions 666,005 (10^6)
> For matrixSize = 9, number of individual symbolic expressions 6,080,591 (10^7)
>
> You see that it is a factor of 2 larger each time.
>
> So, for 20 by 20 symbolic matrix, with very simple symbolic entries,
> one will get about 10^18 entries.
>
> Assuming each symbolic expression requires say 100 characters to store,
> then this requires 10^20 bytes, or about
>
> 100,000,000,000,000,000,000 bytes
>
> this is about
>
> 100,000,000,000 GIGA BYTES memory
>
> or
>
> 100 MILLION TERA BYTES of memory

Just to add, I used CountLeaf[] command to count the size
of the generated symbolic determinant. There are other
ways to estimate size of symbolic expressions.

>I heared BestByes has sale now on RAM. May be time to go buy some?

Typo, That should be 'Best Buys', where one can go to buy more RAM if
they want to do symbolic determinant. I called to check, but they only
have 5 tera bytes of RAM in the whole store now. Sales person said
they will not be able to order 100 million tera bytes of RAM without
a manager approval.

--Nasser

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Mark Shore

Date: 14 Apr, 2011 11:09:04

Message: 7 of 13

"Leo Kay" <anousleshommes@hotmail.com> wrote in message <io6gmt$qth$1@fred.mathworks.com>...
>
> ALSO IF YOU ARE NOT GOING TO HELP, PLEASE DONT REPLY mmkay!!!
>

I think you'll find - after a comment like yours - that helpful replies in future will be few and far between.

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 11:28:04

Message: 8 of 13

"Nasser M. Abbasi" <nma@12000.org> wrote in message <io6kb8$8hi$1@speranza.aioe.org>...
> On 4/14/2011 3:57 AM, Nasser M. Abbasi wrote:
> > On 4/14/2011 3:02 AM, Leo Kay wrote:
> >
> >>
> >> Anyways, can anyone tell me why finding the determininant of a 20 y 20 symbolic matrix fails?
> >
> > May be becuase there is not enough RAM to hold the result?
> >
> >
> > Running this in Mathematica shows the size of the generated symbolic expression
> >
> > matrixSize = 6
> > A=Table[Sin[n m x],{n,matrixSize},{m,matrixSize}];
> > Det[A]
> >
> > For matrixSize = 5, number of individual symbolic expressions 1,807 (10^3)
> > For matrixSize = 6, number of individual symbolic expressions 11,358 (10^4)
> > For matrixSize = 7, number of individual symbolic expressions 83,065 (10^5)
> > For matrixSize = 8, number of individual symbolic expressions 666,005 (10^6)
> > For matrixSize = 9, number of individual symbolic expressions 6,080,591 (10^7)
> >
> > You see that it is a factor of 2 larger each time.
> >
> > So, for 20 by 20 symbolic matrix, with very simple symbolic entries,
> > one will get about 10^18 entries.
> >
> > Assuming each symbolic expression requires say 100 characters to store,
> > then this requires 10^20 bytes, or about
> >
> > 100,000,000,000,000,000,000 bytes
> >
> > this is about
> >
> > 100,000,000,000 GIGA BYTES memory
> >
> > or
> >
> > 100 MILLION TERA BYTES of memory
>
> Just to add, I used CountLeaf[] command to count the size
> of the generated symbolic determinant. There are other
> ways to estimate size of symbolic expressions.
>
> >I heared BestByes has sale now on RAM. May be time to go buy some?
>
> Typo, That should be 'Best Buys', where one can go to buy more RAM if
> they want to do symbolic determinant. I called to check, but they only
> have 5 tera bytes of RAM in the whole store now. Sales person said
> they will not be able to order 100 million tera bytes of RAM without
> a manager approval.
>
> --Nasser


Thanks Nasser, I hadn't realised.

How can I get around this problem?

We have some pretty niffty computer farms here on campus (dunno how those are called, I am a mathematical physicist, not a computational scientist), maybe i should use those farms/nodes, whatever they are called?
The model I describe here is very basic, but I want to move on to bigger things, large matrices, it's very problematic I cant have things working for a simple 20 by 20.

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Steven_Lord

Date: 14 Apr, 2011 14:09:50

Message: 9 of 13



"Leo Kay" <anousleshommes@hotmail.com> wrote in message
news:io6gmt$qth$1@fred.mathworks.com...
> "Roger Stafford" wrote in message <io5sg3$gmj$1@fred.mathworks.com>...
>> "Leo Kay" <anousleshommes@hotmail.com> wrote in message
>> <io5er6$cos$1@fred.mathworks.com>...
>> > Hello,
>> > I am trying to work out the determinant of a 20 by 20 matrix in Matlab.
>> > When I run det(M), Matlab simply stalls. I would not have suspected
>> > this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE
>> > EXPONENTIALS so I could theoretically take the log before fining the
>> > det, but I dont wanna do that.
>> >
>> > Also, when I ask for the EIG(M), which is the eigenvectors, the
>> > precision I obtain from Matlab is close to abysmal, as I need to find a
>> > ridiculous number of eignvectors by averaging over entries of M, then
>> > adding such vectors. The trouble is, unless precision is high, errors
>> > add up exponentially fast in my problem.
>> >
>> > CAN ANYONE HELP PLEASE?
>> >
>> > I mean I have formulated things as simply as I possibly coul so please
>> > help.
>> - - - - - - - - - - -
>> Your description of your problem does not make much sense to me. You
>> mention that you could take the logarithm of the matrix entries before
>> finding its determinant (but "dont wanna",) but this is surely not how to
>> find a determinant. The determinant of element logarithms is not equal
>> to the logarithm of the determinant, just as the logarithm of a product
>> is not equal to the product of the logarithms of its factors.
>>
>> You state that your 20 x 20 matrix has a ridiculous number of
>> eigenvectors. Is 20 a ridiculous number? That is the largest number it
>> can have. If M has a full set of 20 independent eigenvectors, then its
>> determinant will be equal to the product of its eigenvalues. Your
>> statement that "The matrix has lots of 0s" would lead one to suspect that
>> it might not have 20 independent eigenvectors, and it could well have a
>> determinant value of zero.
>>
>> Roger Stafford
>
> WHAT A STUPID AND HIGHLY PATRONIZING REPLY!!!

I just reread Roger's comment and it seems to be fine to me. It seems to be
more appropriate to someone who has little to no experience with
determinants, eigenvectors, and eigenvalue computations, but nothing in your
original message indicated to either Roger or I your level of experience.
Perhaps you have a higher level of experience than Roger thought you did and
that's why you thought it patronizing.

> First off I am looking for the zero eigenvalue.

So you're looking for a vector V such that M*V is the zero vector? In that
case, you're not looking for an eigenvalue/eigenvector pair. You're looking
for the null space of the matrix, and in that case you should use the NULL
function instead of EIG.

> Secondly, by taking logarithm, I mean diagonalizing, then taking
> exponential of the log trace. BUT I DONT WANNA DO THAT BECAUSE I HAVE
> SYMBOLIC ENTRIES!!!

That's a VERY important detail that you left out of your original message!

Finding the eigenvalues of a general symbolic matrix requires finding the
roots of a polynomial of order equal to the number of rows in the matrix.

http://en.wikipedia.org/wiki/Eigenvalue#Characteristic_polynomial

Depending on how complicated the coefficients in your matrix are, this could
be very difficult or even IMPOSSIBLE to solve generally.

http://en.wikipedia.org/wiki/Abel%E2%80%93Ruffini_theorem

> Please, let's not be patronizing, by ridiculous amount of eigenvectors, I
> meant after averaging (ie, randomize entries, and find a ridicuous amount
> fof eigenvectors, say 10 000), so I need high precision.

That statement makes no sense to me, unless you're doing some sort of Monte
Carlo problem where the entries of your matrix are randomly generated and
you expect the eigenvalues and eigenvectors of those random matrices to
converge. Please clarify what exactly you're doing.

Also, it's often _not_ the case that simply throwing higher precision at the
problem is the correct solution to difficulties you may be experiencing.

> Anyways, can anyone tell me why finding the determininant of a 20 y 20
> symbolic matrix fails?

Why are you computing the determinant? If you're computing the determinant
to try to decide if the matrix is singular, that's a BAD IDEA. Use the
condition number instead.

http://en.wikipedia.org/wiki/Condition_number

As an example:

A = (1e-20)*eye(20);
det(A)
cond(A)

The determinant of A is 0 (it underflows in double precision) so A is
singular, right? But the condition number is 1, indicating that A is well
conditioned. In fact, A does have an exact inverse:

Ainv = (1e20)*eye(20);
norm(A*Ainv-eye(20)) % 0
norm(Ainv*A-eye(20)) % 0

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Nasser M. Abbasi

Date: 14 Apr, 2011 15:15:59

Message: 10 of 13

On 4/14/2011 4:28 AM, Leo Kay wrote:

>
> Thanks Nasser, I hadn't realised.
>
> How can I get around this problem?
>

I really do not think you can, unless you have some huge computer with
zillions of memory RAM on it.

You are making a symbolic determinant, much harder than numerical, because
of this intermediate result size explosion problem, a known problem
in computer algebra.

You can ask also in sci.math.symbolic, there are experts there in
computer algebra, may be someone has an idea. But I would suggest
what others said and try to avoid having to find a symbolic
determinant. Memory will always be a problem.

--Nasser

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 16:08:05

Message: 11 of 13

"Nasser M. Abbasi" <nma@12000.org> wrote in message <io733n$e3u$1@speranza.aioe.org>...
> On 4/14/2011 4:28 AM, Leo Kay wrote:
>
> >
> > Thanks Nasser, I hadn't realised.
> >
> > How can I get around this problem?
> >
>
> I really do not think you can, unless you have some huge computer with
> zillions of memory RAM on it.
>
> You are making a symbolic determinant, much harder than numerical, because
> of this intermediate result size explosion problem, a known problem
> in computer algebra.
>
> You can ask also in sci.math.symbolic, there are experts there in
> computer algebra, may be someone has an idea. But I would suggest
> what others said and try to avoid having to find a symbolic
> determinant. Memory will always be a problem.
>
> --Nasser

Good to know. Thanks

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Leo Kay

Date: 14 Apr, 2011 16:12:23

Message: 12 of 13

"Steven_Lord" <slord@mathworks.com> wrote in message <io6v73$a4a$1@fred.mathworks.com>...
>
>
> "Leo Kay" <anousleshommes@hotmail.com> wrote in message
> news:io6gmt$qth$1@fred.mathworks.com...
> > "Roger Stafford" wrote in message <io5sg3$gmj$1@fred.mathworks.com>...
> >> "Leo Kay" <anousleshommes@hotmail.com> wrote in message
> >> <io5er6$cos$1@fred.mathworks.com>...
> >> > Hello,
> >> > I am trying to work out the determinant of a 20 by 20 matrix in Matlab.
> >> > When I run det(M), Matlab simply stalls. I would not have suspected
> >> > this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE
> >> > EXPONENTIALS so I could theoretically take the log before fining the
> >> > det, but I dont wanna do that.
> >> >
> >> > Also, when I ask for the EIG(M), which is the eigenvectors, the
> >> > precision I obtain from Matlab is close to abysmal, as I need to find a
> >> > ridiculous number of eignvectors by averaging over entries of M, then
> >> > adding such vectors. The trouble is, unless precision is high, errors
> >> > add up exponentially fast in my problem.
> >> >
> >> > CAN ANYONE HELP PLEASE?
> >> >
> >> > I mean I have formulated things as simply as I possibly coul so please
> >> > help.
> >> - - - - - - - - - - -
> >> Your description of your problem does not make much sense to me. You
> >> mention that you could take the logarithm of the matrix entries before
> >> finding its determinant (but "dont wanna",) but this is surely not how to
> >> find a determinant. The determinant of element logarithms is not equal
> >> to the logarithm of the determinant, just as the logarithm of a product
> >> is not equal to the product of the logarithms of its factors.
> >>
> >> You state that your 20 x 20 matrix has a ridiculous number of
> >> eigenvectors. Is 20 a ridiculous number? That is the largest number it
> >> can have. If M has a full set of 20 independent eigenvectors, then its
> >> determinant will be equal to the product of its eigenvalues. Your
> >> statement that "The matrix has lots of 0s" would lead one to suspect that
> >> it might not have 20 independent eigenvectors, and it could well have a
> >> determinant value of zero.
> >>
> >> Roger Stafford
> >
> > WHAT A STUPID AND HIGHLY PATRONIZING REPLY!!!
>
> I just reread Roger's comment and it seems to be fine to me. It seems to be
> more appropriate to someone who has little to no experience with
> determinants, eigenvectors, and eigenvalue computations, but nothing in your
> original message indicated to either Roger or I your level of experience.
> Perhaps you have a higher level of experience than Roger thought you did and
> that's why you thought it patronizing.
>
> > First off I am looking for the zero eigenvalue.
>
> So you're looking for a vector V such that M*V is the zero vector? In that
> case, you're not looking for an eigenvalue/eigenvector pair. You're looking
> for the null space of the matrix, and in that case you should use the NULL
> function instead of EIG.
>
> > Secondly, by taking logarithm, I mean diagonalizing, then taking
> > exponential of the log trace. BUT I DONT WANNA DO THAT BECAUSE I HAVE
> > SYMBOLIC ENTRIES!!!
>
> That's a VERY important detail that you left out of your original message!
>
> Finding the eigenvalues of a general symbolic matrix requires finding the
> roots of a polynomial of order equal to the number of rows in the matrix.
>
> http://en.wikipedia.org/wiki/Eigenvalue#Characteristic_polynomial
>
> Depending on how complicated the coefficients in your matrix are, this could
> be very difficult or even IMPOSSIBLE to solve generally.
>
> http://en.wikipedia.org/wiki/Abel%E2%80%93Ruffini_theorem
>
> > Please, let's not be patronizing, by ridiculous amount of eigenvectors, I
> > meant after averaging (ie, randomize entries, and find a ridicuous amount
> > fof eigenvectors, say 10 000), so I need high precision.
>
> That statement makes no sense to me, unless you're doing some sort of Monte
> Carlo problem where the entries of your matrix are randomly generated and
> you expect the eigenvalues and eigenvectors of those random matrices to
> converge. Please clarify what exactly you're doing.
>
> Also, it's often _not_ the case that simply throwing higher precision at the
> problem is the correct solution to difficulties you may be experiencing.
>
> > Anyways, can anyone tell me why finding the determininant of a 20 y 20
> > symbolic matrix fails?
>
> Why are you computing the determinant? If you're computing the determinant
> to try to decide if the matrix is singular, that's a BAD IDEA. Use the
> condition number instead.
>
> http://en.wikipedia.org/wiki/Condition_number
>
> As an example:
>
> A = (1e-20)*eye(20);
> det(A)
> cond(A)
>
> The determinant of A is 0 (it underflows in double precision) so A is
> singular, right? But the condition number is 1, indicating that A is well
> conditioned. In fact, A does have an exact inverse:
>
> Ainv = (1e20)*eye(20);
> norm(A*Ainv-eye(20)) % 0
> norm(Ainv*A-eye(20)) % 0
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com


Again, another unhelpful answer.

I am looking for a determinant with symbolic entries. This tells me you havent got a clue about Quantum dynamics if you dont know why this is of interest. See how patronizing I sound. If you are not going to say something nice, why bother?

So far only Nasser has approached my problem rationally and given an answer to what I suspected to be the case anyways!

Subject: DETERMINANT OF 20 BY 20 MATRIX - higher precision for eigenvectors

From: Florin Neacsu

Date: 14 Apr, 2011 16:55:20

Message: 13 of 13

"Leo Kay" <anousleshommes@hotmail.com> wrote in message <io5er6$cos$1@fred.mathworks.com>...
> Hello,
> I am trying to work out the determinant of a 20 by 20 matrix in Matlab. When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue. The matrix has lots of 0s and ALL ENTRIES ARE EXPONENTIALS so I could theoretically take the log before fining the det, but I dont wanna do that.
>
> Also, when I ask for the EIG(M), which is the eigenvectors, the precision I obtain from Matlab is close to abysmal, as I need to find a ridiculous number of eignvectors by averaging over entries of M, then adding such vectors. The trouble is, unless precision is high, errors add up exponentially fast in my problem.
>
> CAN ANYONE HELP PLEASE?
>
> I mean I have formulated things as simply as I possibly coul so please help.

Dear Mr. Leo Kay,

If I may, your statements are full of contradictions :
---------------
"When I run det(M), Matlab simply stalls. I would not have suspected this to be an issue."

"...given an answer to what I suspected to be the case anyways! "
---------------
"If you are not going to say something nice, why bother?"

"WHAT A STUPID AND HIGHLY PATRONIZING REPLY!!!"
---------------

... I could keep going. And as it was pointed out to you, your initial post ill-described your problem.

My age doesn't allow me to give moral lessons, as I might be a lot younger then you, but I just want to point out that is sad, very sad, that you managed to "insult" two of the most valuable contributors to this forum. Maybe you don't realize but this a voluntary work and I am sure that hundreds/thousands of people learned a lot from both Mr. Stafford and Mr. Lord. It would be a shame that they would stop contributing because of characters like you. But I am also sure your comments had little effect on them.

Sincerely,
Florin

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us