Friday, March 1, 2019

I am looking for an algorithm to calculate Molad Tishrei for any given year


I am using MS Excel together with VBA (Visual Basic for applications) to write macros to calculate Molad Tishrei.


I have located information in various web sites that explain how to calculate Molad Toshrei for 1 year if I know the Molad of the previous year. However, I cannot use a fixed calculation for determining the Molad of a random year, since I don't know how many leap years occurred since that random year, and the result comes out incorrectly.


I found some web articles that explain the overall concepts, but I need a step by step algorithm or math formula that works. I.e. - if I know when Molad Toshrei for 5774 was, and I want to find out Molad Tishrei for 5790, how do I do that?


Ideally, if someone has written VB code or done this in Excel, that would be great. However, even if I have a "simplified" stepwise English-explained algorithm, that would work as well.


You don't have to answer with code, of course. A link would be fine. If you have tested the code yourself and verified that it works, even better!



Answer



Here's a detailed explanation, with pseudocode-like notation. http://individual.utoronto.ca/kalendis/hebrew/molad.htm#calc.


The following is my own summary:


MonthlyMoladDifference = 29 days + 12 hours + (44 + 1/18) minutes.


MoladTishrei5775 = [...]
NewMolad = MoladTishrei5775

for(year=5775; year IsLeapYear = [0, 3, 6, 8, 11, 14, 17] contains (year % 19)
if(isLeapYear) then
NewMolad += 13 * MonthlyMoladDifference
else
NewMolad += 12 * MonthlyMoladDifference

}
// NewMolad now contains the molad for Tishrei of the current year.

NewMolad += (months since Tishrei) * MonthlyMoladDifference
// NewMolad now contains the molad for the current month

No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...