UmbralRaptor changed the topic of #kspacademia to: https://gist.github.com/pdn4kd/164b9b85435d87afbec0c3a7e69d3e6d | Dogs are cats. Spiders are cat interferometers. | Космизм сегодня! | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> … one of the other grad students just compared me to nomal O_o | <ferram4> I shall beat my problems to death with an engineer.
<Phantomex>
Hey guys, I was sent here from #KSPOfficial
<Phantomex>
Am trying to figure out how fast I need to be going sideways to counteract a specific force of gravity and attain a perfect circular orbit
<Technicalfool>
hehe
<Phantomex>
Intuitively it feels like there ought to be an easy answer to such a specific question (just plug the numbers)
<Phantomex>
But I don't really know the mechanics well enough, hoping someone here does
<Technicalfool>
"The square of the orbital period of a planet is directly proportional to the cube of the semi-major axis of its orbit." - may be useful since you're on about specifically circular orbits.
<Phantomex>
isn't an orbital period a length of time?
<Technicalfool>
yep. It's how long it takes to complete an orbit.
<UmbralRaptor>
v = sqrt(GM/r)
<UmbralRaptor>
This can be derived via when gravitational forces = centrifugal forces
<Phantomex>
plz define symbols
<Phantomex>
and yeah, I'm definitely looking for gravitational and centrifugal forces to be equal
<Phantomex>
what're G, M and r?
<Technicalfool>
Gravitational Constant, and Mass (in KG) I suspect.
<UmbralRaptor>
velocity = (gravitational_constant * mass / distance)
<UmbralRaptor>
er, rather
<UmbralRaptor>
velocity = (gravitational_constant * mass / distance)^0.5
<UmbralRaptor>
Technicalfool: Eh, you could use the FFF system if you hate yourself enough.
<Phantomex>
Well... My gravity's not exactly like regular gravity
<UmbralRaptor>
Assuming you're in SI land, G = 6.674e-11 N*m^2/kg^2
<Phantomex>
I'm actually using a gaussian kernel for my gravity function, since my game involves visualizing the field (the "rubber sheet" model) and inverse square doesn't look that great
<UmbralRaptor>
mrf
<Phantomex>
Here, I'll take a screenshot so that makes sense
<UmbralRaptor>
Uh, gaussian kernal means gravitational force scales with e^(-x^2), right?
<UmbralRaptor>
x, r, whatever.
<Phantomex>
It's not even a proper gaussian, more of a fast approximation since I need to splat gravitational potentials onto a texture on the GPU
<UmbralRaptor>
Anyway, for a circular orbit, gravitational force will be equal to v^2/r
<Phantomex>
hope it's not too dark to see what's going on with the grid
<UmbralRaptor>
shiny
<UmbralRaptor>
Uh, anyway, going with the above equations, v = sqrt(F*r), where r is your distance from the planet/star/whatever, and F is the force of gravity at that distance. If you have multiple overlapping gravitational fields, this goes out the window.
<Phantomex>
Well I was hoping I could get there from the current acceleration
<UmbralRaptor>
Bleah, I'm not thinking right at 4 am. But for the above, I really should have called F acceleration, since I didn't include the spaceship's mass.
<Phantomex>
Since I might have all sorts of different falloff functions for the gravity, but logically I should always be able to balance my centrifugal acceleration against gravity, and ignore the gradient since it wouldn't be changing along a circular orbit right?
<UmbralRaptor>
Yeah.
<Phantomex>
The current instantaneous acceleration due to gravity should be directly proportional in some way to orbital velocity
<UmbralRaptor>
Uh, do you do something like KSP's spheres of influenced (or patched conics models), where you'll be affected by the planet or the star, but not both?
<Phantomex>
Yep, the pseudo-gaussian kernel I use for gravity falls off to 0 at the edge of its influence
<Phantomex>
You can see the shape in the screenshot
<Phantomex>
Oh, I didn't read your question correctly
<egg|phone|egg>
!Wpn UmbralRaptor
* Qboid
gives UmbralRaptor a Cauchy triangle
<Phantomex>
No, I am not limiting how many sources can affect you at a time
<Phantomex>
Which means you can visually find lagrange points just by looking for a saddle shape in the potential grid
* egg|phone|egg
summons the demons of numerical integration
<UmbralRaptor>
True circular/elliptical/parabolic/hyperbolic orbits only exist in the approximation of a single gravity source. This is good enough(tm) when one completely dominates, but not so much when others are significant enough to do things like weak stability boundary transfers, lagrange points, etc.
<egg|phone|egg>
(their names can be found in the bibliography)
* UmbralRaptor
sketches a rune to bind Dark Lord Kahan.
<egg|phone|egg>
Also as we hint integration is hard
<Phantomex>
Oh yeah, the reason I need the math for this is that the orbits for planets will just be nested circles following fixed paths
<Phantomex>
So I want to set them on orbits that move at the same speed the player would have to move to stay at that distance around the object it's orbiting
<Phantomex>
If you are at the same distance from the sun as a planet, and moving at the same speed, you should be in the same orbit
<egg|phone|egg>
aaaaaa there are no l45 in the primary center frame, only barycentre
<UmbralRaptor>
Or, practically, from your craft to the center of the planet or star.
<Technicalfool>
oh hey, l'ouef woke up. Expect explanations to get more complex.
<UmbralRaptor>
(Since again, circular orbits only exist in the Keplerian approximation)
<Technicalfool>
egg|GravityGod|egg
<UmbralRaptor>
;8ball Is RK4 sufficient?
<kmath>
UmbralRaptor: Don't count on it
<egg|work|egg>
UmbralRaptor: eh, better than pretending that there are conics in the vicinity of lagrange points
<egg|work|egg>
UmbralRaptor: or that there are lagrange points if bodies orbit the centre of their parent rather than the barycentre of the two
<egg|work|egg>
!wpn Technicalfool
* Qboid
gives Technicalfool a solvable soliton
<egg|work|egg>
!wpn UmbralRaptor
* Qboid
gives UmbralRaptor a bismuth ℻
<egg|work|egg>
!wpn Phantomex
* Qboid
gives Phantomex an avalanche integrand
<Technicalfool>
o_o
Iskierka has quit [Ping timeout: 201 seconds]
Iskierka has joined #kspacademia
Iskierka has quit [Client Quit]
<UmbralRaptor>
egg|work|egg: In case you missed the fun, Phantomex's gravity fields don't necessarily follow the inverse square law. https://i.imgur.com/iHtPNvJ.jpg
<UmbralRaptor>
(AIUI, they're mainly using some rough approximation of a gaussian function)
Iskierka has joined #kspacademia
* UmbralRaptor
should probably try that sleep thing for a bit.
<egg|work|egg>
UmbralRaptor: nah, it's overrated
Iskierka has quit [Ping timeout: 180 seconds]
<UmbralRaptor>
<_<
Iskierka has joined #kspacademia
Deddly has quit [Ping timeout: 204 seconds]
<egg|work|egg>
UmbralRaptor: uuuuh Lagrange points seem like a tall order
<egg|work|egg>
UmbralRaptor: hmmm are there stable orbits?
<egg|work|egg>
UmbralRaptor: they're certainly not conics in the general case if they exist, right?
<egg|work|egg>
right, so by effective potential they mean gravitational potential + centrifugal potential
<egg|work|egg>
(in the corotating barycentric frame)
<Phantomex>
So what I'm plotting right now is not that, so I'm calling it absolute potential
<egg|work|egg>
you're just plotting the gravitational potential
<egg|work|egg>
no need to shoehorn the word absolute in there
<Phantomex>
so if I plotted centrifugal potential as well, you're saying all lagrange points would have saddles
<egg|work|egg>
or mointaintops
<egg|work|egg>
hilltops?
<Phantomex>
local maxima
<egg|work|egg>
local maxima :-p
<egg|work|egg>
Phantomex: the Lagrange points are by definition the critical points of the gravitatial + centrifugal-in-the-barycentric-frame potentials
<egg|work|egg>
(critical being minima, maxima, saddles)
<egg|work|egg>
vanishing differential
<egg|work|egg>
anyway back to work
<Iskierka>
it's strange that L4/5 are maxima yet stable
<egg|work|egg>
that's because you have the coriolis force
<egg|work|egg>
which does not derive from a potential
<egg|work|egg>
so as soon as you pick up speed in that frame, you start curving
<egg|work|egg>
but yes, it's not intuitive at all
<Iskierka>
am I correct in remembering that the saddles do intuitively match the potential or does it reverse the behaviour there as well?
<egg|work|egg>
Iskierka: what do you mean by intuitively match the potential
<Iskierka>
as in stable in the minimia dimension and unstable in the maxima
<egg|work|egg>
Iskierka: mind you an important property of Coriolis is that it acts orthogonally to your velocity, not affecting your energy
<egg|work|egg>
thus you can reason with the potential to an eggstent
<kmath>
<polarisdotca> First day in Engineering at #UBCO: Prof: look left. look right. (wait for it) These ppl will be your friends. You'll help each other.