Jump to content

How long is a Kerbin year?


pincushionman

Recommended Posts

I've been working on an orrery for the Kerbol system and I've run into a couple of issues with regard to the length of Kerbin's year.

Using values from the wiki and extracted from the game (suppposedly) using HyperEdit, I've managed to calculate this year length:

Parameter

Symbol

Value

Source

Gravitational Constant

G

6.67408 ∙ 10-11 m3/(kg ∙ s2)

From patch notes

Acceleration at Kerbin SL

g0

9.80665 m/s2

From patch notes

Acceleration at Sun surface (in g’s)

gS,g

1.7462500333786 ∙ g0

Extracted with HyperEdit

Acceleration at Sun surface (m/s2)

gs

17.1248629 m/s2

gs,g ∙ g0

Radius of Sun

rs

2.616 ∙ 108 m

From wiki / verified in game

Sun gravitational constant

GMs

1.171932456926 ∙ 1018 m3/s2

gs = GMs/rs2

Kerbin SMA

rk

13599840256 m

Extracted with HyperEdit

Kerbin orbital period

Tk

9205116.471 s

T = 2π√(rk3/GMs)

This works out to a Kerbin year of 426 d, 0 h, 58 m, 36.471 s. And there are two problems with this value.

First, I can't replicate this in-game. I placed a satellite into a 13599840256 m orbit around the Sun using the debug menu orbit editor and compared the apoapsis and periapsis of this orbit, and I get a difference of 213 d, 0h, 16 m, for an orbit of 426 d, 0 h, 32 m. You'll notice my math gives a different result by some 27 minutes, give or take a minute (.0173%). This may not seem like much, but given the precision needed for successful small-body encounters in KSP, accuracy to the game's physics is key. So one of two things is happening: either my math is wrong or the values I'm using for my calculations are. Please check my math, and if anyone knows any methods to determine these values correctly, I'm all ears.

Second, you'll notice this isn't an integral number of days, no matter which one is used. So, like Earth, there should be leap years. Given my math above, the sequence would be one extra day every six years, except for the 258th year of each cycle (like how on Earth we have one extra day every four years EXCEPT for years divisible by 100 (like 1900) UNLESS it's also divisible by 400 (like 2000)). But given the year length in-game is a little more than 426 d 1/2 h, it would be one extra day every 12 years, except on the 180th year of the cycle. Or something odd like that. But I've timewarped for 15 years and saw no evidence of a leap day in any of those years. Does the game simply do 426-day years and let the "new year" point drift backward by 1/2 hour each year?

Now, I do understand that the math as it is now is going to be dang close. However, objects in-game are moving faster than in my model. I'd like to be able to plot user-defined trajectories as well as the planet positions, and if the orbital motions are off by even a small amount, the data the tool gives about encounters is going to be bad information. Plus I'm a little obsessive about accuracy. Either way, I'd like to avoid this kind of error if I can.

Thanks in advance for your help!

Link to comment
Share on other sites

The wiki also says that the suns GM= 1.1723328×1018 m3/sGiven that real world physics knows the GM values to high degree of accuracy but is less accurate for G and M I expect that that is the value the KSP actually uses when calculating motion. That also gives a period of 426d00:32:24.597 which matches your observed value.

As for leap days I'm pretty sure kerbals don't bother with them - Kerbin has no axial tilt and its orbit is perfectly circular so I has no seasons. I suspect they are content to just allow the fixed stars to effectively drift round on a 4 thousand year cycle.

 

Link to comment
Share on other sites

1 hour ago, Veeltch said:

So basically Kerbin moves too slow for it's orbit?

I don't think so, It is correct if you take the stated GM for the sun from the wiki. I expect that there are some rounding errors in the chain of maths the OP was using to calculate the period.

As for the non-integer number of days in a year, it is pretty unlikely that a non-tidally fixed body would have an integer ratio. Especially as the day rotation rate of kerbin has changed over versions to make the synodic day exactly 6 hours  (it used to be the sidereal day that was 6 hours) without altering the year length.

Link to comment
Share on other sites

I've re-checked my math using a fresh pull from HyperEdit v 1.5.3 in KSP 1.2.2, and it's pulling different values for Sun surface gravity multiplier (1.746846561) than what I had previously pulled using HyperEdit 1.5.2 in KSP 1.2 (1.7462500333786). Using the newer value I get a sun GM of 1.17233E+18, which in turn gives me a year of 426 d, 0 h, 32 m, 24.6 s, which is what we want. Looks like I'll be doing a fresh pull of all the body data; I haven't re-computed the elliptic orbits yet anyway.

However, it brings up another quirk - the GeeASL HyperEdit is pulling for Kerbin (the surface gravity multiplier) is 1.000341605, where you would expect it to be 1.0. If you multiply this by the (new) standard gravity of 9.80665, you get...9.81. Makes you wonder why they even bothered to change the g0 constant in the game, if they were just going to hack the gravity back to its old value. It's obvious they adjusted the M values of the planets to get the old GM values back regardless of the G value. I haven't checked to see if any of the engine performance measures have changed as a result of this (and probably won't), that's the only other place where I remember this showing up.

Link to comment
Share on other sites

I expect that the masses of the bodies aren't written into the config anywhere as that would be redundant. Much simpler to just record the GM value and have G as a constant and compute M on the rare occasions you ever need it.

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