Time constant of exponential decay
조회 수: 78(최근 30일)
I have those two equations of exponential decay with time constant of the first one tu1=3800 sec. I plot those graphs and then from the graph, when I find the 36% decay of the initial value, I read different value tu2=5397. Can anyone help me what I am missing here?
John D'Errico 2018년 3월 2일
편집: John D'Errico 2018년 3월 2일
As Walter pointed out, you don't have a purely exponential model. Yet, this is way easier than you think to solve. Two lines of code to recover the time constant. ;-)
Presume the model is a negative exponential, plus an unknown constant, sampled at an arithmetic sequence in t.
dt = t(2) - t(1);
dy = diff(y);
So assume the model was
y(t) = y0*exp(-t/tc) + yinf
Then when we used diff, it kills off the unknown additive constant. (i.e., the asymptote as t-->infinity.) We will get something like
y0*(exp(-(t + dt)/tc) - exp(-t/tc)) = y0*exp(-t/tc)*(1 - exp(-dt/tc))
Here, dt is quite small compared to tc, but both dt and tc are fixed, thus not a function of t. We don't know either y0 or tc, YET. Take the log.
log(diff(y)) = log(y0*(1-exp(-dt/tc))) - t/tc
Again, the first term is constant, thus not a function of t. While we don't know what that constant is, we don't care, as this part is targeted at solving for tc. The second term is linear in t.
We solve for tc using polyfit.
P1 = polyfit(t(2:end),log(-diff(y)),1)
tc = -1/P1(1)
Yup. That looks familiar.
To recover the unknowns from the second series,
P2 = polyfit(t(2:end),log(-diff(y2)),1)
tc2 = -1/P2(1)
Ok. That really was pretty easy. Can we now recover the constants y0 and the asymptote at infinity? Easy peasy too. Just one more line. Oddly enough, we use polyfit once more.
For the second curve...
I think you should recognize each of those coefficients for each dataset.
Such a versatile tool, that polyfit. We used it twice, fitting a straight line fit each time, yet we solved a nonlinear curve fitting problem, recovering not only the rate constant, but the asymptote at infinity as well as the multiplicative constant out front.
Kind of pretty. (Yes, I played a bit fast and loose with the statistics here.)
Walter Roberson 2018년 3월 2일
The time constant tu1=3800 applies to a pure exponential. You do not have a pure exponential: you have an exponential plus a constant. If you look at 3800 you will see 0.88 plus the constant.