Traditional Culture Encyclopedia - The 24 Solar Terms - Lunar calendar calculation method
Lunar calendar calculation method
The lunar calendar is a combination of yin and yang, which is not only the new moon used in the lunar calendar, but also the solar terms used in the solar calendar. Pingqi and Pingshuo were first used in lunar calendar, but Pingshuo often has a one-day error, which is even more inconsistent with solar eclipse verification. Therefore, the method of developing experience is changed to the method of determining the new moon. There are also mistakes in calming the qi, but it is difficult to observe it simply, and the method of calming the qi is easy to break the principle of "standing upright without balancing the qi" in the lunar calendar, so it has not been adopted before the Qing Dynasty. Until the development of modern calendar, based on the requirements of accuracy and harmony, the rules had to be revised again. See point 3 for details.
So to calculate the lunar calendar, we must find out the new moon of the lunar calendar and calculate the ecliptic of the sun and the moon. Modern astronomy uses planets to calculate the position of celestial bodies. Python has third-party libraries that provide related functions. Taking PyEphem library as an example, the algorithm provided in this paper calculates SolarTerms through solar terms function, while Heshun directly uses the next_newmoon function provided in the library to calculate solar terms.
The lunar calendar is fixed for twelve months in a year, corresponding to 12 China Qi. If there are 13 months, then there must be 1 month without breath, which is a leap month, so the breath with a fixed monthly sequence is also fixed. The corresponding relationship is:
Confirmed this correspondence, we can use parameters I and J to record the number of combinations and gas serial numbers. When there is no gas in one month, the corresponding gas sequence of next month is still last month.
Although the current lunar calendar takes rainy days as the first month, some rules and calculations of the calendar actually start from the winter solstice, and the first month of the year is 1 1 month. Jian Zheng is only used to determine the starting month of the annual main branch. Because the calculation of calendar depends on the observation of astronomical phenomena, especially the determination of the length of a year needs to measure the number of days between the same solar terms, only the winter solstice or the summer solstice can be easily determined by comparing the shadow lengths of the previous days, and the calculation of calendar begins here. However, in order to combine with phenology and facilitate the needs of agricultural production and work, the first month is defined as breathing in the rain as the beginning of middle age in daily life.
FindDZS function in the program deals with the problem of finding the beginning of a year.
The interval between the two winter solstices is about 365.2422 days in the tropical year and 29.53059 days in the first lunar month, so it may be 12 or 13 times. When balancing qi, the length of qi must be greater than a new moon, so there will be no qi for one month. After adopting the constant gas method, the gas length is not fixed, so there is no neutral gas for several months in a year or neutral gas for many months in a month, so it is stipulated again (the higher the serial number, the higher the priority): (see note)
Original 1: judge whether there is neutral gas every month, and set a leap if there is no neutral gas.
Add 2: Set only the first neutral month from winter to the sun and moon.
Supplement 3: If the new moon is only 12 times between two winters and the sun and the moon, there will be no leap.
The basic principle of whether to set leap is to ensure that the lunar month ordinal number of a year is equal to 12 (middle gas number), and most of them are set leap, starting from the last month, and if they are insufficient, they will not leap. See the table below for detailed analysis.
Judge whether there is neutral gas, that is, the neutral gas I corresponding to J month is in the next month or I is in the last month and i+ 1 gas is in j+ 1 month. It can be determined by comparing I gas and i+ 1 gas with J and the calendar days before and after the new moon. However, we can find a property. If Zhongqi appeared in the last month, then the number of conjunctions from that month must be equal to the number of luck, so it is not appropriate to set a leap. So we only need to judge one condition, that is, there may be a leap when Chinese enterprise I enters j+ 1 next month.
It is proved that the number of gas combinations in China last month is equal to the gas number: let the gas length be U and the crescent moon length be V, with 32 >; u≥v & gt; 29、u-v & lt; 2.8。 Let i+ 1 have m gas from the winter solstice of the following year * *, I+65438+1month have m month or m+ 1 month from the winter solstice of the following year * *. Because there must be neutral gas from winter solstice, i+ 1 gas must rain or later, so 0 ≤ m ≤ 650. Yizhi VM < = um & ltvm+v.)
According to the solar terms, there must be 12 solar terms in a year, so its stem and branch sequence cycles every five years. According to the calculation of trunk and branches directly, the method is to find out the trunk and branches of any year with heavy snow and solar terms, and then find out the remainder of 60 in that year. If the trunk and branches of this year are removed by heavy snow, the trunk and branches of year 0 (BC 1) can be obtained, and the order is 12. Therefore, the trunk and branches at the beginning of any year should be added with 12 of that year, and the trunk and branches in solar months should be added with the order of solar terms. It can also be considered that the order of solar terms corresponds to the order of earthly branches, so the aerial trunk can be calculated by the above method and then spliced into trunk branches.
Method 1: Judging from the solar calendar (the method used in the program):
The dates of solar terms are relatively fixed in the solar calendar. Since the number of solar terms in each year is the same as the number of months in the Gregorian calendar, the solar terms in each month are also determined, just need to know the date of the solar terms in that month. In each month, the date on and after the same day is the main branch of solar terms, and the monthly branch of the date before the same day is the previous branch of solar terms.
However, the length of the solar calendar is not completely equal to the tropic year, and the error between the current Gregorian calendar and tropic year is very small. However, julian calendar did not consider the precession factor, which led to the change of the corresponding relationship between solar terms and month order, and needed to be dealt with.
Method 2: According to the lunar calendar:
The order of solar terms corresponds to the local branch, not to the monthly construction, because there may be months with or without solar terms, so it is not possible to judge the solar term months directly according to the lunar month order.
Because the heavy snow is not fixed after the winter solstice, we can start looking for it in winter. Use leveling method to roughly find out the solar terms that should be on the Gregorian calendar date, then use constant gas method to compare the actual solar terms, and get the order of solar terms, and finally add the stem and branch of the first solar term of the year.
The order of branches in a year is calculated from the first month of that month (or from beginning of spring according to the solar terms). The first month is the third month of the winter solstice, so it is actually to compare whether the lunar month converted from Gregorian calendar is after silver moon and belongs to the previous year.
The method of calculating annual branches and expenditures is similar to that of solar terms. If you get the trunk and branches of 0 year (BC 1 year), you can know the trunk and branches of any year. (Or if the branches are calculated separately, the Geng Shen is 6 and 8 respectively, and the number of branches (10) and the number of branches (12) can be calculated separately in the calendar year).
In 2033, although there was a neutral month, there were only 12 new moons. In order to ensure that there are 12 months in a year, it is not a leap.
There are two neutral months in 2034, but because the new moon will not exceed 13 times, at least one of them will not leap, so the principle that the neutral month appears first and the leap comes first is adopted. Note that this "first" starts from the solstice in winter, not the first month.
Note: In the Qing Dynasty, the Draft of Thoughts on Poets and Immortals: "To seek a leap month, there was a month of winter solstice in the first two years. Accumulated in mid-March, with the month without neutral gas, it jumped from last month. One-year-old airless people are placed in an airless month. "
- Previous article:Shanweide special tea
- Next article:Is there a season and time requirement for spraying water on orchid leaves?
- Related articles
- Do solar terms have anything to do with temperature?
- How to write a review?
- How many days are there in Runnian lunar calendar?
- The temperature difference between the Millennium morning and evening is large. Eat red dates and black-bone chicken to replenish liver and kidney and benefit the spleen and stomach.
- What year is Renwu?
- Heavy snow solar terms color matching
- How about Adidas Night Elf Series?
- Spring Festival couplets, wedding couplets, birthday couplets, elegiac couplets, decorative couplets, industry couplets, communication couplets, funeral couplets, scenery couplets, aphorisms and misce
- Five elements numerology analysis: What about the tiger baby born in 2022 with heavy snow and solar terms?
- Why do China people like to boycott foreign festivals, but they like to promote foreigners to celebrate China festivals? For example, there will be news reports, and now more and more people like ST.