HEAD | PREVIOUS |

$\left(\begin{array}{ccccc}\hfill -2\hfill & \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill \ddots \hfill & \hfill \ddots \hfill & \hfill \ddots \hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill -2\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill \ddots \hfill & \hfill \ddots \hfill & \hfill \ddots \hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill & \hfill -2\hfill \end{array}\right)\left(\begin{array}{c}\hfill {y}_{2}\hfill \\ \hfill :\hfill \\ \hfill {y}_{n}\hfill \\ \hfill :\hfill \\ \hfill {y}_{N-1}\hfill \end{array}\right)=\left(\begin{array}{c}\hfill {g}_{2}\mathit{\Delta}{x}^{2}-{y}_{L}\hfill \\ \hfill :\hfill \\ \hfill {g}_{n}\mathit{\Delta}{x}^{2}\hfill \\ \hfill :\hfill \\ \hfill {g}_{N-1}\mathit{\Delta}{x}^{2}-{y}_{R}\hfill \end{array}\right).$ |

This form keeps the matrix symmetric, which is advantageous for some inversion algorithms. ${}^{19}$In some circumstances one can deliberately choose the mesh so as to put the boundary at ${x}_{3/2}$. Then the implementation represented by eq. (3.15) does put the value at the correct place. This mesh choice is appropriate if the boundary condition is known to be of purely derivative form. It then lends itself to the alternative approach of the previous note, excluding the boundary from $\mathbf{D}$. The top left coefficient becomes ${D}_{22}=-1$, and $\mathit{\Delta}x\hspace{0.5em}\mathit{dy}/\mathit{dx}{|}_{L}$ is added to the source vector, to implement the boundary condition. Mixed boundary conditions are not handled so easily like this, which is why a second-order accurate form with the boundary at ${x}_{1}$ has been given. ${}^{20}$The error in the first derivative $y\text{'}$ is approximately $y"{}_{2}.\frac{1}{2}\mathit{\Delta}x$, first-order in $\mathit{\Delta}x$, but the error in $\mathit{\Delta}y$ is second-order in $\mathit{\Delta}x$ giving first order accuracy. ${}^{21}$With periodic boundary conditions the homogeneous equation ($\frac{{d}^{2}y}{{\mathit{dx}}^{2}}=0$) is satisfied by any constant $y$. An additional condition must therefore be applied to make the solution unique. Moreover, there exists no solution of the differential equation with continuous derivative unless $\int g\mathit{dx}=0$. These requirements are reflected in the fact that the matrix of this system is singular. If (3.19) is solved by pseudo-inverse, it gives the solution having zero mean: $\sum {y}_{n}/N=0$, using as right-hand-side instead of $\mathit{\Delta}{x}^{2}\mathbf{g}$ the quantity $\mathit{\Delta}{x}^{2}(\mathbf{g}-\sum {g}_{n}/N)$. ${}^{22}$On a structured mesh, a finite volume method is identical to the finite difference method provided this conservative differencing is used. ${}^{23}$The subscript $q$ on ${\mathit{\rho}}_{q}$ reminds us this is charge density, not mass density $\mathit{\rho}$ here. ${}^{24}$Vector dependent variable problems are hyperbolic if the matrix of the coefficients of their differentials is diagonizable with real eigenvalues, as we'll see later. ${}^{25}$Constructed with the distmesh routines from

$({\mathit{\mu}}_{N}-\mathit{\mu}{)}^{2}={(\frac{1}{N}\sum _{1}^{N}({v}_{i}-\mathit{\mu}))}^{2}=\frac{1}{{N}^{2}}\sum _{i,j}^{N}({v}_{i}-\mathit{\mu})({v}_{j}-\mathit{\mu}).$ |

Take the expectation $\u27e8\dots \u27e9$ of this quantity to obtain the variance of the distribution of sample means:

$\u27e8({\mathit{\mu}}_{N}-\mathit{\mu}{)}^{2}\u27e9=\frac{1}{{N}^{2}}\sum _{i,j}^{N}\u27e8({v}_{i}-\mathit{\mu})({v}_{j}-\mathit{\mu})\u27e9=\frac{1}{{N}^{2}}\sum _{i}^{N}\u27e8({v}_{i}-\mathit{\mu}{)}^{2}\u27e9=\frac{{S}^{2}}{N}.$ |

The first equality, taking the expectation inside the sum, is a simple property of taking the expectation: the expectation of a sum is the sum of the expectations. The second equality uses the fact that $\u27e8({v}_{i}-\mathit{\mu})({v}_{j}-\mathit{\mu})\u27e9=0$ for $i\ne j$ because the quantities $({v}_{i}-\mathit{\mu})$ are statistically independent and have zero mean. That is sufficient to yield the required result. Our estimate for the distribution variance is ${S}^{2}={S}_{N}^{2}$. So the unbiassed estimate for the variance of ${\mathit{\mu}}_{N}$ is $\u27e8({\mathit{\mu}}_{N}-\mathit{\mu}{)}^{2}\u27e9={S}_{N}^{2}/N$. The standard error is the square root of this quantity. ${}^{71}$An un-normalized Gaussian distribution has three, including the height. ${}^{72}$Linear interpolation is then equivalent to representing ${p}_{v}$ as a histogram. So adequate resolution may require a fairly large number ${N}_{t}$. ${}^{73}$

${p}_{n}=\frac{N!}{n!(N-n)!}{p}^{n}(1-p{)}^{N-n}=\frac{{r}^{n}}{n!}{(1-\frac{r}{N})}^{N}\left[\frac{1}{{N}^{n}(1-r/N{)}^{n}}\frac{N!}{(N-n)!}\right].$ |

Now recognize that the limit for large $N$ (but constant $n$) of the square bracket term is 1; while the limit of the term ${(1-\frac{r}{N})}^{N}$ is $\mathrm{exp}(-r)$. Therefore the probability of obtaining $n$ total events, of a type that are completely uncorrelated ($N\to \mathit{\infty}$), when their average rate of occurrence is $r$ is

${p}_{n}=\frac{{r}^{n}}{n!}\mathrm{exp}(-r).$ |

This is the discrete Poisson distribution. ${}^{76}$Or double-precision if $N$ is very large. ${}^{77}$The random generators I used here are both portable. The good generator is the

$V=\frac{1}{6}\left|\begin{array}{cccc}\hfill 1\hfill & \hfill {x}_{1}\hfill & \hfill {y}_{1}\hfill & \hfill {z}_{1}\hfill \\ \hfill 1\hfill & \hfill {x}_{2}\hfill & \hfill {y}_{2}\hfill & \hfill {z}_{2}\hfill \\ \hfill 1\hfill & \hfill {x}_{3}\hfill & \hfill {y}_{3}\hfill & \hfill {z}_{3}\hfill \\ \hfill 1\hfill & \hfill {x}_{4}\hfill & \hfill {y}_{4}\hfill & \hfill {z}_{4}\hfill \end{array}\right|$ |

${}^{82}$These important details are discussed in texts devoted to finite elements, such as, Thomas J R Hughes (1987) "The Finite Element Method" Prentice Hall, Englewood Cliffs, NJ. The classic text on the background mathematical theory is, G Strang and G J Fix (1973, 2008) "An Analysis of the Finite Element Method", Reissued by Wellesley-Cambridge, Press, USA. ${}^{83}$Since $f$ is periodic, its value at $j=0$ is the same as at $j=N$, so the range is equivalent to $1,...,N$. ${}^{84}$If $N$ is odd, then the highest frequency is obviously $(N-1)/2$, but we'll avoid reiterating this alternative. ${}^{85}$$\mathit{\epsilon}$ is a small adjustment of the end point to avoid it falling on a delta function. ${}^{86}$An extensive discussion is given in W H Press et al, "Numerical Recipes", chapter 12. Various open source implementations are available. ${}^{87}$A non-zero ${\mathbf{x}}_{0}$ can be removed by reexpressing the equation in terms of $\mathbf{x}\text{'}=\mathbf{x}-{\mathbf{x}}_{0}$. ${}^{88}$The present derivation draws on C P Jackson and P C Robinson (1985) "A numerical study of various algorithms related to the preconditioned conjugate gradient method", International Journal for Numerical Methods in Engineering, Vol 21, pp 1315-1338, and G Markham (1990) "Conjugate Gradient Type Methods for Indefinite, Asymmetric, and Complex Systems" IMA Journal of Numerical Analysis, Vol 10, pp 155-170. ${}^{89}$This is a type of Gramm-Schmidt basis-set construction. ${}^{90}$Succinct descriptions of a wide range of iterative algorithms are given by R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine, H. Van der Vorst (1994) "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods" 2nd Edition, SIAM, Philadelphia, which is available at

1 Initialize: | choose ${\mathbf{x}}_{0}$, ${\mathbf{r}}_{0}=\mathbf{b}-\mathbf{A}{\mathbf{x}}_{0}$, ${\mathbf{p}}_{0}={\mathbf{r}}_{0}$, choose ${\stackrel{\u203e}{\mathbf{r}}}_{0}$, ${\stackrel{\u203e}{\mathbf{p}}}_{0}={\stackrel{\u203e}{\mathbf{r}}}_{0}$, set $k=1$. |

2 Calculate $\mathit{\alpha}$: | ${\mathit{\alpha}}_{k-1}={\mathbf{r}}_{k-1}^{T}{\stackrel{\u203e}{\mathbf{r}}}_{k-1}/{\mathbf{p}}_{k-1}^{T}\mathbf{A}{\stackrel{\u203e}{\mathbf{p}}}_{k-1}$ |

3 Update $\mathbf{r}$s, $\mathbf{x}$: | ${\mathbf{r}}_{k}={\mathbf{r}}_{k-1}-{\mathit{\alpha}}_{k-1}\mathbf{A}{\mathbf{p}}_{k-1}$, ${\stackrel{\u203e}{\mathbf{r}}}_{k}={\stackrel{\u203e}{\mathbf{r}}}_{k-1}-{\mathit{\alpha}}_{k-1}{\mathbf{A}}^{T}{\stackrel{\u203e}{\mathbf{p}}}_{k-1}$, |

${\mathbf{x}}_{k}={\mathbf{x}}_{k-1}-{\mathit{\alpha}}_{k-1}\mathbf{A}{\mathbf{p}}_{k-1}.$ | |

4 Calculate $\mathit{\beta}$: | ${\mathit{\beta}}_{k,k-1}={\stackrel{\u203e}{\mathbf{r}}}_{k}^{T}{\mathbf{r}}_{k}/{\stackrel{\u203e}{\mathbf{r}}}_{k-1}^{T}{\mathbf{r}}_{k-1}.$ |

5 Update $\mathbf{p}$s: | ${\mathbf{p}}_{k}={\mathbf{r}}_{k}-{\mathit{\beta}}_{k,k-1}{\mathbf{p}}_{k-1}$ and ${\stackrel{\u203e}{\mathbf{p}}}_{k}={\stackrel{\u203e}{\mathbf{r}}}_{k}-{\mathit{\beta}}_{k,k-1}{\stackrel{\u203e}{\mathbf{p}}}_{k-1}.$ |

6 Convergence? | If not converged, increment $k$ and repeat from 2. |

HEAD

File translated from T