Skip to content

Commit

Permalink
Use gravParameter for all bodies (#260)
Browse files Browse the repository at this point in the history
Instead of specifying mass in some locations and gravParameter in otthers, use gravParameter everywhere
Ref: https://github.com/mockingbirdnest/Principia/blob/master/astronomy/sol_gravity_model.proto.txt
Fixes #259
  • Loading branch information
DRVeyl authored May 16, 2022
1 parent 0017b82 commit 97f883b
Show file tree
Hide file tree
Showing 35 changed files with 78 additions and 92 deletions.
59 changes: 30 additions & 29 deletions GameData/RealSolarSystem/Compatibility/BreakingGround.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Run in AFTER, so that planetary mass settings have been done
// This scaling factor is for balance only. Using initial/WIP value from https://github.com/KSP-RO/RealSolarSystem/issues/249
@DEPLOYEDSCIENCE:AFTER[RealSolarSystem] { @SEISMICENERGY { scale = 1.25e12 } }
// Revise to use gravParameter instead of mass.
@DEPLOYEDSCIENCE:AFTER[RealSolarSystem] { @SEISMICENERGY { scale = 83.5 } }
@DEPLOYEDSCIENCE:AFTER[RealSolarSystem]
{
Expand All @@ -12,142 +13,142 @@
ENTRY
{
BodyName = Mercury
Energy = #$@Kopernicus/Body[Mercury]/Properties/mass$
Energy = #$@Kopernicus/Body[Mercury]/Properties/gravParameter$
}
ENTRY
{
BodyName = Venus
Energy = #$@Kopernicus/Body[Venus]/Properties/mass$
Energy = #$@Kopernicus/Body[Venus]/Properties/gravParameter$
}
ENTRY
{
BodyName = Earth
Energy = #$@Kopernicus/Body[Kerbin]/Properties/mass$
Energy = #$@Kopernicus/Body[Kerbin]/Properties/gravParameter$
}
ENTRY
{
BodyName = Moon
Energy = #$@Kopernicus/Body[Moon]/Properties/mass$
Energy = #$@Kopernicus/Body[Moon]/Properties/gravParameter$
}
ENTRY
{
BodyName = Mars
Energy = #$@Kopernicus/Body[Mars]/Properties/mass$
Energy = #$@Kopernicus/Body[Mars]/Properties/gravParameter$
}
ENTRY
{
BodyName = Phobos
Energy = #$@Kopernicus/Body[Phobos]/Properties/mass$
Energy = #$@Kopernicus/Body[Phobos]/Properties/gravParameter$
}
ENTRY
{
BodyName = Deimos
Energy = #$@Kopernicus/Body[Deimos]/Properties/mass$
Energy = #$@Kopernicus/Body[Deimos]/Properties/gravParameter$
}
ENTRY
{
BodyName = Ceres
Energy = #$@Kopernicus/Body[Ceres]/Properties/mass$
Energy = #$@Kopernicus/Body[Ceres]/Properties/gravParameter$
}
ENTRY
{
BodyName = Vesta
Energy = #$@Kopernicus/Body[Vesta]/Properties/mass$
Energy = #$@Kopernicus/Body[Vesta]/Properties/gravParameter$
}
ENTRY
{
BodyName = Callisto
Energy = #$@Kopernicus/Body[Callisto]/Properties/mass$
Energy = #$@Kopernicus/Body[Callisto]/Properties/gravParameter$
}
ENTRY
{
BodyName = Europa
Energy = #$@Kopernicus/Body[Europa]/Properties/mass$
Energy = #$@Kopernicus/Body[Europa]/Properties/gravParameter$
}
ENTRY
{
BodyName = Ganymede
Energy = #$@Kopernicus/Body[Ganymede]/Properties/mass$
Energy = #$@Kopernicus/Body[Ganymede]/Properties/gravParameter$
}
ENTRY
{
BodyName = Io
Energy = #$@Kopernicus/Body[Io]/Properties/mass$
Energy = #$@Kopernicus/Body[Io]/Properties/gravParameter$
}
ENTRY
{
BodyName = Dione
Energy = #$@Kopernicus/Body[Dione]/Properties/mass$
Energy = #$@Kopernicus/Body[Dione]/Properties/gravParameter$
}
ENTRY
{
BodyName = Enceladus
Energy = #$@Kopernicus/Body[Enceladus]/Properties/mass$
Energy = #$@Kopernicus/Body[Enceladus]/Properties/gravParameter$
}
ENTRY
{
BodyName = Iapetus
Energy = #$@Kopernicus/Body[Iapetus]/Properties/mass$
Energy = #$@Kopernicus/Body[Iapetus]/Properties/gravParameter$
}
ENTRY
{
BodyName = Mimas
Energy = #$@Kopernicus/Body[Mimas]/Properties/mass$
Energy = #$@Kopernicus/Body[Mimas]/Properties/gravParameter$
}
ENTRY
{
BodyName = Rhea
Energy = #$@Kopernicus/Body[Rhea]/Properties/mass$
Energy = #$@Kopernicus/Body[Rhea]/Properties/gravParameter$
}
ENTRY
{
BodyName = Tethys
Energy = #$@Kopernicus/Body[Tethys]/Properties/mass$
Energy = #$@Kopernicus/Body[Tethys]/Properties/gravParameter$
}
ENTRY
{
BodyName = Titan
Energy = #$@Kopernicus/Body[Titan]/Properties/mass$
Energy = #$@Kopernicus/Body[Titan]/Properties/gravParameter$
}
ENTRY
{
BodyName = Ariel
Energy = #$@Kopernicus/Body[Ariel]/Properties/mass$
Energy = #$@Kopernicus/Body[Ariel]/Properties/gravParameter$
}
ENTRY
{
BodyName = Miranda
Energy = #$@Kopernicus/Body[Miranda]/Properties/mass$
Energy = #$@Kopernicus/Body[Miranda]/Properties/gravParameter$
}
ENTRY
{
BodyName = Oberon
Energy = #$@Kopernicus/Body[Oberon]/Properties/mass$
Energy = #$@Kopernicus/Body[Oberon]/Properties/gravParameter$
}
ENTRY
{
BodyName = Titania
Energy = #$@Kopernicus/Body[Titania]/Properties/mass$
Energy = #$@Kopernicus/Body[Titania]/Properties/gravParameter$
}
ENTRY
{
BodyName = Umbriel
Energy = #$@Kopernicus/Body[Umbriel]/Properties/mass$
Energy = #$@Kopernicus/Body[Umbriel]/Properties/gravParameter$
}
ENTRY
{
BodyName = Triton
Energy = #$@Kopernicus/Body[Triton]/Properties/mass$
Energy = #$@Kopernicus/Body[Triton]/Properties/gravParameter$
}
ENTRY
{
BodyName = Pluto
Energy = #$@Kopernicus/Body[Pluto]/Properties/mass$
Energy = #$@Kopernicus/Body[Pluto]/Properties/gravParameter$
}
ENTRY
{
BodyName = Charon
Energy = #$@Kopernicus/Body[Charon]/Properties/mass$
Energy = #$@Kopernicus/Body[Charon]/Properties/gravParameter$
}
@ENTRY,* { @Energy /= #$../scale$ }
}
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Ceres/Ceres.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
displayName = #RSS_Ceres_name//Ceres
description = #RSS_Ceres_desc//Ceres is the largest object in the asteroid belt, holding about a third of the Asteroid Belts mass. It was the first thing in the Asteroid Belt discovered, and it is so large that it is spherical. It is classified as a Dwarf Planet, and is only a bit smaller than Pluto. It is currently orbited by the Dawn Probe.
radius = 473000
mass = 9.39e+20
gravParameter = 6.26325000000000e+10
rotationPeriod = 32666.4
tidallyLocked = false
initialRotation = 0
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Earth/Earth.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
initialRotation = 100.1833
tidallyLocked = false
// does nothing - axialTilt = 23.44
gravParameter = 3.986004418e+14
gravParameter = 3.9860043543609598e+14
albedo = 0.29
emissivity = 0.71
timewarpAltitudeLimits = 0 140000 140000 140000 140000 2000000 35000000 35000000
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Earth/Moon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Moon_name//The Moon
description = #RSS_Moon_desc//The Moon is Earth's only satellite, a large, gray, and rather barren rock. It is the only other body besides Earth that humans have stepped on and, briefly, called home.
radius = 1737100
mass = 7.34767309E+22
gravParameter = 4.9028000661637961e+12
solarRotationPeriod = False
rotationPeriod = 2360584.68479999
tidallyLocked = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
displayName = #RSS_Callisto_name//Callisto
description = #RSS_Callisto_desc//The fourth of the Galilean moons, Callisto is the second-largest moon in the Jovian system. Callisto has a very thin atmosphere comprised mostly of carbon dioxide and has a rather intense ionosphere.
radius = 2409300
mass = 1.075938E+23
gravParameter = 7.179289361397270e+12
solarRotationPeriod = False
rotates = true
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Jupiter/Europa.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
displayName = #RSS_Europa_name//Europa
description = #RSS_Europa_desc//The smallest of the four Galilean moons but only slightly smaller than our Moon, Europa is a rocky moon with a surface mostly made up of water ice. It is believed that under this icy surface a water ocean exists, possibly holding life within the depths.
radius = 1550800
mass = 4.7998E+22
gravParameter = 3.202738774922892e+12
solarRotationPeriod = False
rotates = true
tidallyLocked = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
displayName = #RSS_Ganymede_name//Ganymede
description = #RSS_Ganymede_desc//The largest moon in our Solar System, Ganymede is the third Galilean moon around Jupiter. Ganymede has a liquid iron core which produces a unique, yet meager, magnetosphere.
radius = 2624100
mass = 1.4819E+23
gravParameter = 9.887834453334144e+12
solarRotationPeriod = False
rotates = true
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Jupiter/Io.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
displayName = #RSS_Io_name//Io
description = #RSS_Io_desc//The closest Galilean moon to Jupiter, and the fourth-largest moon in our Solar System, Io, like all other Galilean moons, was named after one of Zeus's lovers. Io is the most active body in the Solar System geologically which produces an effect on the other moons in Jupiter's grasp. There have been observations of large eruptions that are estimated to rise up to five-hundred-kilometers. Io is made up of silicate rock with an iron sulfide core which can give it the distinctive look achieved by plains coated in sulfur and sulfur dioxide.
radius = 1811300
mass = 8.9319E+22
gravParameter = 5.959916033410404e+12
solarRotationPeriod = False
rotates = true
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Jupiter/Jupiter.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
displayName = #RSS_Jupiter_name//Jupiter
description = #RSS_Jupiter_desc//The largest planet in our solar system, the gas giant Jupiter. This planet alone is two and a half times the mass of all of the other planets in the Solar System combined. Made up largely of hydrogen and helium with a relatively mysterious rocky core of heavy elements, Jupiter bears a unique and beautiful cosmic painting of various layers with a prominent and awe-inspiring storm that is said to have existed possibly over three-centuries. Jupiter has at least sixty-seven moons counting the four large "Galilean Moons", one of which has a greater diameter than the first planet Mercury.
radius = 69373000 // 1000 atm, 69911000 to 1 bar
gravParameter = 1.26686534E+17
gravParameter = 1.266865349218008E+17
solarRotationPeriod = False
rotationPeriod = 35730
rotates = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Mars/Deimos.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Deimos_name//Deimos
description = #RSS_Deimos_desc//The second natural satellite around Mars, Deimos is named after Phobos' twin brother, said to personify terror.
radius = 5456
mass = 1.48E+15
gravParameter = 9.615569648120313e+4
solarRotationPeriod = False
rotationPeriod = 109123.2
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Mars/Mars.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
displayName = #RSS_Mars_name//Mars
description = #RSS_Mars_desc//The Red Planet. Named after the Roman god of war, Mars is the fourth planet, and second smallest planet in our solar system. Its reddish appearance is due to large amounts of iron oxide on the surface. Mars has a very thin atmosphere and has many craters which resemble our very own Moon. Mars also has the second highest known mountain in our solar system.
radius = 3375800 // RSS datum, 3382950 to 6.1 mbar, 3389500 volumetric mean
gravParameter = 4.282831E+13
gravParameter = 4.282837362069909E+13
solarRotationPeriod = False
rotationPeriod = 88642.6848
rotates = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Mars/Phobos.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Phobos_name//Phobos
description = #RSS_Phobos_desc//One of two natural satellites orbiting Mars, Phobos is named after the Greek god which was depicted as the embodiment of horror. Phobos is the larger and closer natural body around Mars
radius = 7250
mass = 1.072E+16
gravParameter = 7.087546066894452e+5
solarRotationPeriod = False
rotationPeriod = 27553.843872
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Mercury/Mercury.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
displayName = #RSS_Mercury_name//Mercury
description = #RSS_Mercury_desc//The first planet in our neighborhood. Mercury is the smallest and fastest of the planets in the solar system. From Earth you may be able to see this planet in the early morning or evening. With temperatures varying from very hot to very cold, this planet is not one that you would want to be on for very long.
radius = 2439700
mass = 3.3022E+23
gravParameter = 2.2031780000000021e+13
solarRotationPeriod = False
rotationPeriod = 5067031.68
tidallyLocked = false
Expand Down
3 changes: 1 addition & 2 deletions GameData/RealSolarSystem/RSSKopernicus/Neptune/Neptune.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
displayName = #RSS_Neptune_name//Neptune
description = #RSS_Neptune_desc//Neptune is the eighth and farthest planet from the Sun in the Solar System. It is the fourth-largest planet by diameter and the third-largest by mass. Among the gaseous planets in the Solar System, Neptune is the most dense.
radius = 24085000 // 1000 atm, 24622000 to 1 bar
gravParameter = 6.836529E+15
// mass = 1.0243E+26 commented out for low precision
gravParameter = 6.835099502439672E+15
solarRotationPeriod = False
rotationPeriod = 58000.32
tidallyLocked = false
Expand Down
3 changes: 1 addition & 2 deletions GameData/RealSolarSystem/RSSKopernicus/Neptune/Triton.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
displayName = #RSS_Triton_name//Triton
description = #RSS_Triton_desc//The largest satellite around Neptune, Triton is unique among all large moons in the Solar System for its retrograde orbit around its planet.
radius = 1353400
gravParameter = 1.4279E+12
// mass = 2.14E+22 less precise, so commented out
gravParameter = 1.427598140725034E+12
solarRotationPeriod = False
rotationPeriod = 507773
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Pluto/Charon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
displayName = #RSS_Charon_Name//Charon
description = #RSS_Charon_desc//Charon is the largest of Pluto's moons, and is mutually gravitationally locked with it, so each keeps the same face towards the other.
radius = 603500
mass = 1.52E+21
gravParameter = 1.058799888601881e+11
solarRotationPeriod = False
rotationPeriod = 551856.70656
tidallyLocked = true
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Pluto/Pluto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Pluto_name//Pluto
description = #RSS_Pluto_desc//Recently removed from the planetary list, Pluto has been dubbed a "minor-planet". It is the largest object in the Kuiper belt second most massive known dwarf planet. Pluto is mostly comprised of rock and ice and is quite small.
radius = 1187000 // 1143000
mass = 1.305E+22
gravParameter = 8.696138177608748e+11
solarRotationPeriod = False
rotationPeriod = 551856.672
tidallyLocked = false
Expand Down
39 changes: 15 additions & 24 deletions GameData/RealSolarSystem/RSSKopernicus/Pluto/RotationPeriod.cfg
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
@Kopernicus:FOR[RealSolarSystem]
{
// Pluto and Charon are locked to eachother, with rotation period == [(aaa/(m+M))*(4pp/G)]^0.5, where:
// a is Charon's SMA
// m+M is the combined mass of Pluto+Charon
// p is pi
// G is the gravitational constant
// Refactoring to [(aaa * 4pp) / (mG+MG)]^0.5, because mG = body.gravParameter
@Body[Charon]
{
@finalizeOrbit ^= :t:T:
@finalizeOrbit ^= :R:r:
@finalizeOrbit ^= :U:u:
@finalizeOrbit ^= :E:e:
@Properties
{
%rotationPeriod = 0
}
}
@Body[Charon]:HAS[#finalizeOrbit[True]]
{
@Properties
{
@rotationPeriod += #$mass$
}
}
@Body[Charon]
{
@Properties // rotation period is [(aaa/(m+M))*(4pp/G)]^0.5
{
@rotationPeriod += #$/Body[Pluto]/Properties/mass$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= #$../Orbit/semiMajorAxis$
@rotationPeriod /= 591525585920.849 // divide by (4pi^2 / G)
@rotationPeriod != -0.5
_denom = #$/Body[Pluto]/Properties/gravParameter$
@_denom += #$gravParameter$
%rotationPeriod = #$../Orbit/semiMajorAxis$
@rotationPeriod != 3
@rotationPeriod *= 39.478417604357434475337963999505 // 4*pi*pi
@rotationPeriod /= #$_denom$
@rotationPeriod != 0.5
!_denom = DEL
}
}
@Body[Pluto]
Expand Down
2 changes: 1 addition & 1 deletion GameData/RealSolarSystem/RSSKopernicus/Saturn/Dione.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Dione_name//Dione
description = #RSS_Dione_desc//At 1122 km in diameter, Dione is the 15th largest moon in the Solar System, and is more massive than all known moons smaller than itself combined, first discovered in 1684 by Giovanni Cassini.
radius = 561400
mass = 1.095452E+21
gravParameter = 7.311636648732e+10
solarRotationPeriod = False
rotationPeriod = 236469.456
tidallyLocked = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
displayName = #RSS_Enceladus_name//Enceladus
description = #RSS_Enceladus_desc//Enceladus is the sixth-largest moon of Saturn, covered by fresh, clean ice and the surface temperature at noon only reaches 75 K. Its notable features include water-rich plumes venting from cryovolanoes the south polar region.
radius = 252100
mass = 1.08022E+20
gravParameter = 7.211454165826e+9
solarRotationPeriod = False
rotationPeriod = 118386.8352
tidallyLocked = true
Expand Down
Loading

0 comments on commit 97f883b

Please sign in to comment.