Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : MMX- lunar eclipse
Author | Message | ||||
cdeagle Senior Member Joined: 22/06/2014 Location: United StatesPosts: 261 |
This post is an MMBASIC computer program for the MicroMite eXtreme which can be used to predict the local circumstances of lunar eclipses. The software uses a combination of one-dimensional minimization and root-finding to calculate these conditions. Here's a typical user interaction with the software. The program will take a minute or so to run to completion. Be patient, it's performing thousands of hardware-based, double precision calculations looking for the answer. The source code listing is 3200+ lines of comments, data statements, white space and actual code. program lunar_eclipse ===================== please input the initial calendar date (month [1 - 12], day [1 - 31], year [yyyy]) < for example, october 21, 1986 is input as 10,21,1986 > < b.c. dates are negative, a.d. dates are positive > < the day of the month may also include a decimal part > ? 12,1,2000 please input the geographic latitude of the observer (degrees [-90 to +90], minutes [0 - 60], seconds [0 - 60]) (north latitudes are positive, south latitudes are negative) ? 39,40,36 please input the geographic longitude of the observer (degrees [0 - 360], minutes [0 - 60], seconds [0 - 60]) (east longitude is positive, west longitude is negative) ? -104,57,12 please input the altitude of the observer (meters) (positive above sea level, negative below sea level) ? 1644 please input the search duration in days ? 30 searching for lunar eclipse ... Here's the program output for this example. total lunar eclipse =================== begin penumbral phase of lunar eclipse -------------------------------------- calendar date January 21 2000 UTC time 2 hours 2 minutes 51.52 seconds UTC julian day 2451564.58531852 topocentric coordinates lunar azimuth angle 83 deg 3 min 50.49 sec lunar elevation angle 22 deg 43 min 45.01 sec greatest eclipse conditions --------------------------- calendar date January 21 2000 UTC time 4 hours 43 minutes 27.56 seconds UTC julian day 2451564.69684679 topocentric coordinates lunar azimuth angle 111 deg 22 min 33.61 sec lunar elevation angle 52 deg 6 min 11.99 sec end penumbral phase of lunar eclipse ------------------------------------ calendar date January 21 2000 UTC time 7 hours 24 minutes 8.60 seconds UTC julian day 2451564.80843287 topocentric coordinates lunar azimuth angle 184 deg 39 min 40.61 sec lunar elevation angle 69 deg 27 min 51.25 sec event duration 5.35474459 hours Here's a zip archive of the MMBASIC source code and MATLAB PDF file for the lunar eclipse computer program. 2017-03-15_171630_lunar_eclipse.zip |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Amazing program and a great demo of the value of double precision floating point. Geoff Graham - http://geoffg.net |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 815 |
Hi Cdeagle, thank you very much for your code! (I'm very curious about your code for calculating the planet positions... ) Frank |
||||
Print this page |