Modeling stellar orbits

Started by
94 comments, last by taby 13 years, 4 months ago
That sounds strange?

Anyway, you can do it entirely differently, and much cooler. Look what this one does :-)

Work in progress. Simulation is scrollable and zoomable with mouse and keyboard.

Cheers,
Mike
Advertisement
Is that your own work? I assume it is, and in a way that really makes me sad because it looks like you've got almost as much as I have done in very little time.

May I ask how you did it? I'm extremely interested!
No go.

Don't worry about it though.

If you show source maybe I could take a look at it, though.
@Chuggin

I've been working with this stuff for years. Don't ever let it discourage you that others have come further than you. I don't mind posting the source, but it won't help you unless you know a little about orbital mechanics. Google that and orbital elements, and soon you'll have figured it out yourself. It's much more rewarding that way.

@JoeCooper

What happened? Did you get a fullscren window, a console or anything? This really should work on any windows machine running any screen res.

Cheers,
Mike
Same, yeah. Command line window opens, nothing further. Doesn't exit. If I click to close it, it hangs for a bit. Could be stuck in a loop.

It's a fresh install of Windows 7.
@h4tt3n

Okay, so my first thought is that you're approximating the orbits of the satellites as Kepler orbits. This would make sense because you'd be drawing an ellipse, and your demo has only one major body whose gravitational forces would make the others negligible.

This is very interesting, but I'm wondering if you've got any experience calculating "true" orbits, or at least far closer approximations thereof. I'd like to be able to model the orbits of the stars with all gravitational influences taken into account, even if this means that my orbit lines would be constantly changing.

I'm trying to rework my application around GLFW rather than SFML's graphical interface at the moment in the hopes that I'll gain a little performance boost for drawing native stuff like orbit lines and possibly get rid of whatever problem JoeCooper is experiencing. Once I get everything situated I'll probably implement orbit drawing the way you have in your demo, and see how accurate that is.

One thought I'm having is that I might be able to get *true* orbit calculations if I calculate the center of gravity for the system and use that as the focus of the ellipse when calculating it for each star. Would this work?

Thanks for all of your help by the way!
Quote:Original post by ChugginWindexOkay, so my first thought is that you're approximating the orbits of the satellites as Kepler orbits. This would make sense because you'd be drawing an ellipse, and your demo has only one major body whose gravitational forces would make the others negligible.


This is pretty much what I do. I use a number of equations to calculate orbital elements like semimajor axis, semiminor axis from the state vectors (position and velocity).

Quote:This is very interesting, but I'm wondering if you've got any experience calculating "true" orbits, or at least far closer approximations thereof. I'd like to be able to model the orbits of the stars with all gravitational influences taken into account, even if this means that my orbit lines would be constantly changing.


So would all the world's astronomers, but unfortunately this is not mathematically possible (see "three body problem").

Quote:One thought I'm having is that I might be able to get *true* orbit calculations if I calculate the center of gravity for the system and use that as the focus of the ellipse when calculating it for each star. Would this work?


I think this method would provide a really good approximation, and that will be my next step as well.

Quote:Thanks for all of your help by the way!


You're welcome :-) It's been fun so far.

Cheers,
Mike

Okay I've been rewriting this thing to be slightly more efficient using my own GLFW backend instead of SFML. In a day or two I should have a new version for you to try JoeCooper if you're still checking on this ;). Just a quick question for you h4tt3n: In your little demo you've got text on screen for your frame rate and I'm just curious what you're using for that. I've got mine working at the moment using FTGL and the FreeType2 library, but I don't like that I have to package a bunch of other DLLs and fonts and whatnot with my orbital app just to show people on here. I know I could build it statically, but I still don't know how I'd get around making sure the person has the font I'm using. If you're using something simpler I'd be interested to know what it is!

Other than that, I should have a new build of this out soon with slightly adjusted orbits that work much better...plus it should run!
Hi there, glad to hear things are going rigth. The thing is I didn't actually use glfw yet when those apps were coded 2-3 years ago. They're written in Freebasic, which is a very fast object oriented basic dialect. It comes with its own native graphics & font lib which makes these things very easy to make without having to include all sorts of stuff. So, if you want to display text in glfw, you'll have to include some external lib.

cheers,
Mike
I'm checkin' :)

This topic is closed to new replies.

Advertisement