Paragraph 1: First calculate how many days are in a year, then use a certain method to calculate the number of surplus and deficit days, which refer to adjustments in the lunar calendar. This number of surplus and deficit days is used to adjust the positions of the day and month each day. If the calculated number of days is insufficient or exceeds the limit, another method is used to adjust, ultimately determining the accurate positions of the day and month.

Paragraph 2: Multiply a certain number of half-weeks by the remaining days after the new moon, then divide by a total, and subtract this result from the remaining days in the calendar. If there are not enough days left to subtract, add a week and subtract again, then work backwards day by day to determine the corresponding date in the calendar for midnight.

Paragraph 3: Calculate the second day by counting from the remaining days up to twenty-seven. If the remaining days are exactly a multiple of a week, subtract them; if not a multiple, add the insufficient part, and the remaining days will be the number of days left for the second day.

Paragraph 4: Multiply the remaining days from midnight by a gain and loss rate, then divide by a week. If there is a remainder, use it to adjust the accumulated profit and loss. If the remainder cannot be adjusted, use a fixed value to adjust it, obtaining the profit and loss value for midnight. After calculating for a year, the integer part represents degrees, while the decimal part represents minutes. Multiply the total by the minutes and remainder, adding the remainder to the minutes if it can be divided by a week, or adding it to the degrees if the minutes are full. Finally, use the profit and loss value to adjust the degrees and remainder for midnight, obtaining the final degree.

Paragraph 5: Multiply the remaining days by a depreciation value, then divide by a week. The remainder represents the daily depreciation rate.

Paragraph 6: Multiply the virtual number by the depreciation value, divide by the week number to get a constant. After calculating the calendar, add this constant to the variable depreciation value. If it exceeds the depreciation value, subtract it, then proceed to calculate the variable depreciation for the next calendar cycle.

Paragraph 7: Use the variable depreciation value to adjust the degrees and minutes of each day in the calendar. If the minutes are insufficient or exceed the limit, use the annual profit and loss degrees to adjust. Multiply the total by the minutes and remainder, then add the degrees from midnight to get the degrees for the second day. If after calculating a calendar cycle, the number of days is not a multiple of a week, subtract 1338, then multiply by the total; if it is a multiple, add 837, then add a smaller fraction of 899, and then add the variable depreciation value for the next calendar cycle, and continue the calculations as previously done.

Section 8: Subtract from or add to the profit and loss rate the decay value of change to obtain a new profit and loss rate, then use this new profit and loss rate to adjust the profit and loss value at midnight. If the profit and loss value is not enough after the calendar calculation, subtract it back and handle the remainder as before.

Section 9: Multiply the monthly running score by the number of night hours during the latest solar term, then divide by 200 to get a bright score. Subtract this bright score from the monthly running score to get a dark score. If the score can be divided evenly by a year, multiply the total by the score, then add the midnight score to get the score for dark and bright periods. If the remainder is more than half, keep it; otherwise, discard it.

Section 10: The moon's movement is represented by four tables, entering and exiting through three channels, and runs in the sky. Dividing the moon's movement rate by this data will determine the number of days in the calendar. Multiply the weekly number by the synodic month number, then divide by the lunar month number to get the synodic month score. Multiply the total by the synodic month number, divide the remainder by the lunar month number to get the retreat score. Then add the monthly weekly number to get the daily progress score. Divide by the lunar month number to get the difference rate.

Yin and Yang calendar, decay, profit and loss rate, multiple

Day 1: subtract 17, resulting in a profit of 17; initial limit is 1290, decimal part is 457.

Day 2: subtract 15, resulting in a profit of 33.

Day 3: subtract 12, resulting in a profit of 48.

Day 4: subtract 8, resulting in a profit of 60.

Day 5: subtract 4, resulting in a profit of 68.

Day 6: subtract 3, resulting in a profit of 72.

Day 7: resulting in a profit of 73.

Day 8: resulting in a profit of 71.

Day 9: resulting in a profit of 65.

Day 10: resulting in a profit of 55.

Day 11: resulting in a profit of 42.

Day 13: final limit is 3912, decimal part is 1752.

Day 1: add 1, subtract 16, resulting in 27.

The Lesser Da method yields a result of 473.

The historical week count is 107,565.

The difference rate is 11,986.

The synodic month score is 18,328.

Differential is 914.

The method of differentiation is 2290.

Subtract the upper month from the total accumulated months, and then separately multiply the new moon and differential by the result. When the differential reaches its set value, it is subtracted from the total, and similarly, when the total completes a full cycle, it is also subtracted; the leftover part that doesn't complete a full cycle represents the entry into the solar calendar. When it is full, it is deducted, and the remainder is the entry into the lunar calendar. The rest is calculated like the monthly cycle to get an extra day, which is additionally calculated, and the required monthly new moon entry, the remaining part is the daily surplus.

After adding two days, the daily surplus becomes 2580, the differential remains 914, and following the method, this is converted into days; when it reaches 13, it is deducted, and the remainder is processed according to the daily division. The lunar and solar calendars ultimately interconnect, with the entry into the calendar before the remainder of the first half and after the remainder of the second half, with the moon running to the midpoint.

Set the entry for late and early calendar fullness and reduction into small divisions, multiply the total by the small divisions to get the differential, adjust the fullness and reduction by adding the lunar and solar daily surplus; if the daily surplus is insufficient, adjust the date. Multiply the confirmed daily surplus by the profit and loss rate, like the monthly cycle, to get 1, using the overall profit and loss figure as the constant for additional time.

Multiply the difference rate by the new moon's small remainder, like the differentiation method, to get 1; if it is not enough, add the monthly cycle and then subtract, and then subtract one day. Next, add the daily division to its total, simplifying the differential into smaller divisions, marking the new moon's entry into the calendar at midnight.

The next day, add one day, thirty-one days, and the small division is also thirty-one days. If the small division and the remaining days are added together, when it fills the monthly cycle, it is deducted, and then add one day; after the calculation of the calendar, if the remaining days fill the small division, it is deducted, which is the first day of entering the calendar. If the remaining days don’t fill the small division, they stay the same, adding 2720, the small division is 31, which is the calculation method for entering the next calendar.

Multiply the total number by the midnight fullness and reduction of the late and early calendar and the remaining days; when the remaining days fill half a cycle, it is treated as a small division, using fullness and reduction to calculate the lunar and solar daily surplus; if the daily surplus is insufficient, use the monthly cycle to adjust the days. Multiply the confirmed daily surplus by the profit and loss rate; if the monthly cycle equals one, use the total profit and loss figure as the confirmed midnight value.

Multiply the profit and loss rate by the midnight value of the most recent solar term; one two-hundredth is bright, using the reduction and loss rate for dusk, while using the profit and loss midnight number for the confirmed value of dusk and dawn.

If the dimming and brightening determine a value for overtime, divide by twelve to obtain degrees, with one third of the remainder considered as "less," and less than one minute being strong, while two strong values count as less and weak. The resulting value is the month away from the ecliptic degree. The solar calendar uses the ecliptic calendar where the sun is located for extreme degrees, while the lunar calendar uses subtraction, which is the month away from extreme degrees. Strong is positive, weak is negative; strong and weak are added together, like names are added, unlike names are subtracted. When subtracting, like names are canceled, unlike names are added, with no mutual cancellation.

Starting from the Jichou year of the Yuan dynasty to the Bingshu year of the Jian'an era, a total of 7378 years have been accumulated.

Jichou Wuyin Dingmao Bingchen Yisi Jiayin Guiwei

Ren Shen Xin You Geng Xu Jihai Wuzi Ding Chou Bing Yin

Five Elements: Wood, Jupiter; Fire, Mars; Earth, Saturn; Metal, Venus; Water, Mercury. Each is associated with the day and heavenly degrees, serving as the weekly rate and daily rate. The annual value multiplied by the weekly rate gives the monthly law. The monthly value multiplied by the daily rate gives the monthly fraction. The monthly fraction divided by the monthly law gives the month number. The total number multiplied by the monthly law gives the daily degree law. The Dou fraction multiplied by the weekly rate gives the Dou fraction. (The daily degree law uses the calendar law multiplied by the weekly rate, hence "fraction" is also used here for multiplication.)

The five stars' new moon results include a large remainder and a small remainder. Using the total law multiplied by the month number, and dividing by the daily law to obtain the large remainder, with the indeterminate part as the small remainder. Divide the large remainder by sixty.

The five stars' entry into month and day, day remainder. Using the total law multiplied by the month remainder, and the combined month law multiplied by the new moon small remainder, adding them together, simplifying, and dividing the resulting figures by the daily degree law to obtain all results.

The five stars' degree and degree remainder. Subtracting the excess gives the degree remainder; multiply the weekly sky by the degree remainder, simplify using the daily degree law, resulting in the degree, with the indeterminate part as the degree remainder, exceeding the weekly sky being subtracted, and adding Dou fractions.

The calendar month has 7285.

The chapter leap is 7.

The total number of months in the chapter is 235.

There are twelve months in a year.

The total value calculated by the law of [specific context] is 43026 (the specific meaning of "total law" needs to be clarified in context). The daily value is 1457. The meeting number is 47. The weekly sky number is 215130. The Dou fraction is 145.

For Jupiter, the weekly rate is 6722, the daily rate is 7341, resulting in a total month count of 13, with a month remainder of 64810. The total month law is 127718, the daily degree law is 3959258, the new moon large remainder is 23, the new moon small remainder is 1370, the day of entry into the month is 15, the day remainder is 3484646, the virtual fraction of the new moon is 150, the Dou fraction is 974690, the degree is 33, and the degree remainder is 2509956.

Mars: The orbital period is 3447, the daily rate is 7271, the total number of months is 26, the month remainder is 25627, the total months is 64733, the daily law is 2006723, the major remainder is 47, the minor remainder is 1157, the day of the month is 12, the day remainder is 973113, the major virtual fraction is 300, the minor fraction is 494115, the degree is 48, the degree remainder is 1991760.

Saturn: The orbital period is 3529, the daily rate is 3653, the total number of months is 12, the month remainder is 53843, the total months is 6751, the daily law is 278581, the major remainder is 54, the minor remainder is 534, the day of the month is 24, the day remainder is 166272, the major virtual fraction is 923, the minor fraction is 511750, the degree is 12, the degree remainder is 1733148.

Venus: The orbital period is 9022, the daily rate is 7213, the total number of months is 9, the month remainder is 152293, the total months is 171418, the daily law is 5313958, the major remainder is 25, the minor remainder is 1129.

The first day is the twenty-seventh.

It has been fifty-six thousand nine hundred and fifty-four days.

The virtual fraction is three hundred and twenty-eight.

The minor fraction is one million three hundred nineteen thousand eight hundred ninety.

The degree is two hundred and ninety-two.

It has been another fifty-six thousand nine hundred and fifty-four days.

The orbital period for water is eleven thousand five hundred and sixty-one.

The orbital period for day is one thousand eight hundred and thirty-four.

The total month is one.

The month remainder is two hundred and thirteen thousand three hundred and thirty-one.

The total months is two hundred and nineteen thousand six hundred and fifty-nine.

The daily law is six hundred eighty-nine thousand four hundred and twenty-nine.

The major remainder is twenty-nine.

The minor remainder is seven hundred and seventy-three.

The second day is the twenty-eighth.

It has been six million four hundred and nineteen thousand six hundred and sixty-seven days.

The virtual fraction is six hundred and eighty-four.

The minor fraction is one million six hundred seventy-six thousand three hundred and forty-five.

The degree is fifty-seven.

It has been another six million four hundred and nineteen thousand six hundred and sixty-seven days.

Alright, next is the calculation method: first multiply the year number you want to calculate by the orbital period, then divide by the daily rate, see how many you can get; if it is exactly an integer, it indicates which year it corresponds to. If it is not an integer, the remainder is the total remainder. Divide the orbital period by the total remainder; the result indicates which year it corresponds to. If the result is 2, then it is the previous two years. If it does not divide evenly, then it is this year. Then subtract the total remainder from the orbital period to get the degree part. The combination of Venus and Mars, odd numbers are in the morning, even numbers are in the evening.

Then multiply the number of months and the remaining months by the combined total value. If the result is greater than or equal to the total number of months, subtract the total number of months to get the remaining months. Subtract the accumulated months from the total months to get the entry months. Multiply by the intercalary month value; if the result is greater than or equal to the intercalary month, subtract the intercalary month to get the intercalary month. Then subtract from the year; this is the total number of months calculated outside of the Tianzheng method. If it is an intercalary exchange, use the new moon to control.

Multiply the remaining months by the general method, then multiply by the total number of months for the new moon, and then divide by the number of meetings. If the result is greater than or equal to the daily calculation method, subtract the daily calculation method to get the entry month. If the result is less than the daily calculation method, the remainder is noted as the daily remainder, recorded outside of the new moon calculation.

Multiply the number of weeks by the degrees; if the result is greater than or equal to the daily calculation method, subtract the daily calculation method to get the remainder, recorded as degrees, starting from Niuqianwu.

The method for calculating the conjunction of stars is as follows: add up the number of months and the remaining months. If the result is greater than or equal to the total number of months, subtract the total number of months to get the number of months. If it is less than the total number of months, it indicates the current year. If it is greater than or equal to the total number of months, subtract it, record the intercalary month, and the remainder is the next year; if it is greater than the total number of months again, it indicates the next two years. The relationship is that adding 'jinshui' to 'morning' gives 'evening', and adding 'evening' gives 'morning'.

Finally, add up the new moon and the remaining days, then add the total number of months and the remaining days. If the result is greater than or equal to the monthly method, add twenty-nine (large remainder) or seven hundred and seventy-three (small remainder). If the small remainder is greater than or equal to the daily calculation method, subtract from the large remainder, using the same method as before.

Let's talk about calculating the days first. Add the entry day and the remaining days. If the sum is a perfect multiple of a full day, then it is correct. If the remaining days are not full at the time of the new moon, subtract one day; if the remaining days exceed 773, subtract 29 days; if less than 773, subtract 30 days; the remaining days are the new moon days of the next month.

Next, let's talk about how to calculate the degrees. Add the degrees and the remainder of the degrees. If the sum is a perfect multiple of a full day, it results in one degree.

Here are the data for Jupiter:

Jupiter hides for 32 days, 3484646 minutes; appears for 366 days.

Hiding runs 5 degrees, 2509956 minutes; the apparent motion covers 40 degrees. (Retrograde 12 degrees, actual run 28 degrees.)

Data for Mars:

Mars hides for 143 days, 973113 minutes; appears for 636 days.

Hiding runs 110 degrees, 478998 minutes; appearing runs 320 degrees. (Retrograde 17 degrees, actual run 303 degrees.)

Data for Saturn:

Saturn hides for 33 days, 166272 minutes; appears for 345 days.

Venus operates in hiding for 3 degrees and 1,733,148 minutes, and manifests for 15 degrees.

Venus Data:

Venus hides in the east for 82 days, 113,908 minutes; appears in the west for 246 days. (Retrograde 6 degrees, actual operation 240 degrees.)

Venus hides in the east for 100 degrees and 113,908 minutes; it appears in the east. (Like with the west, it hides for 10 days and is retrograde for 8 degrees.)

Data for Mercury:

Mercury hides in the east for 33 days, 612,505 minutes; appears in the west for 32 days. (Retrograde 1 degree, actual operation 31 degrees.)

Mercury operates in hiding for 65 degrees and 612,505 minutes; it appears in the east. (Like with the west, it hides for 18 days and is retrograde for 14 degrees.)

Finally, let's discuss how to calculate the days and degrees when celestial bodies appear. Calculate the days and remainder of the celestial body hiding, and add the remainder of the degree of the conjunction of the celestial body. If the remainder is a multiple of a full degree, it counts as one day, and so on; we can calculate the days and degrees of the celestial body's appearance. Multiply the denominator of the celestial body's operation by the degree of manifestation, calculate the remainder using the method of days; if it cannot be divided evenly and exceeds half, it counts as one degree. Then add the operation score, and if the score is full, one degree is obtained. The methods for retrograde and direct operation are different: multiply the denominator of the actual operation by the original score, and divide the result by the original denominator to get the actual operation score. The remaining score continues from before; subtract for retrograde. If the number of hidden days is less than the degrees, use the degrees for division; the score will increase or decrease, affecting each other. Any statement that says "as close to full as possible" indicates a need for precise division; both "remove" and "divide" refer to methods of exhaustive division.

In the morning, the sun and Jupiter appeared simultaneously, and Jupiter then went into hiding. After that, Jupiter began to move forward, and after 16 days, which is equivalent to 1,742,323 minutes, it traveled 2 degrees and 3 minutes and 47 seconds, then appeared in the east after sunrise, trailing behind the sun. It moved quickly, traveling 11/58 degrees each day, covering 11 degrees in 58 days. Then it slowed down, traveling 9/58 degrees each day, covering 9 degrees in 58 days. After that, it stopped for 25 days before resuming its movement. Next, it entered retrograde motion, moving backward 1/7 degree each day, retreating 12 degrees in 84 days. After stopping again for 25 days, it started moving forward once more, traveling 9/58 degrees each day, covering 9 degrees in 58 days. Then its speed increased again, moving 11/58 degrees each day, covering 11 degrees in 58 days. At this point, it was positioned ahead of the sun, setting in the west at dusk. After 16 days, which is equivalent to 1,742,323 minutes, it traveled 2 degrees and 3 minutes and 47 seconds, reappearing simultaneously with the sun. One cycle concluded, lasting 398 days, or 3,484,646 minutes, with Jupiter having traversed 43 degrees and an additional 2,509,956 minutes of angular distance.

In the morning, the sun and Mars appeared simultaneously, and Mars then went into hiding. After that, Mars began to move forward, and after 71 days, which is equivalent to 1,489,868 minutes, it traveled 55 degrees and 1 minute and 28 seconds, then appeared in the east after sunrise, trailing behind the sun. It moved 14/23 degrees daily, totaling 112 degrees over 184 days. Then it slowed down to 12/23 degrees per day, covering 48 degrees over 92 days. After that, it stopped moving for 11 days. Then it entered retrograde motion, moving backward 17/62 degrees each day, retreating 17 degrees in 62 days. After stopping again for 11 days, it started moving forward once more, traveling 12/60 degrees each day, covering 48 degrees over 92 days. Then its speed increased again, moving 14/23 degrees each day, covering 112 degrees in 184 days. At this point, it was positioned ahead of the sun, setting in the west at dusk. After 71 days, which is equivalent to 1,489,868 minutes, it traveled 55 degrees and 1 minute and 28 seconds, reappearing simultaneously with the sun. One cycle concluded, lasting 779 days, or 973,113 minutes, with Mars having traversed 414 degrees and an additional 4,789,998 minutes of angular distance.

In the morning, the sun and Saturn rise together. Saturn first moves in a direct path, covering 1,122,426.5 minutes within sixteen days, where one degree of planet movement corresponds to 1,995,864.5 minutes. At this point, you can see Saturn in the eastern sky, behind the sun. When moving directly, Saturn travels 35/3 minutes daily, covering 7.5 degrees in 87.5 days. It then stops for 34 days. After that, it goes retrograde, moving 1/17 minutes daily, retreating -6 degrees in 102 days. After another 34 days, it starts moving direct again, traveling 1/3 minutes daily, covering 7.5 degrees in 87 days, at which point Saturn is in front of the sun, setting in the west in the evening. Within sixteen days, it travels 1,122,426.5 minutes, with the planet moving one degree equating to 1,990,586.4 minutes, at which point it again appears simultaneously with the sun. One cycle lasts a total of 378 days, with the planet moving 12.1733148 degrees.

In the morning, the sun and Venus appear simultaneously. Venus first moves retrograde, slipping back four degrees in five days, at which point Venus can be seen in the east in the morning, positioned behind the sun. During its retrograde motion, Venus travels 5/3 degrees each day, retreating six degrees in ten days. It then halts for eight days. Then it moves direct, at a slower speed, traveling 33/46 degrees each day, covering 33 degrees in 46 days. Then it speeds up, moving 15/91 degrees each day, covering 106 degrees in 91 days. The speed continues to increase, moving 22/91 degrees each day, covering 113 degrees in 91 days, at which point Venus is behind the sun, setting in the east in the morning. After 41 days of direct motion, it travels 56,954 minutes, with the planet moving 50 degrees in 56,954 minutes, at which point it again appears simultaneously with the sun. One conjunction lasts a total of 292 days, with the planet moving the same degree.

In the evening, the sun and Venus appear simultaneously. Venus starts off moving direct, traveling 56,954 minutes in 41 days, with the planet moving 50 degrees in 56,954 minutes, at which point Venus can be seen in the west in the evening, positioned in front of the sun. While moving direct, it speeds along, traveling 22/91 degrees each day, covering 113 degrees in 91 days. It then slows down, moving 15/91 degrees each day, covering 106 degrees in 91 days. The speed continues to decrease, moving 33/46 degrees each day, covering 33 degrees in 46 days. It then halts for eight days. Then it goes retrograde, traveling 3/5 degrees each day, retreating six degrees in ten days, at which point Venus is in front of the sun, setting in the west in the evening. While retrograding, it quickly slips back four degrees in five days, at which point it again appears simultaneously with the sun. Two conjunctions complete one cycle, lasting a total of 584 days, with the planet moving the same degree.

Mercury, when it meets the Sun in the morning, first it hides, then it moves in retrograde. After nine days, it moves back seven degrees, and then it can be seen in the east behind the Sun. It continues to move retrograde at a fast speed, moving back one degree each day. Then it stops and remains motionless for two days. After that, it turns and moves direct, at a slow speed, traversing nine-eighths of the Sun's daily movement, moving eight degrees in nine days, and then it accelerates, moving one and a quarter degrees each day, covering twenty-five degrees in twenty days, until it runs behind the Sun. In the morning, it appears in the east, then moves direct, traversing six hundred forty-one million nine hundred sixty-seven thousand minutes over sixteen days, moving thirty-two degrees in six hundred forty-one million nine hundred sixty-seven thousand minutes, and then it meets the Sun again. The total time for this conjunction is fifty-seven days and six hundred forty-one million nine hundred sixty-seven thousand minutes, with Mercury traveling the same distance.

When Mercury meets the Sun at night, it first it hides, then it moves direct, traversing six hundred forty-one million nine hundred sixty-seven thousand minutes over sixteen days, moving thirty-two degrees in six hundred forty-one million nine hundred sixty-seven thousand minutes, and then it can be seen in the west, positioned ahead of the Sun. It continues to move direct at a fast speed, moving one and a quarter degrees each day, covering twenty-five degrees in twenty days. Then it slows down, covering nine-eighths of the Sun's daily movement, moving eight degrees in nine days. It then stops and remains motionless for two days. After that, it turns and moves retrograde, retreating one degree each day, until it runs in front of the Sun, hiding in the western sky at night. It then continues retrograde, moving slowly, retreating seven degrees in nine days, and meets the Sun again. Two conjunctions count as one cycle, totaling one hundred fifteen days and six million two thousand five hundred five minutes, with Mercury covering the same degrees.