Tuesday, February 07, 2006

Physics 20 Reading List #6

This week there are two parts to the reading: the first is about ordinary differential equations; the second illustrates the use of logarithmic scales to produce clearer graphs.

1. Numerical Integration of ordinary differential equations

After reading through the first part of the assignment (but before tackling it), read Ch. 16.0 in Numerical Recipes.

2. Graphing: using a logarithmic scale

Tufte's rule for producing beautiful graphs: above all else, show the data. Sometimes showing the data is much easier using a logarithmic scale than on a linear scale. For example, compare the following two graphs, which both show the error in Integral[Exp[x],{x,0,1}] computed with the N-point extended trapezoidal formula and with the N-point extended Simpson's Rule (this example may be familiar :).


Note that in the first graph, you really cannot see most of the data; the only information you get from this graph is that the error decreases with N for small N (you can't see it for large N), and that Simpson's Rule is better than the Trapezoidal Rule, again for small N.



The second graph, which was made using the same data, is plotted on a log-log scale rather than a linear-linear scale. What an improvement! You can now see all the data, and from the graphs you can determine that the error behaves like a power law. Furthermore, you can see from the graph that the error in the extended Trapezoidal Rule scales as 1/N^2 and the error in the extended Simpson's Rule scales as 1/N^4 (by looking at the slopes of the two curves).

0 Comments:

Post a Comment

<< Home