Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

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

  1. #11

    Default

    So after thinking that it was wrong, I went through everything a couple more times. Turns out what I did incorrectly was checking my answer on the Navy site I posted earlier. I forgot to enter time zone when picking a location. Once I did that, the times I got for sunrise and sunset using the equations I posted were within 5 minutes of the correct times!

    It's not done yet though. To get from hour angle (the last value I solved for in my previous post) to the times, I used the equations on the Sunrise Equation Wikipedia page, which involve the Julian date. Obviously, another planet would not use Julian date. What matters is the time elapsed since epoch though, so it should be a simple matter of defining my own epochs, using an equivalent of the Julian date. This would make use of the custom planet's day length, so all of parameters involving time will need to take that into account. This means using ratios to change the length of my second and the value of my gravitational constant.

    Now, if only I could code...
    Last edited by snoopy; 07-19-2012 at 02:47 PM.

  2. #12

    Default

    here's a basic c/c++ script i use when i need to calculate stuff..


    #include <fstream>
    #include <stdlib.h>
    #include <windows.h>
    #include "math.h"
    #include "iomanip.h"
    #include <iostream>

    using namespace std;

    ofstream out;

    int main() {
    double o;

    out.open("solve.txt");

    for(int i = 2700; i <= 2800; i++) {

    o = (double)i;
    o += 5773500000;
    o *= .0000000001;
    o = o - o * o * o;

    out << setprecision(16) << i << ",\t" << o << "\r\n";
    }

    out.close();

    return 0;
    }


    ..here's the same thing with annotations... i use an old compiler.. borland's fclt.. which is a 5 meg install. low commitment, still works.. simple as such to use..




    #include <fstream> // necessary for writing txt file
    #include <stdlib.h> // stuff you write
    #include <windows.h> // not necessary in this program
    #include "math.h"
    #include "iomanip.h" // necessary for setprecision statement
    #include <iostream> // necessary for writing txt file

    using namespace std; // stuff you write

    ofstream out; // open filestream to write a file

    int main() { // begin main program statement
    double o; // declare a double length floating point variable

    out.open("solve.txt"); // create text file

    for(int i = 2700; i <= 2800; i++) { // do the calculations i needed

    o = (double)i;
    o += 5773500000;
    o *= .0000000001;
    o = o - o * o * o;

    out << setprecision(16) << i << ",\t" << o << "\r\n"; // write variables i and o to text file, with a tab and a line break
    }

    out.close(); // close file

    return 0; // execution of program ends
    }

  3. #13
    Guild Novice
    Join Date
    Jul 2013
    Location
    Michigan
    Posts
    15

    Default

    I have an English degree and I can't do anything beyond fifth-grade math, so if you even understand the last post, you are light-years beyond me. But I would remind you: any astrophysics of multiple stars and planets also involve laws of physics. If you have a long time span in mind for the focus of a planet, or multiple planets, eventually their orbital velocities and speeds of rotation taper off. I don't know if you'll get that precise, but it is a factor to consider. Also- a somewhat obvious point- the binary system creates significantly more heat than a single medium-sized "yellow" star. Any planetoid with Terran qualities in temperature cannot be the same size and relative distance from the system's center.

    I hope that is not too confusing. It's hard to articulate things like this when so many people think two-dimensionally. Good luck with your creative endeavor!

  4. #14

    Default

    I don't think I ever saw this last post, so I might as well respond (and hope I don't get this thread closed for being necro'd).

    I don't need it to be so accurate as to include orbital/rotational slowing over time. I'm pretty sure I decided to disregard Milankovich cycles for the most part as well. Just way too many factors. I suppose I'll have to think about Milankovich cycles in vague terms if I want to guesstimate (which is apparently an accepted word here) ice age times.

    To answer the second part, that shouldn't be an issue at all. The planet orbits only one of the stars in the system. The second star is a lowly K-class star that is 80 AU distant at closest approach, which adds essentially zero heat.

    Unfortunately, that code means nothing to me either. This whole endeavor got put on hold anyway. I'll pick it up again some time, but I don't think the time is now.

Page 2 of 2 FirstFirst 12

Posting Permissions

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