Solutions for homework assignment #2

Solution program [inertia.f90]

A run for the case of the 5 cm sphere with a 1 cm inner cylinder, made of copper and gold, respectively, gave the following results (average and errors of Ix and Iz after each 10^5 step bin, stopping when the relative error of both quantities is less than eps=0.001):
    1          0.0047045734             NaN        0.0049770784    0.0000000000
    2          0.0047070661    0.0000017626        0.0049626889    0.0000101749
    3          0.0047234163    0.0000134015        0.0049655108    0.0000071639
    4          0.0047133494    0.0000133053        0.0049550252    0.0000105513
    5          0.0047077014    0.0000117822        0.0049545036    0.0000084539
    6          0.0047021198    0.0000110619        0.0049462451    0.0000103182
    7          0.0047012592    0.0000095150        0.0049481774    0.0000090233
    8          0.0046955375    0.0000098975        0.0049449019    0.0000084690
    9          0.0046920539    0.0000093909        0.0049416094    0.0000081429
   10          0.0046938560    0.0000086230        0.0049441229    0.0000077068
   11          0.0046944982    0.0000078630        0.0049461666    0.0000072721
   12          0.0046958480    0.0000073227        0.0049493473    0.0000073288
   13          0.0046938449    0.0000070280        0.0049500340    0.0000067971
   14          0.0046933723    0.0000065419        0.0049494446    0.0000063371
   15          0.0046948479    0.0000062699        0.0049514169    0.0000062140
   16          0.0046935844    0.0000060040        0.0049492709    0.0000061851
   17          0.0046934146    0.0000056532        0.0049491679    0.0000058221
   18          0.0046938952    0.0000053596        0.0049498738    0.0000055413
   19          0.0046936391    0.0000050836        0.0049495672    0.0000052581
   20          0.0046936416    0.0000048294        0.0049494278    0.0000049970
   21          0.0046939780    0.0000046112        0.0049500226    0.0000047944
Since there are fluctuations also in the statistical errors, the number of bins needed to achieve this accuracy will vary somewhat.