Errors and Uncertainties in Computations Errors and Uncertainties ...
Errors and Uncertainties in Computations Errors and Uncertainties ...
Errors and Uncertainties in Computations Errors and Uncertainties ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Subtractive Exercise (cont)<br />
2. Three equivalent (math) sums:<br />
S (1)<br />
N<br />
=<br />
S (2)<br />
N<br />
=<br />
S (3)<br />
N<br />
=<br />
2NX<br />
n=1<br />
NX<br />
n=1<br />
NX<br />
n=1<br />
(−1) n<br />
2n<br />
2n +1 −<br />
n<br />
n +1 . (1)<br />
1<br />
2n(2n +1)<br />
N X<br />
n=1<br />
2n − 1<br />
2n<br />
(even & odd), (2)<br />
(partial sums). (3)<br />
Write program to calculate S(1), S(2), S(3) 1 N 100<br />
Assume S(3) is exact<br />
Log-log plot relative error: log 10 | S(1) N<br />
−S(3) N<br />
| vs log 10<br />
(N)<br />
Get expected straight l<strong>in</strong>e?<br />
S (3)<br />
N<br />
Introductory Computational Science Lab 2<br />
© Rub<strong>in</strong> L<strong>and</strong>au, EPIC/OSU 2005