logoalt Hacker News

Show HN: Rocket Launch and Orbit Simulator

159 pointsby donutthejediyesterday at 7:15 PM37 commentsview on HN

I (17y/o) have been developing a rocket launch simulation that allows the user to explore what it's like launching a rocket from earth and putting it into orbit. This idea originally started as an educational simulation but as i've gone more down the rabbit hole the more i've wanted to make it realistic. The problem is that I've never had a formal orbital mechanics class or anything like that so I don't know what I'm missing, what I currently have implemented is:

  Variable gravity
  Variable Atmospheric drag (US Standard Atmosphere 1976)
  Multi-stage rockets
  Closed-loop guidance / pitch programs (works well within ranges 350km to 600km)
  Orbital prediction and thrusting options to change your orbit.
The feedback I'm looking for is: UI improvements and possible future physics implementations that I can work on.

Current code and physics can be found at: https://github.com/donutTheJedi/Rocket-Launch-Simulation


Comments

MadnessASAPtoday at 1:45 AM

What did you use for closed loop guidance? If you aren't aware of it NASA has a lovely paper called UPFG "Unified Powered Flight Guidance" [1] used for the space shuttle. This was implemented and made more universal for KSP (of course) by Przemysław "Noiredd" Dolata as PEGAS "Powered Explicit Guidance Ascent System" [2]

If it's your thing you could try implementing it and getting a single continuous burn to final orbit.

Awesome work BTW!

[1] https://ntrs.nasa.gov/citations/19740004402

[2] https://github.com/Noiredd/PEGAS

Edit: I now see it's on your roadmap, so I guess it is your thing.

show 2 replies
mstankyesterday at 7:36 PM

This is awesome, great work! There’s a huge audience for something like this based on the popularity of Kerbal Space Program.

Biggest low-hanging fruit UI improvement would be mobile responsiveness. It was a bit challenging testing on my phone.

show 1 reply
caetris24yesterday at 9:25 PM

I think it's a good start, but the user experience and the color theme make the simulation cumbersome to absorb. Maybe you can do a theming exercise with an AI. The zoom feature is highly sensitive. It's not intuitive at first on what the user should do or take away from the simulation. The events feature is great, and essential.

Looking forward to seeing the next iteration. Nice work.

MeetingsBrowseryesterday at 10:11 PM

This is really neat and pretty fun to play around with!

How accurate are the simulations? I'm able to get orbit by turning 45 degrees as soon as I launch and then doing some minor burns at the height of the initial trajectory.

I don't feel like this strategy would work in real life.

show 3 replies
zamadatixyesterday at 10:38 PM

How much AI was used vs manual lines?

show 1 reply
brookman64kyesterday at 7:45 PM

Why is it launching with a horizontal velocity? It initially moves to the right even when pointing up perfectly.

show 1 reply
arnonejoeyesterday at 8:22 PM

Looks super awesome. Strong work! It showed the karman line at 98-99km. Maybe a tiny tweak needed.

headcanonyesterday at 8:45 PM

I'm sure that city just *loves* being downrange of the launch site :)

JK, nicely done! lots of fun to watch.

show 1 reply
tgigyesterday at 7:33 PM

Did you do all the math yourself?

show 1 reply
Teeveryesterday at 9:02 PM

This is really neat.

I've been toying with the idea of building something similiar but with a bunch of different space stuff, like a calculator for different rotating space station geometries, mars/lunar cycler orbits, or solar shade sizes/distances.

It's been many years since I've done this kind of stuff in school and it's great to be able to refresh yourself on this stuff. The kind of UI you're using makes it really friendly and approachable, like a game.

fartfeaturesyesterday at 8:35 PM

Much better than KSP2