Numerical underflow problem - help about matrix logarithm needed please



Hi all, I am currently using Matlab to calculate the value of a
function

f = A*expm(B*n)*C

where A is a 1x3 vector, B is an upper triangular 3x3 matrix, n is a
scalar and C is a 3x1 vector. f is then a scalar and I take the log
of f.

PROBLEM: For some values of n, i.e. large n, f turns out to be zero.
This is because the values of the matrix expm(B*n) all become zero
(probably due to the diagonal elements of B being negative).

Is there any way of calculting the logarithm of f without having to
take the exponential of B*n?

i.e. if

log(f) = log(A) + B*n + log(C)

was true it would be nice!
(clearly not true, but just to get the idea of what I mean!)

Any help greatly appreciated

Thanks

Ronan
.



Relevant Pages

  • Re: Numerical underflow problem - help about matrix logarithm needed please
    ... where A is a 1x3 vector, B is an upper triangular 3x3 matrix, n is a ... scalar and C is a 3x1 vector. ... For some values of n, i.e. large n, f turns out to be zero. ... Perhaps you could avoid underflow by adding an appropriate constant ...
    (comp.soft-sys.matlab)
  • Re: zero based arrays?
    ... John D'Errico wrote: ... There is a very real and very 'physical' reason for zero based ... of this, but c came before Matlab, and in fact, Matlab is written in ... them, or else programming would never work, ever, at all. ...
    (comp.soft-sys.matlab)
  • Re: too many zeros and orbital mechanics.
    ... How do I tell Matlab not to do that? ... I can try round(e) which does round that to zero, ... exact value of zero, clear down to the least significant bit, you can ...
    (comp.soft-sys.matlab)
  • Re: Huge bug when vectorizing
    ... Matlab has decided that they don't need to be ... that by 0 you meant a vector of zeros the same length as a vector used ... My issue was to try to write a conversion routine for scalar ...
    (comp.soft-sys.matlab)
  • Re: len() should always return something
    ... particular, when applied to a scalar, it should return a value of 1. ... I knew that you were coming from Matlab as soon as I saw the subject ... The thing to keep in mind about Python is that it's a general purpose ... By allowing scalar numbers to act as degenerate lists, ...
    (comp.lang.python)