|
Go to Keith's Home page |
Keith's automated astrolabe (a Java applet) |
Go to Keith's Java applet index page |
A version with even more buttons is:
eot2.zip.
(The accompanying web page is out of date.)
This applet was created to allow me to determine whether values for the Equation of Time can be calculated using a simple formula rather than being obtained from either a graph or a table. I'm quite unable to tackle the problem mathematically, and the thought of finding a solution empirically was quite appealing.
Primarily, the applet displays the Equation of Time using values extracted from an almanack.
It also displays a graph of
a.sin(b + theta) + c.sin(d + (2*theta))
and a graph of the difference between them.
(theta = number of days since Jan 1st * 360/365)
Buttons allow a, b, c and d to be adjusted up and down. The most positive and negative errors are also shown, so it is possible to adjust the values until ones giving the minimum error are found.
The technique is dependent upon the accuracy of the original data as well as on the accuracy of the computing system - different computers may give marginally different results.
I was only looking for an accuracy of less than a minute,
and using
-7.32 * sin(-4.05 + theta) - 10.08 * sin(19.99 + (2*theta))
would appear to give me an error of less than half a minute.
These values are now programmed into the applet as the starting values. The buttons allow them to be adjusted up and down, but any change gives a greater error, at least on my computer. I thought of presetting into the program values which would provide room for improvement - clicking systematically on the eight buttons to minimise the error is at least as much fun as playing many of the computer games I have seen people play.
It would be possible for me to reduce the amplitude of the increment obtained with each button press which would allow values to be determined that provide a marginally reduced error, but it hardly seems necessary. A much greater reduction could be achieved by introducing another term into the formula.
It proved to be an interesting experiment, and obtaining the data from the library and preparing and using the program took less than three days work. Because the program is intended to be a tool to provide a result, it wasn't necessary to remove the obvious shortcomings such as the blinking of the window (despite buffering) and the sporadic display of excessively long numbers.
Keith. 11th November 1999.