Precision Eclipse Computation
with Wolfram Language
Precision Eclipse Computation
with Wolfram Language
with Wolfram Language
Using Wolfram Language, you can mix computations and narrative all together in one document. In this document, we show a collection of ideas connected to the eclipse. Some of these ideas are directly related to the eclipse, while others are just neat ideas that are extensions of eclipse concepts. This document is a live "notebook" that mixes text and code. Run any piece of code by clicking inside the code, then pressing + .
Introduction
Introduction
This document has been pre-computed for a specific location. To generate outputs for your location, simply change the location in the first input that sets the variable userlocation below.
Locations in Wolfram Language are often represented using GeoPosition. You can also use the Wolfram Knowledgebase to specify locations instead of explicit GeoPosition values, based on natural language queries such as cities, national parks, etc. This is done using + = + "<your query>". When you accept the interpretation, it resolves into a yellow entity box.
Here, we use a location in the path of totality (just click inside the following code and press + ):
In[1]:=
userlocation=["Position"];
Instead of using the Wolfram Knowledgebase for a location, as shown previously, you can also give an explicit GeoPosition, such as userlocation=GeoLocation[{40.1,-88.2}].
Define the eclipse of interest:
In[2]:=
eclipse=SolarEclipse[DateObject[{2024,4,8}]]
Out[2]=
Visualize the path of totality:
In[3]:=
GeoGraphics{GeoMarker[userlocation],Red,SolarEclipse[eclipse,"UmbraEnvelopePolygon"]},GeoRange
Out[3]=
Visualize the area of partiality as well as the area of totality:
In[4]:=
GeoGraphics[{GeoMarker[userlocation],SolarEclipse[eclipse,"PenumbraEnvelopePolygon"],Red,SolarEclipse[eclipse,"UmbraEnvelopePolygon"]}]
Out[4]=
Get the elevation of your location:
In[5]:=
GeoElevationData[userlocation]
Out[5]=
Get a relief map of your location:
In[6]:=
GeoGraphics[{GeoMarker[userlocation]},GeoBackground"ReliefMap"]
Out[6]=
Basic Eclipse Information
Basic Eclipse Information
Make a timetable of when certain events happened:
In[7]:=
Grid[{Text[#[[1]]],TimeZoneConvert[SolarEclipse[eclipse,#[[2]]],"America/Chicago"]}&/@{{"C1",{"LocalPenumbraContact1Date",userlocation}},{"C2",{"LocalUmbraContact1Date",userlocation}},{"Best",{"LocalMaximumEclipseDate",userlocation}},{"C3",{"LocalUmbraContact2Date",userlocation}},{"C4",{"LocalPenumbraContact2Date",userlocation}}},Dividers->All]
Out[7]=
C1 | |
C2 | |
Best | |
C3 | |
C4 |
C1 represents the time when the Moon first touches the Sun’s visible disk; C2 represents the beginning of totality; C3 represents the end of totality; and C4 represents the time when the Moon leaves the Sun’s visible disk.
State Eclipse Maps
State Eclipse Maps
Extract elements useful for annotating the eclipse path on the map:
In[8]:=
dr=TimeSystemConvert[TimeZoneConvert[DateRange[SolarEclipse[eclipse,"ContactPointC1Date"],SolarEclipse[eclipse,"ContactPointC2Date"],Quantity[2,"Minutes"]],0],"UT1"];
In[9]:=
pairs=Dataset[<|"UT1"->#,"ShadowAxisPosition"->SolarEclipse[eclipse,{"ShadowAxisPosition",#}]|>&/@dr[[2;;]]];
Determine the state that the user location is found in and its time zone:
In[10]:=
state=First[GeoNearest["USState",userlocation]]
Out[10]=
In[11]:=
tz=LocalTimeZone[state,eclipse];
Style the annotation information:
In[12]:=
annotations[p_,tz_]:={Thickness[.0025],GrayLevel[1,.5],Sequence@@Table[{{GrayLevel[1,1],Text[Style[" "~~DateString[DateObject[p[[i,1]],TimeZonetz],{"Hour",":","Minute"}]~~" ",10,Bold],p[[i,2]],{0,0},BackgroundGrayLevel[.5]]}},{i,1,Length[p]}]}
Create a customized state map:
In[13]:=
GeoGraphics[{{GeoStyling["StreetMap"],Polygon[state]},Thickness[.005],{Red,SolarEclipse[eclipse,"ShadowAxisLine"],GeoStyling[GrayLevel[0,.2]],SolarEclipse[eclipse,"UmbraEnvelopePolygon"]},annotations[pairs,tz]},GeoBackground"Satellite",GeoRangestate,GeoRangePadding->Quantity[2,"AngularDegrees"]]
Out[13]=
Light Curve
Light Curve
Plot the fraction of the covered Sun (magnitude and obscuration) as a function of time:
Location Features
Location Features
Get the distance to the location of max duration:
Star Configuration
Star Configuration
Determine how the sky looked near the Sun and Moon:
The following manipulate is initialized for Carbondale, Illinois, and doesn’t respond to previous global definitions of userlocation. If you wish to change the results to show the view from a different location, uniconize the initialization code and make the relevant changes to the userlocation there:
Explicitly Solving the Main Lunar Problem Numerically
Explicitly Solving the Main Lunar Problem Numerically
Setting Up the Problem
Setting Up the Problem
Here are these three coupled systems of vector differential equations in explicit form:
Now we use the Wolfram Knowledgebase to get the masses of the Moon, Earth and Sun as well as the gravitational constant:
We measure distances in astronomical units (AUs) and time in days:
We also get the radii of the three bodies:
For the initial conditions, we use the positions (in AUs from the solar system barycenter) and velocities (in AUs per day) of the Moon, Earth and Sun at midnight CT on the day of the eclipse, obtained from a recent DE NASA ephemerides dataset:
Solving the Equations
Solving the Equations
Now we solve the equations of motion for one year:
Plotting the Earth and Moon orbit for one year in a heliocentric coordinate system shows de facto just one curve because the Moon–Earth distance is so much smaller than the Earth–Sun distance, and the Earth (together with the Moon) moves one time around the Sun (the Sun’s movements are so small compared to the Earth’s movements that they are not visible at this scale):
The Shape of the Moon’s Orbit
The Shape of the Moon’s Orbit
Concretely, the Earth–Sun distance is about four hundred times larger than the Moon–Earth distance:
If we “amplify” the distance between the Earth and the Moon, we get the following fictitious Moon orbits:
By looking at just one month of time, one sees that the Moon never moves retrograde. It never even moves “inward”—the orbit of the Moon in a heliocentric coordinate system is strictly convex:
And here is the orbit of the Moon relative to the Earth, meaning in a geocentric coordinate system, plotted over one lunar month:
What are the relative sizes of the forces exerted by the Sun and the Earth on the Moon? The Sun’s force is about twice as large as the Earth’s:
Some Gedankenexperiments
Some Gedankenexperiments
So what would happen if we (as a Gedankenexperiment) ignore either the Earth’s or the Sun’s force on the Moon? Just setting these forces to zero in the equations of motion offers a convenient way to model this situation (we keep the initial conditions from the previous example):
We solve again the equations of motion:
Next, plot the resulting Moon trajectories. Without the Earth pulling on the Moon, the Sun would enforce an elliptical orbit on the Moon. But without the Sun, the Earth would not be able to keep the Moon attracted, and after a year the Moon would have flown a distance of 6.3 AU away:
Umbra and Penumbra Modeling
Umbra and Penumbra Modeling
To model the shadow cast by the Moon onto the Earth, let us first consider a 2D model. The Sun and the Moon become circles in a plane that contains a line through their centers.
Calculating tangents on two circles is straightforward:
The following interactive demonstration shows the penumbra and umbra behind the Moon. Note that for large distances between the Sun and the Moon, the two cones of the penumbra and umbra effectively become cylinders:
For the Moon, the angles at which the penumbra and umbra cones deviate from a cylinder are on the order of 2 arcseconds:
Now we can use the positions of the Moon, Earth and Sun (calculated previously) to sketch the eclipse. The functions umbraLightRays and penumbraLightRays are used:
Make a model of the Earth:
Let us compute the orientation of the Earth’s polar axis. It is perpendicular to the Sun–Earth line at equinoxes.
The following data was computed using the JPL DE405 ephemerides:
Here is the resulting interactive example that shows the outer boundaries of the umbra and penumbra cones. The slider variable lets you change the time of day:
Time Systems
Time Systems
Precise computation of eclipses requires very good control of the timing of the orbital motions of the Sun and Moon relative to the Earth, and of the timing of the diurnal rotation of the Earth with respect to the distant stars. The rotation of the Earth is not homogeneous, due to both unpredictable internal effects and a progressive slowdown caused by tidal effects from the Moon. Therefore, two different “time systems” are needed:
• A homogeneous time axis for solar system ephemerides: This is currently implemented using atomic clocks, which are so precise that it is possible to distinguish the different ticking of identical clocks placed in different areas of a gravitational field, as predicted by general relativity. We shall assume the so-called terrestrial time (TT), effectively implemented by atomic clocks at sea level (the geoid).
• A time axis that follows the rotation of the Earth: This is the so-called UT1 time, and it is implemented by a combination of astronomical observations that keep track of how the Earth rotates.
Take data for UT1 and the leap seconds added since 1972:
This shows TAI–UTC in blue and TAI–UT1 ± 0.9s in orange since the beginning of 1960. To obtain differences with respect to TT instead of TAI, add 32.184 seconds:
Eclipse computations usually report their value of ΔT to explain how their ephemerides’ computations are related to their computations for the rotation of the Earth.
High-order series expansions have historically played an important role in the calculations of the position of the Moon. Fortunately, various small parameters, such as the mass ratio of the Moon mass to the Sun mass or the orbit eccentricities are available. A typical feature of these expansions is that they are very large.
Now we look for an expansion of the following form:
Such large symbolic calculations are ideally suited for computer algebra, an area in which Wolfram Language is very strong.
The values of the second-order terms are just the right-hand side of the equations of motion, expressed through the initial conditions:
In terms of the initial positions and velocities, this looks like:
For higher-order terms, we differentiate the right-hand side of the equations of motion, then use the equations of motion to replace all second-order derivatives to obtain an expression that contains only positions and first-order time derivatives:
The expression soon gets quite large, so we suppress the output:
Substituting numerical values for the masses, initial positions and initial velocities, we obtain numerical values for the expansion coefficients:
We sum up the terms:
Plotting the difference of the series expansions to the numerical solution shows that higher-order terms approximate the numerical solution well:
The General Three-Body Problem
The General Three-Body Problem
Here on Earth, we are spoiled by the regular movements of the Sun, Earth and Moon. In general, the movement of three bodies that attract each other gravitationally yields much more complicated movement—not just elliptical orbits.
These are the general equations of motion for the three bodies:
Here are some concrete values for the three masses, as well as initial positions and velocities:
After solving the three differential equations, the three bodies are seen to carry out much more complicated movements:
Here are the intricate trajectories that result from the previous initial conditions:
Daily Sunspot Count
Daily Sunspot Count
You may have a telescope with a solar filter allowing safe views of the Sun. In such a case, you may be interested in observing sunspots disappear as the Moon moves across the face of the Sun. It is interesting to know how many sunspots are on the face of the Sun that might be subject to such an observation.
Determine the most recent daily sunspot count:
Determine the daily sunspot count for a different date:
Current Solar Images
Current Solar Images
The Solar Dynamics Observatory (SDO) orbits the Earth and maintains a nearly constant observation of the Sun from space using a variety of instruments and wavelengths. One of these instruments is the Helioseismic and Magnetic Imager (HMI), which provides an approximate visible wavelength view of the Sun (6173 angstroms).
Obtain a current image of the Sun as seen from space:
During an eclipse, the disk of the Sun will be obscured, but various features of the lower solar atmosphere, including prominences, may become visible using safe optical aids. Some of those lower-atmospheric features can be seen using other wavelengths/instruments onboard SDO. The following image may be used as a guide for features to look for along the solar rim during totality:
In addition to prominences, which are found near the solar disk, the solar corona also becomes visible during totality. The corona extends far from the solar disk. Images from the SOHO LASCO C3 instrument, which artificially masks the solar disk and simulates a total solar eclipse, can be used to provide a preview of how the corona may appear during totality:
More about Sunlight
More about Sunlight
Using the Wolfram Knowledgebase, much data related to and relevant for the eclipse can be accessed—for instance, the solar irradiance spectrum:
Or the abundance of elements in the Sun:
For a given element, one can retrieve its spectral lines; here, the ones in the visible wavelength range are shown for the 10 most common elements of the Sun:
And here are spectra of ionized carbon: