0

I have the following data:

\begin{array}{|c|c|} \hline t & KE \\ \hline 0 & 3.250 \\ \hline 0.0000416 & 1.505 \\ \hline 0.0000832&0.526 \\ \hline 0.000125 & 0 \\ \hline 0.000166 & 0 \\ \hline 0.000208 & 0 \\ \hline 0.000250 & 0 \\ \hline \end{array}

where $t$ is time and $KE$ is kinetic energy. It's believed that KE decays with time ($t$) as follows:

$$KE \propto t^n$$

where n is negative and for the purposes of this post is equal to $-1$.

What I would like to do is to plot the data and then show a line on that plot that indicates what the equation decay looks like for the data. Obviously plotting the data is a no brainer. But how does one plot on the chart a decay line based on the equation? It seems like the problem is that at $t = 0, KE = \infty$ for $KE \propto \frac{1}{t}$.

I've included the chart of the data. How can I draw the equation decay line on this chart that is relevant to the data?

enter image description here

rdemo
  • 173
  • A "power law" is KE= a^t, not t^n. Take the logarithm of both sides: log(KE)= t log(a). Graph the logarithm of KE against t to get a straight line graph. a is the exponential of the slope of that line. – George Ivey Nov 02 '23 at 15:29
  • Thanks for the correction. I have updated my post. The Equation I showed is correct; my nomenclature was wrong. – rdemo Nov 02 '23 at 15:41

2 Answers2

0

You can't fit that data with a curve of the form $Kt^n$ (with negative $n$). That function form implies growth to $\infty$ at $t=0$ and never $0$ anywhere.

You could fit the first three points with a function of the form $$ 3.250e^{-rt} $$ with a positive value of the decay rate $r$. That would be small when $t$ is large, but never $0$.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
  • Yeah. I know you can't fit the data, but I was wondering if there might be a way to show what the decline would look like if it was $t^{−n}$. But the problem is how would I know where to start since I can't start at $t=0$ and $KE=3.250$. By the way the equation you show is, in fact, the general eqn [$KE=KE_0exp(−bt)$] I am using for all my data. But I just wanted to show what a $t^{−n}$ curve would look like. – rdemo Nov 02 '23 at 18:43
0

Problems like this usually come down to linear regression.

Find A, B so that $S^2=\sum_{k=1}^N(y_i-Ax_i-B)^2$ is a minimum.

$\partial S^2/\partial A=\sum_{k=1}^N 2(y_i-Ax_i-B)(-x_i)=0$

$\implies -\overline{xy}+A\overline{x^2}+B\overline{x}=0$

$\partial S^2/ \partial B = \sum_{k=1}^N 2(y_i-Ax_i-B)(-1)$

$\implies -\overline{y}+A\overline{x}+B=0$

Now you have two equations in two unknowns so solve for A and B,the slope and y intercept.


After you sort that out, you can move on to other forms of the function you use to model the data.

$y=px^q$

$\ln y = \ln p + q \ln x$

So the y_is you use are the natural logs of the y's from before. $\ln p$ is B, q is A and use $\ln x$ instead of $x$ to sort it out.


Something similar applies here.

$y=Ae^{kx}$

$\ln y = \ln A + kx$


Here's something that might help. Between adjacent points $(x_1,y_1), (x_2,y_2)$

$y_2=k/x_2$

$y_1=k/x_1$

$y_2-y_1=\frac{k(x_1-x_2)}{x_1x_2}$

So this can only help define a piecewise function.

$\frac{(y_2-y_1)x_1x_2}{x_1-x_2}=k$

$x_1\to 0 \implies k=-(y_2-y_1)$ so you get a finite value for $k$ even if using $t=0$ as an input.

TurlocTheRed
  • 5,683
  • Is your answer only applicable to $y=Ae^{kx}$. What about my question regarding $KE \propto t^{-n}$. – rdemo Nov 03 '23 at 01:52
  • It's applicable to $y=Ae^{kx}$. You have to modify the x and y values used when taking your averages though. You average the $\ln y$ values instead of the $y$ values. I think your kinect energy case matches the p-q case I mention in which you are worried about average of the natural logs of both $x$ and $y$. Just saw you want your exponent to be negative. Things might break down there. – TurlocTheRed Nov 03 '23 at 18:28