# Solving exponential equation (using a graph)

1. Sep 26, 2016

### roam

1. The problem statement, all variables and given/known data

Using experimental data, I am trying to solve the following equation for $T_2$

$$M(t)=M_0 e^{-t/T_2}. \tag{1}$$

Here $M_0$ denotes the initial value. There were 8 data points collected for $t$ and $M(t).$ Here is the resulting graph:

The data and equation (1) in fact relate to MRI experiments. I am attempting to calculate $T_2$ relaxation time of a given solution. ($t$ is in ms and $M(t)$ in arbitrary units)

2. Relevant equations

3. The attempt at a solution

I have fitted the data with a linear fitting. So, what part of equation (1) does the slope of the plot correspond to? This is not obvious because the plot is exponential rather than linear.

My approach was to somehow equate the slope to some part of equation (1) containing $T_2$, so I can then solve for it. How could I do that?

Any help would be greatly appreciated.

P. S. I was told the answer should be about $437.2.$

Last edited: Sep 26, 2016
2. Sep 26, 2016

### Orodruin

Staff Emeritus
If you are trying to fit an exponential function you should use an exponential function fit, not a linear one.

3. Sep 26, 2016

### PeroK

It's not at all clear to me what you are trying to do. What is the value of $M_0$?

If you are looking for an exponetial solution, what is the point of finding a linear solution?

The data, at first sight, does not seem to fit well with any exponential solution.

4. Sep 26, 2016

### Orodruin

Staff Emeritus
This is indeed also true. However, the measurements we are presented with do not have error bars, so we cannot really say anything about the goodness of the fit.

5. Sep 26, 2016

### roam

This website has a calculator. When I enter my data there (under the T2/T2* menu), it fits the data and gives $T_2 = 96.5.$ The R2 value for their fitting is $0.9103$. How do I know what sort of exponential fitting was used?

In theory, it should be an exponential decay like the figure below. But as Orodruin mentioned there would be experimental errors.

$M_0$ is a parameter which was not measured during the experiment (in MRI, it is the initial magnetisation immediately following the excitation pulse). But the calculator in my link calculates it as being $M_0 = 62567.$

P. S. The data I used:

t=[9 10 12 15 20 30 50 80]
M=[55356.19 55657.78 54412.25 52885.59 51757.19 48357.24 43246.79 21323.37]

Last edited: Sep 26, 2016
6. Sep 26, 2016

### RUber

If you expect a function of the form:
$M(t) = M_0 e^{-t/T_2},$
then the data you have for M should be exponential with the property that
$\ln(M(t)) = \ln(M_0) - t/T_2$
which would be linear in t.
Try plotting log(M) vs. t and finding the best linear fit.

7. Sep 26, 2016

### roam

Thank you for your input. When I plot log(M) vs. t , I get a good estimate of $T_2$ and $M_0$ (but not as accurate as the exponential model).

And the log graph is not completely linear in t. It has the same overall shape as the original function I've posted above. Why is that?

8. Sep 26, 2016

### RUber

Like the previous posters mentioned, this data does not appear to be exponential, since linear is a better fit overall. However, if you have to fit it to the model you provided, then fitting the log is one easy way to do it.
In this case, what do you get for M0 and T2?

9. Sep 26, 2016

### Staff: Mentor

Apparently, the line labelled "linear" on the plot is really logM vs t, which, for an exponential, would appear linear on the plot if the data was consistent with the equation. There seems to be only one data point "out of whack" on the plot, and this data point should be checked more carefully.

10. Sep 26, 2016

### epenguin

I was going to say the same as Chestermiller.
On the face of it your data is consistent both with an exponential disappearance, and with disappearance at a constant rate!
It is harder to judge about whether exponential fits better because you haven't reproduced the data points in your second graph.
The trouble is judgement is quite affected by just one point, the last one.
Ignoring this point you are not in a very good situation to decide the nature of the decrease, because all your other points are in about the top 20% of your range!
We also don't know what the final value of your signal is – that is, is it something that declines to 0 ?
If it doesn't, then what it makes sense to fit to your exponential to is not M(t) but [M(t) - M(∞)] , ( M(∞) being in practice of the 'final' M you seem to stabilize at finally)..
Conclusions about the nature of the disappearance kinetics would probably have to be very weak at this point, and you would need to do the observations over a longer period. Often of course you don't know this when you do the experiment for the first time.

It would be of interest to know what you are observing - is it a signal that corresponds to one particular substance and in what circumstances?
On the diagram you need to state your units of time - we have no idea.

11. Sep 27, 2016

### roam

Thank you for your comments. Yes, the last point should have a slightly higher intensity in order for the curve to be exponential.

Also, I believe the final value of M is about zero, because when we have saturation, there is no net magnetisation and hence no NMR signal.

I have labeled the units of time on the diagram. In fact, I made several plots for data corresponding to different substances. for more concentrated cases they appear to be more exponential (the data I was trying to fit above is the red line in the graph below). If I use an exponential fitting for the 15 mM case, the R2 value would be 1.

Using an exponential fit, I got $y=62570 e^{-0.01036 x},$ so $M_0 = 62570,$ and $T_2 = 96.5251.$

By linear fitting the log plot, I got $y=-0.0123 x +11.1,$ so $M_0=66171$ and $T_2 = 81.3.$

12. Sep 27, 2016

### roam

I have a related question. If instead of an exponential decay, we had an exponential growth given by

$$M_z (t)=M_z(0) e^{-t/T_1} + M_0 (1-e^{-t/T_1}) \tag{2}$$

And I had measurements of $M_z (t)$ over a range of $t,$ what would be a good fitting to work out $T_1$?

The following is a fitting two-term exponential model I made for my data:

It has the following equation

$$26420 e^{(1.347\times 10^{-6})x} -24500 e^{(-0.07508)x}.$$

Since the two exponents are very different, how would I work out $T_1$? I would get two very different values.

And if I plot $log (M_z (t))$ vs $t$, the resulting graph would still be an exponential growth, so I think a linear fitting would not be approperiate.

13. Sep 27, 2016

### Staff: Mentor

$\log{\left[\frac{M_z(t)-M_0}{M_z(0)-M_0}\right]}$ vs t

14. Sep 27, 2016

### epenguin

These new graphs look more reasonably exponential. M(∞) can be taken to be 0, so your exponential plot is the simple one said that the start.
It would be interesting to see your corresponding logarithmic plots for this new data.
By the way for the top one, I think it corresponds to that in your first post, the difference between rate constant obtained by linear fit, and that obtained by exponential fit, would be expected to be not enormous (which I think is what you got) because after all the concentration is very roughly constant.
If all these experiments are each colour a different substance, then each might have a different rate constant. If any of them are the same substance, the rate constants would be expected to be the same regardless of initial concentration.

Last edited: Sep 27, 2016
15. Sep 28, 2016

### roam

Thank you. But how can I plot $\log{\left[\frac{M_z(t)-M_0}{M_z(0)-M_0}\right]}$ when I don't know $M_0$ and $M_z(0)$ beforehand?

As defined in the diagram in my last post, $M_0$ is the asymptote of the exponential, and $M_z(0)$ is its starting value. I think if I had a plot, the y-intercept of the linear fitting would be $M_z(0).$ But how can I make a plot without knowing these values in advance?

Also, is there any way a two-term exponential fitting can be used to determine $T_1$ in equation (2)?

16. Sep 28, 2016

### Staff: Mentor

Oh. Sorry. I thought that $M_0$ was known. You must know $M_z(0)$, since that is just the value of $M_z(t)$ at what you call t = 0. If you knew $M_0$, then you could still plot $\log(M_z(t)-M_0)$ vs t and then fit your best straight line to it. Or, if $M_0$ is not known, you could plot several lines using different values of $M_0$, and choose the one that gives the best straight line.

Otherwise, if such line plotting is unsatisfactory to you, you could do a non-linear least squares fit of the equation to the data to determine the best values of the unknown parameters of $M_0$ and $T_1$. Are you familiar with doing non-linear least squares?

17. Sep 29, 2016

### roam

Unfortunately, I am not very familiar with non-linear least squares fitting. Does the Matlab polyfit function perform this operation you are referring to? And what should be the order of the chosen polynomial?

I think somehow in Matlab I need to specify the equation $f(x) = a e^{b x} + c,$ so that from the values $a, b, c$ obtained we can compute $M_0$ and $T_1.$ I am not sure what kind of fitting does that.

18. Sep 29, 2016

### Staff: Mentor

I haven't used Matlab, but most software like it allows you to specify the mathematical form of a function with adjustable parameters that are determined by fitting a set of data.