evaluating code from post
evaluating code from post
In[]:=
AstroPosition,"Equatorial"["Declination"]
Out[]=
13.56
In[]:=
NumberForm[13.56,16]
Out[]//NumberForm=
13.55997680699307
In[]:=
sunDeclination//ClearAllsunDeclination[date_?DateObjectQ]:=AstroPosition,{"Equatorial",date}["Declination"]
In[]:=
DateListPlotTable{date,sunDeclination[date]},date,DateRange,
Out[]=
In[]:=
FindMinimum[sunDeclination[DateObject[{2022,12,21,0,0,s},TimeZone->0]],{s,0,86400}]
Out[]=
{-23.4381,{s78754.2}}
In[]:=
DateObject[{2022,12,21,0,0,s/.Last[%]},TimeZone->0]
Out[]=
In[]:=
AstroPosition,"Ecliptic"["Longitude"]
Out[]=
36.1186
In[]:=
sunLongitude//ClearAllsunLongitude[date_?DateObjectQ]:=AstroPosition,{"Ecliptic",date}["Longitude"]
In[]:=
DateListPlotTable{date,sunLongitude[date]},date,DateRange,
Out[]=
In[]:=
FindRoot[sunLongitude[DateObject[{2022,12,21,0,0,s},TimeZone->0]]-270,{s,0,86400}]
Out[]=
{s78493.}
In[]:=
DateObject[{2022,12,21,0,0,s/.Last[%]},TimeZone->0]
Out[]=
What is the difference between the two?
In[]:=
Out[]=
This is a function for the ecliptic definition of the winter solstice.
In[]:=
WinterSolstice//ClearAllWinterSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-270,{s,0,86400}]]},TimeZone->0]
In[]:=
WinterSolstice[2003]
Out[]=
In[]:=
WinterSolstice[2023]
Out[]=
In[]:=
WinterSolstice[2022]
Out[]=
This computes the winter solstice defined by declination.
In[]:=
DeclinationWinterSolstice//ClearAllDeclinationWinterSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindMinimum[sunDeclination[DateObject[{year,12,21,0,0,s},TimeZone->0]],{s,0,86400}]]},TimeZone->0]
In[]:=
DeclinationWinterSolstice[2022]
Out[]=
Here is are two tables of winter solstices, one for each definition.
In[]:=
Table[DeclinationWinterSolstice[year],{year,2005,2025}]
Out[]=
,,,,,,,,,,,,,,,,,,,,
In[]:=
Table[WinterSolstice[year],{year,2005,2025}]
Out[]=
,,,,,,,,,,,,,,,,,,,,
Here are the differences.
In[]:=
Table[DeclinationWinterSolstice[year]-WinterSolstice[year],{year,2005,2025}]
Out[]=
,,,,,,,,,,,,,,,,,,,,
The minimum and maximum of the difference between the two definitions.
In[]:=
MinMax[%]
Out[]=
,
In[]:=
Table[Abs[DeclinationWinterSolstice[year]-WinterSolstice[year]],{year,2005,2025}]
Out[]=
,,,,,,,,,,,,,,,,,,,,
I applied the absolute value.
In[]:=
MinMax[%]
Out[]=
,
In[]:=
SummerSolstice//ClearAllSummerSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-90,{s,0,86400}]]},TimeZone->0]
In[]:=
SummerSolstice[2022]
Out[]=
In[]:=
VernalEquinox//ClearAllVernalEquinox[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-0,{s,0,86400}]]},TimeZone->0]
In[]:=
VernalEquinox[2022]
Out[]=
In[]:=
AutumnalEquinox//ClearAllAutumnalEquinox[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-180,{s,0,86400}]]},TimeZone->0]
In[]:=
AutumnalEquinox[2022]
Out[]=
In[]:=
EquinoxesAndSolstices//ClearAllEquinoxesAndSolstices[year_?IntegerQ]:=<|"spring"->VernalEquinox[year],"summer"->SummerSolstice[year],"autumn"->AutumnalEquinox[year],"winter"->WinterSolstice[year]|>
Now I can make a manipulate for equinoxes and solstices.
