Thursday, September 18, 2008

error propagation

Recently, I've been working on my physics lab reports. The main theoretical concerns are about error analysis. This means there's a lot of equations to mess around: specifically the propagation of errors.

The first time I learned about error propagation (under a different name) was at pre-college level high school (i.e. AS-Level). It sounded simply, and the basic equations were as follows (in summarized form):
\newcommand{\error}{\operator{\boldsymbol{\sigma}}}
\begin{align*}
\error_{a \pm b} &= \error_a + \error_b
\\
\error_{Ba} &= B \error_a
\\
{\error_{ab} \over \left|ab\right|} = {\error_{a \over b} \over \left|a \over b\right|}  &= {\error_a \over \left|a\right|} + {\error_b \over \left|b\right|}
\\
{\error_{a^B} \over \left|a^B\right| } &= \left|B\right| {\error_a \over \left|a\right|}
\end{align*}
Notice that:
\newcommand{\error}{\operatorname{\boldsymbol{\sigma}}}
\error_u \over \left|u\right|
is simply the fractional error of u, whatever u might be.

However, the above equations can be replaced with quadratures if the uncertainty is a standard error and the measurements are independent:
\newcommand{\error}{\operatorname{\boldsymbol{\sigma}}}
\begin{align*}
\error_{a \pm b}^2 &= \error_a^2 + \error_b^2
\\
\left({\error_{ab} \over ab}\right)^2 = \left({\error_{a \over b} \over {a \over b}}\right)^2 &= \left(\error_a \over a\right)^2 + \left(\error_b \over b\right)^2
\end{align*}

Here's the general formula that applies to any multivariable function f of a, b, c, etc:
\newcommand{\error}{\operator{\boldsymbol{\sigma}}}
\begin{align*}
\error_{f(a, b, c, \,\cdots)} = \left| \partial f \over \partial a \right| \error_a + \left| \partial f \over \partial b \right| \error_b + \left| \partial f \over \partial c \right| \error_c + \cdots
\end{align*}

Again, if quadratures are to be used (if uncertainties are standard errors and the variables are independent)
\newcommand{\error}{\operator{\boldsymbol{\sigma}}}
\begin{align*}
\error_{f(a, b, c, \,\cdots)}^2 = \left( {\partial f \over \partial a} \error_a \right)^2 + \left( {\partial f \over \partial b} \error_b \right)^2 + \left( {\partial f \over \partial c} \error_c \right)^2 + \cdots
\end{align*}

(Note: most of the above formulas are approximations)

Monday, September 8, 2008

electric field integral

During my physics class, I had an encounter with a tough integral. I was trying to derive the electric field for an infinite line of charges, but got stuck because I couldn't integrate:
\int{\mathrm{d}x \over (x^2 + y^2)^{3 \over 2} } (y is a constant)
There are many sources about how the integral can be integrated, but none of them (as far as I have found) indicate how the final result was obtained. So here's one way of deriving the answer (credit: HallsofIvy at Physics Forums):
\begin{align*}
& \int{\mathrm{d}x \over (x^2 + y^2)^{3 \over 2} }
\\&= \int{\mathrm{d}(y \tan \theta) \over [(y \tan \theta)^2 + y^2]^{3 \over 2}}
\\&= \int{y \sec^2 \theta \,\mathrm{d}\theta \over [y^2 (\tan^2 \theta + 1)]^{3 \over 2}}
\\&= \int{y \sec^2 \theta \,\mathrm{d}\theta \over y^3 \sec^3 \theta}
\\&= \int{\mathrm{d}\theta \over y^2 \sec \theta}
\\&= {1 \over y^2} \int \cos \theta \,\mathrm{d}\theta
\\&= {1 \over y^2} \sin \theta + C
\\&= {1 \over y^2} {x \over \sqrt{x^2 + y^2}} + C
\\&= {x \over y^2 \sqrt{x^2 + y^2}} + C
\end{align*}
Okay, just a brief explanation:
In the 2nd equation, substitute x = y tan θ and dx = y sec2 θ
In the 4th equation, simplify the equation with tan2 θ + 1 = sec2 θ
In the 8th equation, simplify with:
\begin{align*}
\textup{since} \qquad x &= y \tan \theta
\\ x &= y {\sin \theta \over \cos \theta}
\\ x &= y \sin \theta \sec \theta
\\ x &= y \sin \theta \sqrt{\sec^2 \theta}
\\ x &= y \sin \theta \sqrt{\tan^2 \theta + 1} \quad \Leftarrow \textup{from }\sec^2 \theta = \tan^2 \theta + 1
\\ x &= \sin \theta \sqrt{y^2 \left(\tan^2 \theta + 1\right)}
\\ x &= \sin \theta \sqrt{\left(y \tan \theta\right)^2 + y^2}
\\ x &= \sin \theta \sqrt{x^2 + y^2} \qquad \Leftarrow \textup{since }x = y \tan \theta
\\ {x \over \sqrt{x^2 + y^2}} &= \sin \theta
\end{align*}

Friday, September 5, 2008

E-potential / E-potential-energy

Sigh, I haven't updated SciLearn for a while. Homework has been keeping me busy recently. Still, I decided to publish a short post about electrostatics.

Okay, today I encountered something that I never realized/thought of properly. What is the difference between electric potential and electric potential energy?

The main difference can be easily found by analyzing the units:
  • electric potential is a quantity in volts or - equivalently - joules per coulomb.
  • electric potential energy is energy, in joules.
The difference is just:
electric potential is electric potential energy divided by the charge of the test particle.
Ain't that simple?

You can draw a similar relationship between electric field (NC-1) and electric force field (N) (since they are simply gradients of the electric potential and electric potential energy respectively).

Note: all of these also apply to gravitation.