Jump to content

Math Problem: Power Track


Laie

Recommended Posts

poor_mans_powertrack.jpg

I can't say I enjoy low-thrust, long-duration transfer burns, but find myself in that situation pretty often and have learned to cope.

Lately I familiarized myself with kRPC and now I wonder if I might be able to do it right: performing a single long burn, pointing prograde all the way while spiraling out of the system... and still getting where I want.

I haven't done any orbital calculations yet. The maths doesn't look too hard, it's just that I don't have any first-hand experience. So I also don't quite know what to look out for. Advise would be welcome.

  • I assume that I can use an ordinary, instant in-game maneuver as a template, and then somehow work out a power track that sends me on a similar trajectory.
  • I'll have to calculate a series of tiny maneuvers in short intervals, right? Or is there a more elegant way to do this?
  • how do I tell if I succeeded? The eventual trajectory cannot possibly be identical to the one I planned earlier (cf. example above). I presume what matters is the velocity relative to the sun right after SOI transition, is that right?
Link to comment
Share on other sites

This IIRC rapidly gets you into territory where there are no analytic solutions. You'll want to use a numeric integrator for the burn (eg: writing a script in Python) to work out how long the burn time is, and what sort of angle the ship will pass through. I suspect that you can tell on success *before* SOI transition by working out the transfer with patched conics, and when your specific energy (0.5*v^2 - GM/r) reaches that.

Link to comment
Share on other sites

Just had an idea that ought to make it much easier: The game already hands me my position and vector. I only need to apply thrust and gravity in order to arrive at position +1. No need to calculate a new set of keplerian parameters at every interval.

Actually, I have an inkling that this could be integrated. However, at this point in life I'm happy enough if I can still solve a quadratic equation.

Link to comment
Share on other sites

Depends on your actual vehicle TWR. If your thrust is low, comparable to real-life ion thrusters, then you can enter an orbit where you are essentially "continuously circularizing" an orbit and thus spiraling higher and higher in an ever-widening loop. Then whenever you want to do your final escape burn, you can stop thrusting for half an orbit or so, time it appropriately, and fire away.

The Dawn thruster is so overpowered for an ion thruster that unless you are using just one of them to push some sort of ginormous interplanetary monster, you are better off kicking the periapsis.

Link to comment
Share on other sites

9 hours ago, sevenperforce said:

Depends on your actual vehicle TWR

Does it? The whole point of the exercise is to get a workable solution for arbitrarily low TWRs. I don't think I'll ever get so low that I will actually spiral out over the course of several orbits, though: There's still the matter of patience and it's limits.

Link to comment
Share on other sites

9 hours ago, Laie said:

Does it? The whole point of the exercise is to get a workable solution for arbitrarily low TWRs. I don't think I'll ever get so low that I will actually spiral out over the course of several orbits, though: There's still the matter of patience and it's limits.

For an arbitrarily low TWR, the solution is to just thrust prograde, indefinitely. For a moderately low TWR, the spiral has a non-negligible slope and so it actually matters where you choose your starting point. 

Link to comment
Share on other sites

On 11/9/2019 at 7:24 PM, sevenperforce said:

For a moderately low TWR, the spiral has a non-negligible slope

Yep, that's the case I'm interested in.

Alas, it turns out that this is much harder than anticipated. I've spent the better part of a day writing a (pos, vel)->(kepler) function that doesn't quite work. And that's not even half of it! At the very least I still need to compute ejection angle & and speed, kepler->(pos,vel), and possibly more. At my skill level, that would take me weeks.

You know what? I guess I'll let the game do the maths, after all:

manynodes.jpg

Link to comment
Share on other sites

49 minutes ago, Laie said:

Yep, that's the case I'm interested in.

Alas, it turns out that this is much harder than anticipated. I've spent the better part of a day writing a (pos, vel)->(kepler) function that doesn't quite work. And that's not even half of it! At the very least I still need to compute ejection angle & and speed, kepler->(pos,vel), and possibly more. At my skill level, that would take me weeks.

You know what? I guess I'll let the game do the maths, after all:

manynodes.jpg

It appears to be a Fibonacci spiral.

Link to comment
Share on other sites

I think if it was just related to speed then it would be Fibonacci, but as gravity reduces with distance it probably complicates it.

I use KOS rather than kPRC, interested in similar stuff but not sure what information you get in kPRC compared to what I get in KSP.

It's an interesting idea I might have to have a play with at some point, but I think it's going to need a numerical solution in small time steps rather being able to work out the formula for it with my level of maths.  It gets embarrassing when I have to ask my wife (maths teacher) for help with the game :D  However I think the biggest problem would be the change of SOI.

I'm about to send a relatively heavy and low thrust vessel off to the Mun and plan to knock up some code to break it down in to several smaller burns, and knock off the period from the planned time of the ejection burn.

For calculating ejection angles and excess velocity I find @OhioBob's website very useful  http://www.braeunig.us/space/orbmech.htm

Link to comment
Share on other sites

12 minutes ago, RizzoTheRat said:

I find @OhioBob's website very useful 

Yup, that's where I spent my weekend.

I don't think KSP and kRPC differ very much in what information you can get out of the game.

1 hour ago, RizzoTheRat said:

but I think it's going to need a numerical solution in small time steps rather being able to work out the formula for it with my level of maths.

Yep, that's what I've been considering as well. Take starting position and vector, add thrust and gravity to vector, get new position from old position and new vector. Rinse repeat. I don't have any idea as to how accurate that would be, though, and found that it needs a lot of groundwork before I can even start to find out.

Link to comment
Share on other sites

In KOS you can create a new orbit object by giving it a bunch of parameters and can then access the other parameters that KSP has calculated about that orbit

https://ksp-kos.github.io/KOS/structures/orbits/orbit.html

If you can do something similar in kRPC can you create a new orbit object for each timestep and let KSP do the difficult bits?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...