# Calculating Numerical Uncertainties in an Equation

Athenian
Homework Statement:
Relevant Equations:
Refer below.
Background Information:

I am working on a pulsed NMR lab project that involves graphing out a semi-log graph of free induction decay amplitude as a function of time. After graphing out the semi-log graph, I am to determine the apparent spin-spin relaxation time (##{T_2}^*##) through the numerical values that corresponds to the linear line my data points go along.

For example, one linear equation I got from my data points is as shown below.
$$y = mt+b$$
##m=-0.008344 \pm 0.0004948## mV/##\mu##s
##b=2.931 \pm 0.07160## mV

To acquire ##{T_2}^*## (i.e. the apparent spin-spin relaxation time), I decided to calculate the value by using the below equation.

$${T_2}^*=\frac{\big(\frac{b}{e} - b\big)}{m}$$

For the above case, I got the numerical answer of ##{T_2}^*= 222.05## ##\mu##s.

Problem:

Using the equation for ##{T_2}^*## as shown above, I can calculate for my uncertainty value as well. Therefore, rather than inserting the value of 2.931 for ##b##, I used 0.07160 (the uncertainty value) instead.

Using uncertainty values only, I acquired the uncertainty answer of ##{T_2}^*= \pm 91.47## ##\mu##s.

As the uncertainty value is incredibly large (when compared to the actual value of 222 ##\mu##s), I believe I must have done something wrong here.

While I am unable to come up with a fix to the problem, I believe either I managed to approach calculating for my uncertainty value in a wrong manner or I somehow got the equation to acquire the value for ##{T_2}^*## incorrectly.

Ultimately, any assistance on this question would be greatly appreciated. Thank you very much for reading through this.

Gold Member
Last edited:
Athenian
Homework Helper
Gold Member
2022 Award
You should have plugged in the maximum/minimum values of b. This is a less accurate method than the method in the above notes.
It isn't necessarily less accurate.
For scientific purposes, it is usual to apply statistical methods because you are interested in the standard deviation. But an engineer working with tolerances on mechanical components may be better advised to plug in extreme values.

Frabjous
Homework Helper
2022 Award
But an engineer working with tolerances on mechanical components may be better advised to plug in extreme values.
In this circumstance, what does this mean?? The OP has a linear fit to a set of data and is interested in the slope and its error. How does one obtain extremal values for the slope that make any sense? For linear fits the rms deviation of the slope can be obtained in closed form and is the appropriate measure to use.

Homework Helper
Gold Member
2022 Award
In this circumstance, what does this mean?? The OP has a linear fit to a set of data and is interested in the slope and its error. How does one obtain extremal values for the slope that make any sense? For linear fits the rms deviation of the slope can be obtained in closed form and is the appropriate measure to use.
My remark was in the context of starting with the ± expressions for m and b.
Representing these as independent and normally distributed, then applying the standard error propagation formulae, is also flawed. Ideally one would find the joint distribution of m and b.

Last edited:
Homework Helper
2022 Award
My apology. I misrepresented the question and upon actually looking at it again I see that your procedure is straightforward. For a small data set (say n=5) I would do exactly as you say just for convenience. The rms deviation of the result will be essentially the same as the rms deviation of obtained using the standard error propagation formulas. Choosing where to put the limits in any situation is still not determinate.
Of course the OP would be well advised to understand both methods.

To acquire T2∗ (i.e. the apparent spin-spin relaxation time), I decided to calculate the value by using the below equation.
Can you reference that equation ?

Frabjous and Athenian
Gold Member
Changed less accurate to different.

hutchphd
Athenian
Thank you all for your helpful feedback! The PDF @caz provided was incredibly helpful. However, after calculation, the uncertainty value is still too big. I'm pretty sure I did something wrong, but I'm not sure where to identity what went wrong. For an in-depth explanation on the steps I went through, please refer to the "last" paragraphs (after the dotted lines).

@hutchphd, thank you for your question. During the time I was examing the help and answers provided to me on this thread, I was reexamining my equation for ##{T_2}^*##. I'll try to explain my reasoning for my equation of ##{T_2}^*## and please do let me know what are your thoughts on it.

The equation for ##{T_2}^*## is as follows:

$$M=M_0 e^{\big(\frac{-t}{{T_2}^*} \big)}$$

Thus, to find ##{T_2}^*## for the above equation, I need to simply understand that the exponential term of the equation is in the form of ##e^{-Ct}## -- leading to the below discovery:

$${T_2}^* = \frac{1}{C}$$

(Reference [Page 5]: http://home.sandiego.edu/~severn/p480w/NMR_KL_1.pdf)

However, for the purpose of this project, I am required to create a semi-logarithmic graph of free-induction decay amplitude as a function of time. In other words, the semi-logarithmic graph will make the trendlines follow a linear trajectory; thereby allowing me to plot my data points with the equation ##y=mt+b##.

As for where ##{T_2}^* = \frac{\frac{b}{e} -b}{m}## came from, this was an equation I tried to logically "think up". From the graphs I saw on the web, ##{T_2}^*## can be obtained by taking the value of the y-intercept (when ##t=0##) and dividing it by ##e## (i.e. ~37% of the original value) before finding the corresponding t-value for the given ##\frac{y-intercept}{e}## value.

Thus, the equation ##{T_2}^* = \frac{\frac{b}{e} -b}{m}## can be translated to ##t= \frac{y-b}{m}## (came from ##y=mt+b##).

That said, I am reexamining my equation here considering that the graphs I found on the web were exponential. As my graphs are linear, the same principle that applies to the exponential graph may not necessarily apply to its linear counterpart.

So, while I know that ##{T_2}^* = \frac{1}{C}## in an exponential graph, I am having a hard time understanding how I would find ##{T_2}^*## on a semi-logarithmic graph with linear equations. Any assistance on this would be appreciated. Hopefully, I was able to explain my thought process above clearly.

----------------------

@caz, as mentioned, below is my attempt to obtain the uncertainty value.

For starters, please note the below values that are being used.

##m=-0.008344 \pm 0.0004948## mV/##\mu##s
##b=2.931 \pm 0.07160## mV
##T=222.05 \mu##s (finding for the uncertainty of this value)

Equation used:
$${T_2}^* = \frac{\big(\frac{b}{e} -b \big)}{m}$$

Calculating the uncertainty value:
Starting with ##\frac{b}{e} - b##, I have ...

$$\sigma_b= \sqrt{\big(\frac{0.0716}{e}\big)^2 + (0.0716)^2}$$

Note that I assigned the above value with a variable ##\sigma_b##.

To divide by the uncertainty value of ##m##, I used the equation in the PDF (i.e. ##\frac{{\sigma_x}^2}{x^2} = \frac{{\sigma_u}^2}{u^2} + \frac{{\sigma_v}^2}{v^2}##) as shown below:

$$\frac{{\sigma_{{T_2}^*}}^2}{{{T_2}^*}^2} = \frac{{\sigma_b}^2}{b^2} + \frac{{\sigma_m}^2}{m^2}$$

Numerically, it would look like the below equation.

$$\frac{{\sigma_{{T_2}^*}}^2}{222.05} = \frac{\sqrt{\big(\frac{0.0716}{e}\big)^2 + (0.0716)^2}}{(2.931)^2} + \frac{(0.008344)^2}{(0.0004948)^2} = 251.2909 ...$$

Obviously, something went wrong in my above calculation. My biggest concern would be ##\sigma_b##, though I am not certain where or how to rectify the problem. Any additional help on this would be greatly appreciated.

Once again, thank you all very much for your helpful feedback and explanations.

Gold Member
I haven't checked your initial equation.

You made a couple of mistakes in the error propagation.

You used ##\frac{m^2}{{\sigma_m}^2}##

and you also used the error for ##{\big(\frac{b}{e} -b \big)}## in the numerator but the value for b in the denominator.

I've attached my calculation.

Notice at the end, I am checking percent error. The basic idea is that experimental error is random (not systematic); therefore the probability that maximal error is occurring for both variables at the same time is small so the percent error of the result should be smaller than the sum of the percent errors of each of the components. Notice that the error formula is essentially a function of percent errors in this case.

Last edited:
Athenian
Gold Member
I am not sure about the equation you are using. I am sort of busy this afternoon, so hopefully @hutchphd or @haruspex can step in ...

Initial question: How does the equation ##M=M_0 e^{\big(\frac{-t}{{T_2}^*} \big)}## transform when you plot it on a semi-log graph?

Hint: Take the ln of both sides of the equation. How should you define a new variable 'y' and constants 'm' and 'b'?

Last edited:
Athenian
Athenian
@caz , thank you so much for your help!

In retrospect, I should have factored ##\frac{b}{e} - b## to ##\big(\frac{1}{e}-1\big)b## (as you have demonstrated) to make applying the equation of error propagation a much more streamlined process. My mathematical folly aside, thank you very much for providing clarity in the solution process.

Hint: Take the ln of both sides of the equation. How should you define a new variable 'y' and constants 'm' and 'b'?

$$M = M_0 e^{\big(\frac{-t}{{T_2}^*}\big)}$$
$$\Rightarrow \ln{(M)} = \ln{\Big(M_0 e^{\big(\frac{-t}{{T_2}^*}\big)}\Big)} = \ln{(M_0)} - \frac{t}{{T_2}^*}$$
$$\Rightarrow \ln{\bigg(\frac{M_0}{M}\bigg)} = \frac{t}{{T_2}^*}$$

To my best understanding, ##M## would translate to ##y## and ##M_0## would translate to ##b## here. Obviously, ##t## would translate to ##x## (which I already consistently called ##t## since the beginning). Considering all there that is left is ##m##, I suppose that translates to the value of ##{T_2}^*##? However, this idea makes little to no sense because the slope on my graph is in the negative and would thus not be able to accommodate ##{T_2}^*##'s units of time (i.e. seconds). In other words, ##{T_2}^* \neq m## because time cannot be measured in the negative value (in this given case).

I do have a question on "taking ln of both sides of the equation". To plot for my semi-log graph, I took all my y-values from the provided data points and took the logarithm for all of them. In other words, to obtain a linear graph (instead of an exponential one), my values for the y-axis all came in the equational form of ##\log(y)##. In that case, would taking the natural log (##\ln##) still be the correct way to "define a new variable 'y' and constants 'm' and 'b'"?

Gold Member
I like ln instead of log because it allows me to trivially get rid of e. You can use log10 (or any base of your choice), but then you are carrying the conversion factor, log10e.

Look at one of your intermediate equations

##\ln{(M)} = \ln{(M_0)} - \frac{t}{{T_2}^*}##

if we let
y = ##\ln{(M)}##
b = ##\ln{(M_0)}##
m = ##\frac{-1}{{T_2}^*}##

we end up with
y = mt+b

Did you see what you need to do now? (Make sure that you are consistent with ln or log.)

Last edited:
hutchphd and Athenian
Athenian
Thank you for the explanation. I believe I completely understand the method of conversion now. Considering that semi-log graphs tend to use ##\log_{10}##, I decided to opt for the below solution to find for ##{T_2}^*##.

$${T_2}^* = -\frac{\log{(e)}}{m}$$

That said, taking the natural log (as you have demonstrated) is a far more convenient process. However, for the purpose of this project, I need to go for the log (base 10) approach. Perhaps it's a semi-log graphing convention to do so.

Ultimately, thank you so much for all your feedback thus far and it has been an incredible learning experience for me!

Frabjous
Gold Member
I've been sloppy with units. It is generally a bad thing to take logarithms of dimensional quantities.

What are the dimensions of M? Create a constant M* equal to one of these units and divide your initial equation by it so that

##\frac{M}{M^*}=\frac{M_0}{M^*} e^{\big(\frac{-t}{{T_2}^*} \big)}##

and things are dimensionless.

Athenian
Gold Member
Also notice that the error analysis is going to change because the formula for T2* is different.

Athenian
Athenian
What are the dimensions of M? Create a constant M* equal to one of these units and divide your initial equation by it so that

MM∗=M0M∗e(−tT2∗)

and things are dimensionless.

Thanks for the information here. This was certainly helpful!

Also notice that the error analysis is going to change because the formula for T2* is different.

You are right. I was spending the time earlier to figure this out. Below are the steps I have taken.

Recall that ##{T_2}^* = -\frac{\log{(e)}}{m} = -\log{(e)} m^{-1}##.

Equation used for error propagation (from the PDF):

$$\frac{\sigma_{{T_2}^*}}{{T_2}^*} = -1 \frac{\sigma_m}{m}$$
$$\Rightarrow \frac{\sigma_{{T_2}^*}}{52.05} = -1 \frac{0.0004948}{-0.008344}$$
$$\Rightarrow \sigma_{{T_2}^*} = 3.08649...$$

Double-checking is the above a reasonable value:

$$\frac{\sigma_{{T_2}^*}}{{T_2}^*} = \frac{3.08649}{52.05} = 5.9 \%$$

Side Notes:

I did recalculate the value of ##{T_2}^*## with the new equation to get ##52.05##.

##m=-0.008344 \pm 0.0004948##

----------------------

Personally, I believe the above looks correct. Of course, if I made any mistakes, please do let me know. Thank you!

Gold Member
Don’t forget that T2* and its error have the units of time. Also think about significant digits. I do not know what the formal rules are, but I would probably report 52.0 +- 3.1 with appropriate units.

hutchphd and Athenian
Athenian
No problem. I'll be sure to input the appropriate units and significant figures when I type out all the data onto the report. Thanks for the word of caution!

Frabjous
Gold Member
BTW, you were told to use log10 because people used to plot this by hand on specialty paper.

Athenian
Sorry I just got back to this. Looks like you have a much better handle on things although I didn't (nor will I) check the exact numbers . Remember that ln and log differ only by a constant numerical factor. Let ##y=ln(x)## then ##x=e^y## and ##log(x)=log(e^y)## and so $$log (x)=ylog(e)= (.434..)ln(x)$$ Any change of base number works this way.