garbage day
|
11-04-2024, 05:21 PM
(This post was last modified: 11-04-2024 11:02 PM by Albert Chan.)
Post: #7
|
|||
|
|||
RE: garbage day
I made mistakes for a 'forever' formula, thus post removed, and start over.
I was playing with error = lo .. high, not realized Δy, Δm sign can be switched. Maximum error is bigger, due to symmetry. There are 97 leap years in 400 years, 97/400 = 0.2425 It so happen 365.2425 * 400 = 146097 = 7*20871 days, exactly. If we can prove formula correct for 400 years, it is 'forever' correct. Brute force check for days error, if key year end's in 00 Note: keydate day number doesn't matter, it can be anything! Δd does not change. This is why I use d0=0 for brute force check. Code: function key_year_error(y0) lua> for y=0,300,100 do printf("%03d %8.4f %8.4f\n", y, key_year_error(y)) end 000 -2.9825 -2.9775 100 -3.6644 -3.7275 200 -3.4144 -3.4775 300 3.6644 3.7275 Both estimated weeks formulas work if key year is divisible by 200, with errors within 3.5 days. It would be nice if we can just look up "good" key date from calendar. Lets shift only months instead, and check if it would still work for 400 years. Code: function key_month_error(m0) lua> for m=1,12 do printf("%-3d %8.4f %8.4f\n", m, key_month_error(m)) end 1 -3.8288 -3.9550 2 -4.3919 -4.4550 3 4.3919 4.4550 4 3.8288 3.9550 5 4.2656 4.4550 6 3.7025 3.9550 7 4.1394 4.4550 8 3.5762 3.9550 9 -3.5762 3.4550 10 3.4500 3.9550 11 -3.7025 3.4550 12 3.3237 3.9550 We have a few options here, all brute force confirmed valid. (month close to February error would be bad, as expected) Δw = round((365.2425*(Δy + Δm/12) + Δd)/7), work if key month = 10, 12 Δw = round((365.2425*Δy + 30.5*Δm + Δd)/7), work if key month = 9, 11 It is arbitrary, I pick 'forever' formula with least days error. Δw = round((365.2425*(Δy + Δm/12) + Δd)/7), key month = December For previous keydate = 2024/11/5, move down calendar by 4 rows --> 2024/12/3 (no math) Or, we keep the same keydate, but only "make" the month as December. 2024/11/5 ≡ 2024/12/(5-30) ≡ 2024/12/(-25) |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
garbage day - DrD - 11-01-2024, 08:11 AM
RE: garbage day - john gustaf stebbins - 11-02-2024, 03:28 AM
RE: garbage day - DrD - 11-02-2024, 08:23 AM
RE: garbage day - john gustaf stebbins - 11-02-2024, 06:12 PM
RE: garbage day - Albert Chan - 11-02-2024, 03:50 PM
RE: garbage day - Albert Chan - 11-04-2024 05:21 PM
RE: garbage day - DrD - 11-03-2024, 05:53 AM
|
User(s) browsing this thread: 1 Guest(s)