anyone knows how to calculate muslim prayer time?


Closed Thread
Results 1 to 11 of 11
  1. #1
    luqman83salleh's Avatar
    luqman83salleh Guest

    Default anyone knows how to calculate muslim prayer time?

    hello.. anyone knows how to calculate muslim prayer times using picbasicpro.. the problem is to calculate muslim prayer times, complex formulae needed like :



    (R-L) T
    Z = 12+ ----- + --- ........1
    15 60




    1 {sin(-0.8333-0.0347(H)^0.5)}-sinD.sinB
    U= -- arccos -------------------------------------- ........2
    15 cosD.cosB




    1 -sinG-sinD.sinB
    V= -- arccos --------------- ........3
    15 cosD.cosB




    1 sin{arccot(1+tan(B-D)}-sinD.sinB
    W= -- arccos -------------------------------- ........4
    15 cosD.cosB




    1 sin{arccot(2+tan(B-D)}-sinD.sinB
    X= -- arccos -------------------------------- ........5
    15 cosD.cosB




    where

    B= latitude of place
    L= longitude of place
    R= reference longitude (i.e. TIME BAND x 15)
    H= height above sea level in metres
    D= declination angle of sun from celestial equator (-ve in southern hemisphere)
    T= equation of time
    G= twilight angle

    Fajr = Z-V
    Sunrise = Z-U
    Zuhr = Z
    Asr1 (Shafi) = Z+W
    Asr2 (Hanafi) = Z+X
    Maghrib/Sunset = Z+U
    Isha = Z+V

    such formulas above are very complex to implement in picbasicpro.. any help to implement in pbp those formulas will be very appreciated..

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Luq,

    I think it can be done without too much work... A few subroutines to do the Arc* formulas. In Calculus, you can use Series on the Arc* rountines. PBP does do floating calculations.

    The only problem you may have, is the Accuracy. If you want just a rough idea, that is fine...If you want to have exact, or close to exact, you will not achieve this. Especially since Dividing in PBP will leave you (at most) a 16 bit number that is usuable. And when you Multilply and Divide so many times, that 16 bit number becomes a rather rough number.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Add-in a GPS so the PIC knows where you are, GyroCompass so you know which way to point to Mecca, and a $1999.95 price tag for sale in Saudi Arabia, and you're a self-made millionaire... you saw the idea here first folks! What a forum...

    Already got a whole range accessories planned, leather carrying case, roll-up Bluetooth wireless prayer mat that detects when it's in use and automatically silences the reminder alarm...

    I just knew I should have gone into sales rather than engineering...

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,

    Melanie>>Add-in a GPS so the PIC knows where you are, GyroCompass so you know which way to point to Mecca, and a $1999.95 price tag for sale in Saudi Arabia, and you're a self-made millionaire... you saw the idea here first folks! What a forum... <<

    too late! I have already called my Patent attorney...I am not going to admit that I got the idea from this forum.....<g>

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5
    carl_schell's Avatar
    carl_schell Guest


    Did you find this post helpful? Yes | No

    Cool

    luqman salleh -

    One other possible option for you to consider...

    I would assume that the sunni muslim religion would have tables available for all prayer dates for the comming year(s)...or...

    These dates could be calculated very accurately and very easily on a calculator or computer, and then placed in a lookup table. Hook up an RTC (Real Time Clock) device such as the DS 1307 that Ralph recently turned me onto, that has very nice accuracy and even keeps track of leap years, and you could simply call the appropriate prayer time based on this. I do not mean to sound like this is a flawless method, but it is a different possible approach and may offer you added comfort of accuracy.

    As you are interested in this, I have attached a very cool program I found on the internet a few years back for calculating the phase of the moon...used in calculating Ramadan. I have many Muslim friends that would be very excited about your idea! Best of luck to you and let us know how your project goes...we are all happy for you!

    Best Regards,

    Carl


    -------------------------------------------------------
    PIC Development Boards with Bootloader!

    www.schellelectronics.com

    e-mail: [email protected]

    Free shipping worldwide
    -------------------------------------------------------
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    You people are unbelievable! Especially Melanie (with the hidden preference in leather is suspect...!).

    Well to answer the mans problem (!) may be a table in a external EEPROM would be more quick to retrive the data than calculate them?

    Excel could help in calculating the data.

    Ioannis

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Smile

    *smiles*

  8. #8
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Ioanus,

    I>>You people are unbelievable! Especially Melanie (with the hidden preference in leather is suspect...!).

    Well to answer the mans problem (!) may be a table in a external EEPROM would be more quick to retrive the data than calculate them?<<

    Could you upload the exact formulas for your idea?
    I just may get a wild hair, and make a program on the chip for this.

    The reason why, is because I used to do a LOT of satellite communications from both low orbit and Geo-stationary Sats. Ran many different modes of communication through them. And in order to communicate with Low orbit Sats, you had to use a program to see if it is in "Line of Sight" for communication. The same principal can is being used in your religious prayer time.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  9. #9
    luqman83salleh's Avatar
    luqman83salleh Guest


    Did you find this post helpful? Yes | No

    Default tq all of u who support me

    thank u all of member who support me....
    i will try my best to make it done well...
    ok
    thank for the information
    if any member from malaysia plz contact me...
    we can study together....
    see u next time...
    bye...

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Well Dwayne, I do not have something ready right now. But you can use the formulas at the top of the thread, put the results in an EEPROM after some rounding and I guess you are ready to run.

    This is a good solution when you have to calculate some data based on a complicated formula with MCUs. Like the Sinewaves, you calculate the numbers, put them in EEPROM, and after that on run time, values are retrieved and output, filters and voila ... a close sinewave signal in no time! (Well the distortion may be a little more than analog oscilator but... nobody is perfect).

    Ioannis

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, everybody,

    For complex math calculations ... i've seen co-processors on Melabs site, called PAK XX...
    That's not the fastest solution ...but it's an easy solution to use !!!
    Floating point is there usable ...

    Alain

Similar Threads

  1. calculate time between pulses
    By hell_pk in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 20th October 2007, 16:49
  2. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  3. Replies: 1
    Last Post: - 18th April 2006, 19:11
  4. How to calculate machine time in basic code?
    By chai98a in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd February 2006, 23:44
  5. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts