Why does this exponential equation return a zero-zero array?

I am trying to figure out why I am returning all zeros in the code below.

a = 7.0e16;
e = 100000;
r = 8.3140;
t = 253:2:325;

k = a.*exp(-e./t.*r);

      

k

returns as a 1x37 array of only zeros.

Is it because my numbers are too large or too small?

+3


source to share


1 answer


You get underutilized. Things become zero at exp, and multiplying by a large number is then too late. It's like a physical equation - in this case, you want to divide by r, not multiply. Try

exp(log(a)-e./(t*r))



It should work

EDIT - need to add, not multiply, log (a) in exponent ...

+4


source







All Articles