Jump to content

Snarkiverse meets Principia


OHara

Recommended Posts

Snarkiverse (for those unfortunate enough not to have seen it) puts the stock KSP bodies in interesting orbits
Principia simulates the Newtonian mechanics of orbits, rather than using the patched-conic approximation.

This raises several interesting questions:

+ Mun passes very close over KSC every second day. Does this give noticeable advantage to well-timed launches (like launching at high tide)?

+ Pol orbits very near Duna.  Will she break up under tidal forces?

+ Eeloo orbits Jool in an resonance to avoid Val.  Will the two planets play nice?

+ Dres orbits the sun closely parallel to Kerbin (possible in the stock KSP approximation) to give an interplanetary journey different to all others.  Can we design an orbit, maybe like that of Cruithne near Earth, that captures the spirit of Snarkiverse with Dres?

Investigations welcome.  
I will gradually report investigations into these questions, in posts below,
and build a Module Manager patch to adapt Snarkiverse to Principia:

principia_numerics_blueprint:NEEDS[Principia,Snarkiverse] {
    ephemeris {
        // Leave the default integrator in place
        fixed_step_size_integrator = BLANES_MOAN_2002_SRKN_14A
        integration_step_size      = 2 min //default 35 min
        fitting_tolerance      = 1 mm  // default is 1 mm
        geopotential_tolerance = 0x1.0p-24 // default is 2^-24
    }}
Edited by OHara
include a starting-point Module Manager patch so Principia is numerically stable with Snarkiverse
Link to comment
Share on other sites

Setup (and later, levitating Kerbals)

Snarkiverse needs the mod Kopernicus, which in turn needs and includes Modular Flight Integrator and Module Manager.
Principia is still called a work-in-progress, but the authors now post binaries that can be put in GameData as with other mods.

ymIIlg8.jpg1) Snarkiverse assigns very fast orbits to  Pol (136 min)  and Gilly (77 min).  With its default 36-minute time-step, Principia computes only 4 positions per Pol orbit, and draws a polynomial spline interpolation between those essentially random computed points.

We need to change just one parameter in the Principia-configuration-files, but Principia requires all parameters be present in the file, or it exits KSP with a message to stderr.  Defaults for the unchanged parameters are discoverable in the source code.  The resulting configuration is in the top post.

YgWK0gg.jpg2) I expected to need to increase by the SMA (semi-major axis) of Mun's orbit to get the desired period
    P = 2π sqrt[ SMA³ /G /(MKerbin + MMun) ]
so that the Mun passes over KSC the same way every second day.  I expected this because stock KSP uses
   P = 2π sqrt[ SMA³ /G /MKerbin ]
and so Snarkiverse set up the Mun's SMA using that formula.   But when I make my 'correction' the orbit drifts, versus no drift with the SMA straight from Snarkiverse.  The orbit as seen from Kerbin is plotted at right, and it closes on itself nicely.

Principia seems to scale the SMA automatically, but I'm confused because the documentation says it applies Kopernicus orbital elements directly to the 'Jacobi coordinates' (distance between centres of mass for just two bodies) and those coordinates would seem to need to larger SMA.  I'll experiment later to understand what Principia is doing.

ERxMKvd.jpg3) The Duna system in Snarkiverse is supposed to have Pol pass each day over the same spot on Duna, every 8 orbits of Pol. Similarly Bop is meant to return exactly every 3 Duna-rotations, which is 8 orbits by Bop.  

Using the view from Duna's surface, we see the orbits do not quite close on themselves after 8 cycles as intended. Probably the mass of Pol changes the period of the orbit of Bop, and vice versa.

Later, we might adjust these orbits to be both stable and synchronous with Duna's rotation, if there is an easy or interesting way to find the correct adjustments.

Levitating Kerbals

Pol has 0.37m/s² gravity at its surface, just 4% of a 'g'.  The side of Pol facing Duna gets a bit more pull from Duna than does the CoM of Pol (the 'tidal force'). 

The distance from the centre of Pol where tidal forces match gravity is the radius of the 'Hill sphere',
     RHill =  SMA (1 - eccentricity) cube_root(MPol /3 /MDuna) = 42 km
and the radius of Pol is 44km, so a Kerbal on the right spot on Pol at just the right moment should levitate.

Some recent change to KSP made the ground artificially sticky, which is convenient here to keep the lander on the ground while Duna passes directly overhead.  Bill Kerman can then let go of his ladder and fall slowly upward.
Vys8fqJ.jpgsb7P4OZ.jpgI9jRLNd.jpgBa6UTVC.jpgsuXpynr.jpgQ11n4RA.jpgP7l2GN2.jpgxV9dPCa.jpg

The lander eventually levitates, and then is dragged eastward as Duna moves across the sky.  The same would happen to the rocks forming Pol, so Snarkiverse's Pol is doomed to eventually break up into a planetary ring.

(Landing on Pol when it is near Duna can be tricky, becuase the net gravity is not pulling anywhere near straight down.  Principia has a temporary off-switch: the 'hack gravity' cheat, even with scale left at 1.0, reverts from Principia's computations back to stock KSP. )

Edited by OHara
Link to comment
Share on other sites

  • 2 months later...

@OHara are you still working on this? I’d be interested to see the results of this as I’ve been doing a story-career in the Snarkiverse (this thread brought it to my attention and then my GPU died and Snarkiverse was about the only planet pack I could still run until it got replaced) and adding a bit of n-body weirdness could be interesting, both for gameplay and for the story part too.

Link to comment
Share on other sites

Yes; it is a long-term background amusement. 

I got interested in trying to adjust the Jool and Duna systems to make them stable, which is actually very difficult and complicated.  (One of the  well-known youtube explainers surveys the problem here, in his nicely intuitive style.)  As the days get shorter in the northern hemisphere, I'll make more progress.

By all means, tell us here if you explore any interesting aspects of Snarkiverse with Principia.

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...