Page 1 of 2 12 LastLast
Results 1 to 10 of 14
Like Tree1Likes

Thread: How do I calculate sunrise/sunset times for non-Earth planets?

  1. #1
      snoopy is offline
    Guild Novice
    Join Date
    Oct 2011
    Posts
    7

    Default How do I calculate sunrise/sunset times for non-Earth planets?

    I am trying to create a world, and I don't like to do things halfway. So I am starting from scratch: new star, new planet. I plan to keep them similar to Earth, but not exactly, which means I can't just use Earth data for sunrise/sunset and moonrise/moonset times, like I could find here: http://aa.usno.navy.mil/data/docs/RS_OneYear.php.

    What I am hoping to get is some sort of algorithm that would allow me to calculate these times for any planet, hopefully using custom time scales.

    Input variables would include:
    • velocity of revolution
    • rotational velocity
    • orbit as defined by Keplerian orbital elements (length of year being calculated from ellipse size and velocity of revolution.)
    • axial tilt
    • distance at aphelion and perihelion (Those are probably already defined by the Keplerian orbit. Is that correct?)
    • planet radius (Does this matter, or is rotational velocity the only relevant input for day length?)
    • Time unit length (As in, having a planet where the inhabitants' hour is not the same length of time as our hour. In other words, I would like to use custom time units, and define day length in terms of them.)
    • probably more because I don't understand enough


    I would also like to be able to calculate the points of sunrise/sunset and the arc that the sun would take through the sky.

    Does anyone know of a program that would allow me to do this, and hopefully create tables such as the one in the link I posted? Or perhaps a planetary simulation program that would at least allow me to account for everything except point 7? I'm willing to be flexible on that, because it's likely more trouble than it's worth. Or perhaps there is someone on this forum with enough knowledge in astrophysics and programming to create such a program (unlikely, but I thought I'd ask)? Even a set of equations that would require manual solving would be a start.

    Or am I mad to even consider attempting this level of detail for the sake of a fictional world?

    Oh, and did I mention that it's in a binary star system, so I have an extra star whose positioning over time I will also need to track?

    Anyway, hope my request is clear. Please ask for any clarification you need.

  2. #2
      Gidde is offline
    Community Leader Gidde's Avatar
    Join Date
    May 2009
    Location
    Michigan, USA
    Posts
    2,992

    Default

    I think your best bet is most likely Celestia (it's free, and it's awesome -- http://www.shatters.net/celestia/). What it does is allow you to create a custom star system with the variables you mention, plus a few others, and then models it for you so that you can see exactly what it looks like. You can find some great tutorials at http://www.celestiamotherlode.net/ca...mentation.html -- I'd start with the Introduction to Celestia Add-ons by Selden Ball, Jr. It goes through the process of creating a fictional star system. From there you'll know which tuts to look for.

    As for whether you're mad to consider this level of detail: I've done it, so if you're mad so am I! Also consider that (arguably) what made Tolkien great was the insane amount of detail he put into his fictional world. So as far as I'm concerned, you're making it better with each detail.

  3. #3
      xoxos is offline
    Guild Journeyer
    Join Date
    Apr 2012
    Posts
    144

    Default

    i asked if there was any interest in such a program a month or so ago.. this is the only positive comment i've seen yet.

    even without a script, you ought to be able to get there with some basic trig. if you want to write something and get involved, all the data is out there of course.. perhaps the henon oscillator model would allow you to feel sufficiently technically involved

  4. #4
      snoopy is offline
    Guild Novice
    Join Date
    Oct 2011
    Posts
    7

    Default

    Quote Originally Posted by Gidde View Post
    I think your best bet is most likely Celestia (it's free, and it's awesome -- http://www.shatters.net/celestia/). What it does is allow you to create a custom star system with the variables you mention, plus a few others, and then models it for you so that you can see exactly what it looks like. You can find some great tutorials at http://www.celestiamotherlode.net/ca...mentation.html -- I'd start with the Introduction to Celestia Add-ons by Selden Ball, Jr. It goes through the process of creating a fictional star system. From there you'll know which tuts to look for.

    As for whether you're mad to consider this level of detail: I've done it, so if you're mad so am I! Also consider that (arguably) what made Tolkien great was the insane amount of detail he put into his fictional world. So as far as I'm concerned, you're making it better with each detail.
    I took a look at it, but I think I prefer Space Engine. It's free too, and from what I've seen of what can be done in Celestia, even more awesome. More types of navigation controls, and most importantly, in addition to known celestial objects, Space Engine populates the rest of the universe with procedurally generated ones. As in millions of galaxies with trillions of star systems to explore. And you can land on all of the planets, stars, moons, etc. and explore the procedural terrains. It also allows you to create and import your own stars, planets, etc. with orbits defined by those parameters. I've actually got the two stars done and orbiting properly. No planets yet though.

    Here's the link, if you don't know about this program yet: http://en.spaceengine.org/. If your computer can run it (it has rather high requirements), it's about the best thing you'll ever download.

    But what these programs can't do that I know of is tell me the time of sunrise and sunset at a given location on a given date. The closest I could get was focusing on a particular longitude and latitude on a planet and watching the day/night boundary go by in Celestia. That's a bit cumbersome and imprecise unfortunately. What I really need is something like the Navy link I posted, something that will output charts with dates and times.

    That Celestia tutorial had some nice links to information on orbital elements, by the way.

    And yes, I completely agree about Tolkien. It might be that I am nerdy enough to be most of the way through the History of Middle-Earth books... Learning enough about linguistics and philology to create a good language might take me a while though. One thing at a time.

    Lastly, you said you've done high detail work: Did you attempt anything similar? If so, how did you handle it?

    Quote Originally Posted by xoxos
    i asked if there was any interest in such a program a month or so ago.. this is the only positive comment i've seen yet.

    even without a script, you ought to be able to get there with some basic trig. if you want to write something and get involved, all the data is out there of course.. perhaps the henon oscillator model would allow you to feel sufficiently technically involved
    I would most definitely be interested. It's a shame (if an unsurprising one) that there hasn't been any other interest. And that basic trig is one thing I'm hoping to learn, since I don't know how to apply it to this problem at the moment. Sadly, I lack the expertise to program anything, so I doubt I could turn it into automated form even after I learn the math.

  5. #5
    Guild Artisan Gracious Donor
    Facebook Connected
    vorropohaiah's Avatar
    Join Date
    Feb 2010
    Location
    35.921568 N,14.480068 E
    Posts
    922

    Default

    great link! I've been looking for something like this for my world for a while.

    edit: though my graphics card is somewhat crap, so not sure i can run these effectively. will certainly try them though

    call me mad too

  6. #6
      Gidde is offline
    Community Leader Gidde's Avatar
    Join Date
    May 2009
    Location
    Michigan, USA
    Posts
    2,992

    Default

    Quote Originally Posted by snoopy View Post
    Lastly, you said you've done high detail work: Did you attempt anything similar? If so, how did you handle it?
    I'm still in the midst of that detail work, but I've done the modeling in celestia and then watching the horizon I'm currently working on world map and culture/languge creation.



    Sent from my iPhone using Tapatalk

  7. #7
    Guild Artisan Gracious Donor
    Facebook Connected
    vorropohaiah's Avatar
    Join Date
    Feb 2010
    Location
    35.921568 N,14.480068 E
    Posts
    922

    Default

    Quote Originally Posted by Gidde View Post
    I'm still in the midst of that detail work, but I've done the modeling in celestia and then watching the horizon I'm currently working on world map and culture/languge creation.
    do you hav a blog or any threads following your progress? i always like seeing what other people are up to.

    sorry for the OT post

  8. #8
      xoxos is offline
    Guild Journeyer
    Join Date
    Apr 2012
    Posts
    144

    Default

    Quote Originally Posted by snoopy View Post
    I would most definitely be interested. It's a shame (if an unsurprising one) that there hasn't been any other interest. And that basic trig is one thing I'm hoping to learn, since I don't know how to apply it to this problem at the moment. Sadly, I lack the expertise to program anything, so I doubt I could turn it into automated form even after I learn the math.
    tbh i think it would be fastest to blag it with a sine. take the sine of the date as a % of the year and set your minimum and maximum for summer and winter. you'd be close enough just to linear fade between them.

  9. #9
      snoopy is offline
    Guild Novice
    Join Date
    Oct 2011
    Posts
    7

    Default

    I have actually found a fair amount on the way it is calculated on Earth now. I still have to read more to understand it, but I think I have at least figured out how to use novel time scales, which is to define them in terms of angle. 1 hour on Earth (a sidereal hour) is equivalent 15 degrees around the axis of rotation. You can simply redefine an hour in terms of the number of degrees out of 360 the planet rotates in that time period. If you know the angular velocity of its rotation, then I think it should be easy to use this value in the 'normal' Earth equations.

    This is very useful: http://en.wikipedia.org/wiki/Sunrise_equation

    I should have known to go to Wikipedia first.

  10. #10
      snoopy is offline
    Guild Novice
    Join Date
    Oct 2011
    Posts
    7

    Default

    EDIT: I was right after all!

    I'm probably being hasty, posting before I test my results, but I think I can solve for the hour angle now, which I believe I can use to get time using the method from my previous post.

    Here we go:

    1. Get the Mean Anomaly. You can do this by simply picking a value between 0 and 360, but it is the time since the planet last passed perihelion moving at its mean motion. In math terms:

    M = sqrt((G/(m1+m2))/a^3)*t
    where
    M is the mean anomaly
    G is the gravitational constant in m^3 kg^-1 s^-2 (which you could define in terms of your custom time scale)
    m1 and m2 are the masses of your orbiting bodies in kg
    a is the semi-major axis of your planets orbit in meters
    t is the time in seconds (don't forget to convert to custom time if you did that for the gravitational constant as well)

    2. Use the mean anomaly to calculate the equation of center, which is the difference between true anomaly (actual angle along the ecliptic) and mean anomaly (which treats the ecliptic as a circle). This is done with the (accurate to 4 decimal places) approximation

    C = (2e-0.25e^3)*sinM + 1.25e^2*sin2M + (13/12)e^3*sin3M
    where
    C is the equation of center
    e is the eccentricity of the orbit (which you will need to decide on yourself)
    M is the mean anomaly (I think it needs to be in degrees, even though it would appear to output an answer in radians. This seems wrong, but it gave me the correct answer when I was following an explanation. This will definitely be something I double check)

    3. Find the ecliptic longitude using

    λ = M + C + Π + 180
    where
    λ is the ecliptical longitude
    Π is the longitude of perihelion (pericenter, periapsis) in degrees (you obtain this by adding the Argument of Perihelion and the Longitude of the Ascending Node, both of which you will have from defining your orbit. If you do it in Space Engine, remember that the values in that are relative to our sun. You will need to get the difference in those values between your sun and your planet)
    180 because it is the sun viewed from the planet, not the planet viewed from the sun

    4. Find the declination of the sun using

    sinδ = sinλ + sinA
    where
    δ is the declination
    A is the axial tilt in degrees

    5. Calculate the hour angle using

    cosω = (sin(-0.83)-sin(Phi)*sinδ) / (cos(Phi)*cosδ)
    where
    ω is the hour angle
    -0.83 degrees because of atmospheric refraction (assumes Earth-like atmosphere)
    Phi is the latitude of the observer

    And there it is, generalized for other planets. Correctly, I hope.

    I found this link very helpful: http://aa.quae.nl/en/reken/zonpositie.html
    Last edited by snoopy; 07-19-2012 at 02:36 PM.

Page 1 of 2 12 LastLast

Posting Permissions

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