Jump to content

[WIP][1.8.1, 1.9.1, 1.10.1, 1.11.0–2, 1.12.2–5] Principia—version ‎‎Kronecker, released 2024-11-01—n-Body and Extended Body Gravitation


eggrobin

Recommended Posts

  • 5 weeks later...
  • 2 weeks later...

Is there anyway to view the actual math used to calculate all these trajectories? I've been learning Calculus and really want to know how they come up with all the calculations to say go to the moon.

Link to comment
Share on other sites

@crapstar, the plugin is operational. I haven't actually played with it because I'm afraid of bugs, but i've loaded it up to my rp-0 game and eyeballed this lunar flyby: http://imgur.com/lR32G1x. I don't have very many vessels flying though. 

EDIT: if you are worrying about stationkeeping, i think it should be fine: my lunar sattelites in moderately eccentric ~4000km orbits around the moon show no intention of impacting it, and GSO sattelite seems rock stable as well. LPO will precesss i think? I don't have anything in LPO at this moment.

I think that RO/rp-0 authors monitor this thread very closely and eagerly await the moment when principia is stable and convenient enough for them to grab and incorporate into their entire RO suite, so I'll trust them to determine when it happens.

@jbakes, Eggrobin (the mod author) stated some time ago in the OP that the algorithm to propagate spaceships' trajectories was, back then, symplectic partitioned Runge-Kutta of the 5th order. To be honest, i don't know what "symplectic" or "partitioned" means, but i guess you can look up the equations for it.  Not sure if you actually need that to just go to the moon, or what the actual spaceflight engineers in the 50s-70s used to go to the moon, maybe you could get away with using something simpler, like the usual Runge-Kutta in a restricted three-body environment, and still be within the margins of a few minor corrections en route. This mod is probably massively over-precise for a task of just looping around the moon because it has to keep errors small on the scale of years as opposed to days.

Edited by nanomage
added a bit about the lunar orbiters
Link to comment
Share on other sites

On 7/12/2016 at 4:31 AM, nanomage said:

To be honest, i don't know what "symplectic" or "partitioned" means, but i guess you can look up the equations for it.  Not sure if you actually need that to just go to the moon, or what the actual spaceflight engineers in the 50s-70s used to go to the moon, maybe you could get away with using something simpler, like the usual Runge-Kutta in a restricted three-body environment, and still be within the margins of a few minor corrections en route. This mod is probably massively over-precise for a task of just looping around the moon because it has to keep errors small on the scale of years as opposed to days.

"Symplectic" means that the physics calculations are approximately energy-conserving, in that the system doesn't gain or lose energy over time.  This is incredibly important for orbital calculations, because orbital energy relates to the shape of the orbit.

If you load up stock KSP right now and visit a ship in orbit, you'll notice with KER or MechJeb that the orbit's periapsis and apoapsis very slowly decay with time.  That happens because the stock physics integrator is not symplectic.  You don't see a problem with time-warp because stock KSP runs "on rails" based on Kepler's laws, without actually simulating the N-body forces.

Surprisingly, "symplectic" has little to do with the overall accuracy of the calculations.  You can have very accurate calculations that exhibit energy drift, and you can have very inaccurate calculations that conserve energy.

"Partitioned" refers to a detail of the simulation, in how it separately updates position and velocity.  You don't have to care about that one, it's an internal thing.

Edited by Majromax
Link to comment
Share on other sites

11 hours ago, Brianson100 said:

Can anyone give me some advice in terms of rendezvousing/docking with other spacecraft in LEO while using Principia?

It's purely theoretical advice, but could you just try the stock patched conics/maneuver nodes to plan a rendezvous? There is an option to enable them in the plugin settings. LEO should be one place where conics are reasonably correct over a few hours.

Link to comment
Share on other sites

Hi there,

I was testing the mod and got really amazed and mesmorized by the beauty of the orbital paths in the flight plan.

Just one thing...I'm new to this mod and I need help with interplanetary transfers.

So, can anybody help me?

P.S: thanks to the developer

Link to comment
Share on other sites

16 hours ago, Brianson100 said:

Can anyone give me some advice in terms of rendezvousing/docking with other spacecraft in LEO while using Principia?

For LEO, patched conics should be good enough. We unfortunately don't have plotting frames to help with rendez-vous yet, see the relevant section in the FAQ.

Link to comment
Share on other sites

On 7/24/2016 at 11:45 AM, Ksp Slingshooter said:

Hi there,

I was testing the mod and got really amazed and mesmorized by the beauty of the orbital paths in the flight plan.

Just one thing...I'm new to this mod and I need help with interplanetary transfers.

So, can anybody help me?

P.S: thanks to the developer

Well, first, make a manuever w/ the flight planner that escapes Kerbin's gravity, then switch to the non-rotating reference frame of the planet you want to reach. Mess around a bit until you get one of the periapsis' to what you want it to,

Link to comment
Share on other sites

17 minutes ago, N70 said:

Well, first, make a manuever w/ the flight planner that escapes Kerbin's gravity, then switch to the non-rotating reference frame of the planet you want to reach. Mess around a bit until you get one of the periapsis' to what you want it to,

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

I'm new to Principia and tried using it for my Mun landing and returning back to Kerbin. However I am very confused on multiple issues.

I got a weird bug that when I was re-entering Kerbin that my line of descent on the map disappeared. I tried toggling the patched conics but they still didn't appear. It just showed the icon of my vessel.
When I tried following the navball manoeuvers created by the flight plan, they didn't give me the proper orbit/flight as indicated in the flight plan.
I did not understand the effect of differing frames from plotting and manoeuvers, that is manoeuvering frame selection and plotting frame selection. These didn't make sense to me and it wasn't detailed on your github wiki.

Edited by DrPastah
Link to comment
Share on other sites

Cantor is out.This version is mostly the same as بوژگانی (see the change log), the intent is to make sure it is as stable as بوژگانی was: this is the first broadly available release, with a link to binaries outside the IRC channel (see the OP).

In the meantime, progress has been ongoing (note that this is about a future release, Cantor contains none of the features below).

Regarding our internal libraries, we have clarified the way we handle time (which is always an extremely confusing thing), with our Instant type aligned with Temps Terrestre (TT), and support for date literals in TT, Temps Atomique International (TAI), Coordinated Universal Time (UTC), and UT1 (based on the rotation of the Earth). This allows us to specify dates more cleanly in our tests.

We tested the difference between the orbits of Mercury predicted by our ephemeris and by JPL's over a century, and we find the expected error in perihelion precession due to general relativity.

On the side of flashier features, we seem to be well underway to having working axial tilt, by tilting universe the current main body (with terrain) is aligned with the axis used by KSP, and rotating the other ScaledSpace models appropriately; in a future release of Principia, the Jupiter, Saturn, and Uranus systems should look much nicer, with the planet properly aligned with its satellites.

@DrPastah, the Concepts page has been updated and should clarify some of your questions.

Link to comment
Share on other sites

On 8/14/2016 at 2:17 AM, Jmullin said:

Any idea if this would be compatible with the Orbital Decay mod?

I don't think this will work with any mod that alters the orbits (the changes will simply be ignored, since we persist our own Cartesian state and simply force the game to put things in the right place by setting the orbits).

More importantly though, it seems that @Whitecat106's mod and ours have roughly the same goals, so you probably don't want to have both installed: @Whitecat106 appears to be working on multibody and extended/inhomogeneous body gravitation, and we have atmospheric decay as one of our (rather long-term) aims.

@Whitecat106, you might want to put this mod in your list of known incompatibilities, since we're likely to attract the same users.

Some development news:

Axial tilt appears to be working (there will probably be some weirdness with landed vessels on distant planets appearing in the wrong place until you switch to them or come close to them, but this shouldn't be too big of an issue), see the relevant pull request (under review as of this writing).

Some screenshots (links, because apparently imgur album embedding broke).

With the Earth as main body, Earth's equator is the horizontal plane. Note that the Earth isn't tilted, and Saturn exhibits very little tilt (it is tilted by less than 6.5 degrees from the Earth's axis). The moon is noticeably tilted (since its equator is close to the ecliptic), and so is the whole Jovian system. Uranus is also shown, pointing one of its poles to the Sun.

With the Moon as main body, (i.e. when the active vessel is close to the Moon), the horizontal is close to the ecliptic; thus the Earth appears with its usual tilt, the whole Saturn system is similarly tilted, and the Jovian system exhibits virtually no tilt.

This also means that the Pluto/Charon system can appear properly tidally locked (not shown). Side note: it seems that in RSS, the Pluto texture is off by 90 degrees in longitude, @NathanKell may want to look into this.

Note that in the above screenshots, the sky box (or as it's called in the KSP API, galaxy cube) is something I made for testing purposes, with right ascension/declination graticules (note that the parallels are aligned with Earth's equator), a line showing the ecliptic, and absurdly large bright stars in order to immediately identify whether the constellations are correctly positioned and oriented.

Indeed, while experimenting with tilt, I noticed that existing skyboxes based on the real sky seem to suffer from rotation or mirroring issues: as far as I can tell, @Oinker's box is mirrored upside-down, possibly with an additional rotation (the constellations have the wrong chirality and the pole star is down), and @pingopete's RVE skybox is mirrored, and is oddly tilted (it may be that it is aligned with the ecliptic and then tilted 90 degrees, I'm not exactly sure).

For reference, this is what I have found about the skybox textures, showing how they're attached into a cube, and which side is in which direction; note that when declination is up, right ascension is left (i.e. like when looking at the sky). The textures are oriented as seen from inside the cube, not from "outside the celestial sphere".

  •    -y <------- North Pole; right ascension increases clockwise.
    -x +z +x -z <- Equator; right ascension increases from right to left.
             +y <- South Pole; right ascension increases counterclockwise.
    ^------------- the -x texture is the sky above KSC
                   at the beginning of the game in stock.
                   In RSS, it is centred around the vernal equinox
                   (0 h right ascension, 0 ° declination).

     

Edited by eggrobin
typo
Link to comment
Share on other sites

On 8/19/2016 at 1:02 PM, eggrobin said:

I don't think this will work with any mod that alters the orbits (the changes will simply be ignored, since we persist our own Cartesian state and simply force the game to put things in the right place by setting the orbits).

More importantly though, it seems that @Whitecat106's mod and ours have roughly the same goals, so you probably don't want to have both installed: @Whitecat106 appears to be working on multibody and extended/inhomogeneous body gravitation, and we have atmospheric decay as one of our (rather long-term) aims.

@Whitecat106, you might want to put this mod in your list of known incompatibilities, since we're likely to attract the same users.

Some development news:

Axial tilt appears to be working (there will probably be some weirdness with landed vessels on distant planets appearing in the wrong place until you switch to them or come close to them, but this shouldn't be too big of an issue), see the relevant pull request (under review as of this writing).

Some screenshots (links, because apparently imgur album embedding broke).

With the Earth as main body, Earth's equator is the horizontal plane. Note that the Earth isn't tilted, and Saturn exhibits very little tilt (it is tilted by less than 6.5 degrees from the Earth's axis). The moon is noticeably tilted (since its equator is close to the ecliptic), and so is the whole Jovian system. Uranus is also shown, pointing one of its poles to the Sun.

With the Moon as main body, (i.e. when the active vessel is close to the Moon), the horizontal is close to the ecliptic; thus the Earth appears with its usual tilt, the whole Saturn system is similarly tilted, and the Jovian system exhibits virtually no tilt.

This also means that the Pluto/Charon system can appear properly tidally locked (not shown). Side note: it seems that in RSS, the Pluto texture is off by 90 degrees in longitude, @NathanKell may want to look into this.

Note that in the above screenshots, the sky box (or as it's called in the KSP API, galaxy cube) is something I made for testing purposes, with right ascension/declination graticules (note that the parallels are aligned with Earth's equator), a line showing the ecliptic, and absurdly large bright stars in order to immediately identify whether the constellations are correctly positioned and oriented.

Indeed, while experimenting with tilt, I noticed that existing skyboxes based on the real sky seem to suffer from rotation or mirroring issues: as far as I can tell, @Oinker's box is mirrored upside-down, possibly with an additional rotation (the constellations have the wrong chirality and the pole star is down), and @pingopete's RVE skybox is mirrored, and is oddly tilted (it may be that it is aligned with the ecliptic and then tilted 90 degrees, I'm not exactly sure).

For reference, this is what I have found about the skybox textures, showing how they're attached into a cube, and which side is in which direction; note that when declination is up, right ascension is left (i.e. like when looking at the sky). The textures are oriented as seen from inside the cube, not from "outside the celestial sphere".

  • 
       -y <------- North Pole; right ascension increases clockwise.
    -x +z +x -z <- Equator; right ascension increases from right to left.
             +y <- South Pole; right ascension increases counterclockwise.
    ^------------- the -x texture is the sky above KSC
                   at the beginning of the game in stock.
                   In RSS, it is centred around the vernal equinox
                   (0 h right ascension, 0 ° declination).

     

That skybox I did was literally a 6 face cubemap export from space engine from somewhere near sol :P I thought the plane of the galaxy looked a bit off tbh haha

Link to comment
Share on other sites

have to say this adds a whole new dimension of realism and difficulty.. I like it.  Any good tutorials on putting up an L5 station?  I'm still learning the Principia flight planner as well, but the L5 station is one of my goals...
Just glad that this thing seems to have no apparent incompatibilities with KSP Interstellar :)

Link to comment
Share on other sites

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