Jump to content

Orbital mechanics of circularization


RizzoTheRat

Recommended Posts

31 minutes ago, Ozymandias_the_Goat said:

Keep in mind that centrifugal forces are not a real force, they are merely a fictitious force that appears to justify the motion of an object in a circle, but in reality does not. 

I know they are called "fictitious" forces but they are quite real in the rotating frame of reference.  It's the rotational analogy of Einstein's Principle of Equivalence.  And maybe even more real than that.  Try reading the Wikipedia article on Mach's Principle.

 

4 minutes ago, RizzoTheRat said:

You can get the current velocity and altitude, Apo/Periapsis time and altitude, and the ships velocity vector at a given time on it's current path.  Although the latter is tricky as the frame of reference is fixed in relation to thee sun, so rotates relative to the ship and the planet  so you if you get a vector at a future point it won't be correct by the time you get there.

I've just discovered you can get ground speed and vertical speed which I usually calculate from the velocity vector, and it also seems to have angular velocity and angular momentum.

Thanks.

Link to comment
Share on other sites

23 hours ago, RizzoTheRat said:

This is the bit I'm struggling to get my head around. Left to it's own devices the vertical component will decrease to 0 at the Ap.  By adding more horizontal velocity I'm increasing the Centripetal acceleration, so I need to thrust below the horizontal to take that in to account.  I just can't quite make up my mind if I'm double counting it with the dV already pointing down, and the adding in the effect of gravity and centripetal acceleration. 

 

 

Try it the easy way first, and burn with no vertical component. You'll find it works, and then you can think about why it works. I didn't pay attention to the orbital mechanics section in my first college physics course and had to (re-)learn it all when I started programming KOS; the curvature of the planet below you means it's not the same as simple vector addition would suggest.

That is to say, your acceleration vector should be precisely tangent to the surface of the planet (which is precisely prograde/along the GROUNDSPEED vector at the apoapsis). Over the course of the burn (because your acceleration vector won't be locked to prograde at each point during the burn, it will be locked to prograde at apoapsis) you will be adding some negative radial acceleration at the start and some positive radial acceleration at the end. If you time your burn appropriately (see my previous comment for how) the negative and positive radial acceleration will be evenly divided and will cancel out precisely, leaving your apoapsis exactly where you wanted it to be.

The easy way in KOS to get the vector that is precisely tangent to the surface of the planet at apoapsis is to create a prograge maneuver node at the apoapsis. Once you have it (see my code to circularize above), the vector can be referenced as

set my_acceleration_vector to NextNode:deltav
lock steering to my_acceleration_vector

Once you have the vector you can delete the node, if you wish, with 'remove NextNode'. 

Link to comment
Share on other sites

Yeah, I've done the add a node and delete it method before for my first KOS munshot, quite amusing watching the node run back and forth along my path to work out the lowest dV path.

I've tried the tangential burn approach and don't think it's quite right, you're adding horizontal velocity, which increases the centripetal/centrifugal/whichever so reduces your downward acceleration, meaning your Ap rises. and then when you drop down the other side it all goes a bit wonky.  

 

My best approximation so far is use the Gravity-Centripetal offset from the dV vector, which gets me to within 2-300m which bad.  Tempted to just stick with that for now and move on to updating my rendezvous script and having a go and docking.

 

ETA:  And I've just discovered I need to take in to account the change if thrust of staging when I calculate the burn time.  Just staged to a low TWR with only a few tens of m/s below orbital speed and it messed the whole thing up :huh:

Edited by RizzoTheRat
Link to comment
Share on other sites

Thinking about some more last night (don't worry I haven't started dreaming about KSP...yet).

A suborbital craft above the atmosphere should have no tangential acceleration, and a radial acceleration (lets call it Ar) equal to gravity - centripetal.

As there's no tangential acceleration the centripetal should be constant, and while the gravity will decrease slightly, I've not got the figures to had to work out how much gravity changes by, bit I expect it to be pretty small, so lets assume Ar remains constant until we hit atmosphere again.

If I calculate my burn time t from the required dV between the current velocity and that required for a circular orbit, and I light my engines at a time t/2 seconds before Apopasis, I can angle my ship to maintain a radial acceleration of Ar.  I should find the craft gradually pitches down as the velocity, and therefore centripetal acceleration, rise and I need more of the radial acceleration to come from my thrust.  Keeping the radial acceleration constant means I should still hit the same altitude apoapsis at the same time, although it will be slightly further around the planets arc.  If I then adjust my burn angle to maintain zero radial acceleration for the second half of the burn, I should maintain that altitude while accelerating to the required orbital speed.

However I've just spent t/2 at Ar radial acceleration and t/2 at 0 radial acceleration, so alternatively I could conduct the whole burn at Ar/2 and should end up bang on the target altitude.

 

Anyone see a flaw in this?  I'm following a curved path as I'll need to add more downward acceleration as the speed goes up, so it's still not the most efficient method, but I think it should work.

 

Link to comment
Share on other sites

I'm going to have to sort through your last message later, @RizzoTheRat, as I can't absorb it just now.

26 minutes ago, RizzoTheRat said:

A suborbital craft above the atmosphere should have no tangential acceleration, and a radial acceleration (lets call it Ar) equal to gravity - centripetal.

I don't think you should call this tangential acceleration.  The better term is angular acceleration, as you're talking about the spacecraft in R-theta coordinates, where R is the radius from the centre and theta is the angle from some standard direction.  Tangent usually means a direction tangential to a curve at some point, meaning in the direction of the motion along the curve at that moment, as if the path suddenly stopped curving and was straight.

And unfortunately, the angular acceleration isn't zero there.  As the spacecraft is drifting in a near vacuum on its trajectory, it's angular momentum is constant (another way of expressing Kepler's 2nd Law).  Which means if it's on a path for which its radius from the centre reference changes--as it does for an ellipse--then the angular velocity has to change to keep that angular momentum constant.

The angular acceleration is only zero for a circular orbit.

 

Link to comment
Share on other sites

Yeah your right,  the horizontal velocity remains constant but the distance will increase as you climb so the angular velocity is decreasing. 

Think I'm finally starting to understand a bit of the difference between doing this on a linear or rotating frame.

Now to think up a way to compensate for it...

Link to comment
Share on other sites

  • 2 months later...

@Jacke, and @RizzoTheRat

No idea how I missed this! I also have no idea if anyone's still interested, but I definitely was so I went ahead and put some work in. Just to make sure I understand it correctly, the idea is we have a rocket on an eccentric (and probably suborbital) trajectory, and we want to 'circularize' the orbit before reaching apoapsis because... well probably because we're impatient :) . It's KSP, no shame in that. More specifically then the objective is to find the deltaV + angle of the burn that would 'circularize' the orbit, turning our current position and altitude into the new periapsis and shifting the apoapsis to the far side of the planet, but without raising or lowering the apoapsis in the process. My answer assumes instantaneous burn, because that's the only thing possible to calculate :D . In practice, you'd probably use KOS to recalculate the burn parameters a few times throughout the burn to account for tiny changes during the burn time. They should be <<10% though for any normal condition.

There's two ways to approach the problem, either from Vis Viva (magic formulas based on energy) or from the mechanical forces. For doing it from the forces, your idea is correct to consider the rocket in a rotating frame and plot its path as it follows the gravity, centrifugal and coriolis forces. Then we can calculate how we need to change its current velocity in order to achieve the orbit we want. The difference being our burn. It's pretty tricky to know where to get started in the solution, but once started no individual step of the process is too counterintuitive or requires anything above basic calculus/trig, but it winds up being like 40 steps. We wind up effectively taking the laws of mechanics, pretzeling them up and playing cat's cradle for a while. I'd be happy to share it if there's interest, but it's quite the journey!

In any case though, here's the result:

glTlDOX.png

Where:

M is the planet mass
G is the gravitational constant
r is our craft's current radius in orbit
Ap is the radius of our Apoapsis
v_theta is the craft's current velocity in the theta direction (going round the planet)
v_y is the craft's current velocity in the vertical direction (going away from the planet)
Burn Delta v_[] is the component of the burn required in the [] direction
Burn DeltaV is the total burn deltaV required
and Burn Angle is defined as the angle relative to prograde with negative values being downwards.

Fair warning, I haven't doublechecked the answer, but it should be right. Famous last words :)

Edited by Cunjo Carl
Link to comment
Share on other sites

I'd parked this and kind of forgotten about it for a while.  KOS will recalculate everything multiple times a second so no issue with minor changes.  I'll have a play with it at the weekend once I've refreshed my mind on how I was trying to do it and see how it goes, cheers.

Link to comment
Share on other sites

On 5/1/2019 at 3:43 AM, Cunjo Carl said:

Fair warning, I haven't doublechecked the answer, but it should be right. Famous last words :)

Good work!

I've just run this on a test ship with a few different launch profiles, to give different burn duration to circularise at 80km.

A fairly decent profile needed 230m/s (about 8 seconds burn) to circularise, and the Apoapsis dropped just 20m, so I think we can call that bang on!

However a steeper profile that needs 1150m/s (about 40 seconds burn) to circularise lost between 800 and 1600m on repeated runs

The fact it's always a bit low got me wondering, is the Vy term definitely supposed  to be the current radial, or the component in the radial direction at the Apoapsis?

 

If you get time I'd be interested to see the intermediate steps. 

 

I think I've got your calcs right in my code

set ShipRad to ship:altitude+ship:body:radius.
Set ApoRad to ship:Apoapsis+ship:body:radius.
Set Vtheta to vxcl(ship:up:forevector,ship:velocity:orbit).

set dVtheta to sqrt((ship:body:mu/ShipRad)*2/(1+ShipRad/ApoRad))-Vtheta:mag.
Set dVy to -ship:verticalspeed.
set BurnAngle to arctan(dVy/dvTheta).
Set dV to sqrt(dVtheta^2+dVy^2).

Set BurnTime to BurntimeCalc(dV).
set ShipHeading to heading(ShipBearing(ship:velocity:orbit),BurnAngle).

 

Link to comment
Share on other sites

16 hours ago, RizzoTheRat said:

However a steeper profile that needs 1150m/s (about 40 seconds burn) to circularise lost between 800 and 1600m on repeated runs

The fact it's always a bit low got me wondering, is the Vy term definitely supposed  to be the current radial, or the component in the radial direction at the Apoapsis?

The good news is the Vy term should drop to 0 at both the Periapsis and Apoapsis, which is part of what made that earlier equation so easy!

But I think you're right that it's that Vy messing with the direction that's at fault, and I think the root cause is my instantaneous burn assumption being bad for that situation. The only good fix (closed form) will be to use a burn that changes direction mid-burn and expect the burn deltaV to be a few percent higher than the equation initially predicts. This new equation is for the inwards/prograde direction we can burn that won't change our Apoapsis at any instant, whereas the old one was in essence this equation averaged across the duration of the burn. The new burn will be less efficient by some percent due to something akin to cosine losses (and so less efficient than the DV equation predicts), but I'd guess probably not enough to worry. In the end, the new direction equation should work if dropped directly in to your current code, with the requirement the rocket can turn fast enough to keep up! I think it'll be ok for everything except the Battlestar Galactica.

Let's see.

BurnAngle   = 50m9Gns.png

(I'm away from my normal computer, so I have a rather clunky equation editor. r is radius, A is Apoapsis, M is Mu (or MG), and v is the v_theta from before)

Also here's the equation text, with parentheses balanced and such for easy plugging in:

arctan( ((r/Ap)^2 - 1) / sqrt( ((r/Ap)^2 - 1) + (2MG/(r*v_theta^2))*(1-(r/Ap)) ) )

Thanks for doing the experimentation work! If this doesn't work out I'll put together the derivation over the coming weeks and we'll see where it went wrong.

 

Edit: Found a much cleaner simplification... editting....

3JuSOL9.png

Ok, maybe it looks uglier, but this shows the new equation as a correction factor built upon the original one! This sort of thing always makes me happy to see. The -Vy has become the -1 on top, and the old equation for Burn DeltaV Theta is now living on the bottom.

And here's the now much simplified form for the typing it out

arctan(sqrt(  ((r/Ap)^2-1) / (  (2*MG/(v_theta^2*r*(1+r/Ap))) - 1 )   ))

 

Edited by Cunjo Carl
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...