<p>Yes, the Solar System barycentre (SSB) <em>is</em> usually outside of the Sun. That is, over the long term, the mean distance from the centre of the Sun to the SSB is greater than the Sun's radius of 695,700 km. (That's the IAU's nominal <a href="https://en.wikipedia.org/wiki/Solar_radius" rel="nofollow noreferrer">solar radius</a>).</p>
<p>As ProfRob commented, we don't really know the exact location of the SSB, since we can only calculate it based on the known bodies in the Solar System, and we simply don't know the locations, trajectories, and masses of all the bodies in the outermost reaches of the system. So we use a nominal SSB with a location consistent with the motions of the known bodies, and that location is updated when new information becomes available.</p>
<p>The Jet Propulsion Laboratory (JPL) have been producing ephemerides since the 1960s. Their <a href="https://en.wikipedia.org/wiki/Jet_Propulsion_Laboratory_Development_Ephemeris" rel="nofollow noreferrer">JPL Development Ephemeris</a> series is not only used by NASA, it's also been the basis of the <a href="https://en.wikipedia.org/wiki/Astronomical_Almanac" rel="nofollow noreferrer">Astronomical Almanac</a> since 1981. Their ephemeris data covering 9999 BC to 9999 AD is freely available via the <a href="https://ssd.jpl.nasa.gov/?horizons" rel="nofollow noreferrer">Horizons</a> system. They recently updated their SSB info:</p>
<blockquote>
<p><a href="https://ssd.jpl.nasa.gov/?horizons_news" rel="nofollow noreferrer"><strong>April 12, 2021</strong></a>
Due to the addition of KBO mass in DE440/441, the SSB has shifted about 100 km</p>
</blockquote>
<hr />
<p>A few months ago, I added a link to an interactive 3D version of the Sun-SSB diagram to <a href="https://astronomy.stackexchange.com/a/28036/16685">this answer</a>. I used that Python code as the basis of a new script that creates 2D plots of the radial distance of the centre of the Sun from the SSB for any timespan in the Horizons database. It also integrates the mean radial distance over the selected timespan. Here's an example plot, covering 1700 AD to 2200 AD, with a timestep of 1 calendar year, which yields a mean distance of 829,224 km. A timestep of 1 calendar month gives a mean distance of 829,185 km. That's comfortably larger than 695,700 km.</p>
<p><a href="https://i.sstatic.net/rmJpT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rmJpT.png" alt="Sun-Barycentre distance, 1700-2200" /></a></p>
<p>The vertical scale is in kilometres, which the plotting library prints in scientific notation, with &quot;1e6&quot; near the top of the axis. The horizontal axis is labelled with <a href="https://en.wikipedia.org/wiki/Julian_day" rel="nofollow noreferrer">Julian day numbers</a>, which are also displayed in scientific notation.</p>
<p>I chose 500 years because it's long enough to include a few orbits of Neptune and it's approximately a whole number of cycles of the 3 outer planets. It's also convenient that it's a whole number of decades. ;)</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th>Planet</th>
<th>Cycles</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jupiter</td>
<td>42.15</td>
</tr>
<tr>
<td>Saturn</td>
<td>16.95</td>
</tr>
<tr>
<td>Uranus</td>
<td>5.95</td>
</tr>
<tr>
<td>Neptune</td>
<td>3.03</td>
</tr>
</tbody>
</table></div>
<hr />
<p>Here's a live version of the <a href="https://sagecell.sagemath.org/?z=eJyNF_1v2kj2d_8V02m12FlwIL1mr5zQLUkdLd0kIEy76lFkTfAAbo3tnRkTaJT__d6b8RekJ12kYM-b9_1tSimZciUivuPEzxOSpTJSUZqQX8iOx-kyUgcSMsXISqRb8kcqoh9pIi0CfywJyVqwbEMiJUkYScWSJTeIagPs0pgJ4h-k4lvywMRhyRMlOLF9_8qxNIu_RKQUT8jDgUzuyMU0StbkonvRc7u_ub1LjfIpA_E8JColueSacakFWUUxJ8PJqKB57_beGxrJJREsWXMwQz87Api0SZIqAmoqDsYtVSqkRSm1rGibpUIRARiC_51zqaSlzVjlCaClsSQFSizyYMmWG25ZuYjJgNCNUpnsn59LGbrfsthNmGTuOt2dsyw63xSaBqipCxBqwU-w40Kij4Ec1AYFHpjkwXIbIgQUuh7f3Q3vP8CpBTFpWdfe_cyb4vF38F3Luhv-6QXe5A_vDmFfPL9lzYZXt14w-zLxEPTZu56NpwAef5oFn-5HMx-hf951PrSsqXcTTG6H9xrRu74dTWajawP2v_gzw_PjRbfbbVnIJ7geT7Xs-_G9p0HB7fDKu_UNzEA-eLezYTArQdf-5-BmPL0bzioFx1cfgw_D2bBJpZVGwGXLBOL3yr_2lu1l9IMPokTZbx3HCvmKrLhabgJMRxuiKFQbgplm-Mszp69Db5y4Qm6v3rzxxzfWU-ncZ8ufDaezYDa600KfNI_nzkeWdHqkd9FHi_3ZeNLESLMXCN4k8Ef_KRF49txCUR6I0jagFpBFcF3mkgtFpWzIl7YupcFTa5WKLVOtPmkpvlet57ZOZQk3UZLleGG3QONWG-1xnh3NtM4awV3JmVhubEEx_T97U380vu9_lWf2V__MoTqPXeTtuGuR5pndMzyiVcXm1YA0ctF4D_8ygS5f0b-YSKAe-7rASqJIkqfiHZR-yBUUJMDkUkSZwluwjDw1-D7TotS3J3rb_5bO1zdfIUSe7Z7pV2_sNTUvFd4i3_s04ac60vsx0VXgTUc-dU5uj_mYqKhcJJqV1ThvKxfNe_2FZck8EQyz6PL9u9-6XfKajIafiNTdDC6iXEKiggQu2FLpvNyyKDEZOaC995ddahJzQKEvmQOHQ498oW0QHKZKDmYih26zzMWOl-9pnIoBFTzUWDr5L9vkMQrVZtADJrt1gclylQa57ouDGxZLXuQ--AobnI0CCMRBc3deeM3nMTQ_wqCbcSYVAXeQdEWOqOip10wQ9SQYvKhDV8IEyWzHmN088epUhVPz-J8RTQnPNnzLBWCYuZPmSfjqpT4NdfDhyiyOVBwlXNpO83IuzZXdareceb_TW-gchY6eaJSFRn6tgSJ9LMH9MovSR-dfRz54TSZ4Q7TlMF_QZPIxjyOGlAcJIIyMmZGFWTcwTPqQCGfIet5dzPsXC6eJMEv7hFQIoKTB0CgqgP4B9YTjZm7UPUAVyfoYQxgDhAGoyu5TgyoHvibeXmHukiWLeRICGSpc3QMUz1iv6SP0rqp56KEfPizbpJBVYBYOxo6NL4MTdEDEhyt4FrMlt6kLhlLquHH6yIVdIxdc8eFm4Fy9iNi0Qx1w2SmW5vyrPlk_Ma0OSJvE0XqjOira4nzHbaDdWAoq2m9hmwRwA00a-c9XccqULZ06XcAdi1oWpDIKx2CRAcztLtUbkVYPemsVk9rxp6HSujcvdVhhTcggKraNCiHEcWqhVS4cYWmdS7QQEgUDXmarr_MU9yazrD1GamP2M1j3TD8jWDcm1-IUFKukYKoWroc-f3SDOVpcTeACOdhzG-ih7HUDhfq3gag6LqoW9wBp8J22NY1Uh5gPaMfVTU8LgjIGCGjXuaqXxnK9BLK1iEJNOpjPc9BBByjHAGn_gRy6Zd9SQRclS7bnMojZA4-BhtapgXn4fUsAsYkS6Nbbc3vvcCyv9Ql_nMLYX8ENMFdsOtXOoyd2vjCzWAIViwMGqZhswaIBjflKlbMxMt23zhQtJEuhNUgbbIReUBtZhQC01rq9KyXqX6eM-1UexSG54j8iXjR105JUtoN4RTC-7IqVMU11IeHgf9cFhARNBFxzZejrjoONBQ62IXEMkAmOHbdbtR9Y0KD8dlrrbFebFypMJdIBiTVsj51ckXPytoahNuEBLkClM0BBZvp5VPFY74WdqELdfFAfcKR96GKngH8bOILY8OCAnAsHeaHEi2ZRa1OPixb7ILgD6w1NBkaoiuYKDHWiI1eEGe4IgYOzcI74GC-WpYuj5VRM7eEXASmcWYb3jmMOlx9dD1w9cviQKuq6JUlRN79oUP31ZXYxpB0Y_5zr7MVYxGlzJK3osYQBeUKyvvt29Uy-b2mjGpq1jzhV5evD4ig9j6q-T1_UFAqlR_Qn5P9XNZ3EUPN_0BkSZExtbBOIn9fNMAzrwag7ihm52yiBCMCQA1dMXDziioNvbA9vBgm7OqJAqulnR9NhonXd7ruqMMrWXjWtE12NLwg9-0cx4sAjmuZld4E9W0XLY29gqLmgDZO-5bDoMZnh4gdTL0r1zV7btAdF26f27Sv79sa-n9hsit4whSrbG4P32uDzYweYMMP2rwJDEGgt7K77T_BNwePcLLt1GGHlbTjGlWwH2wOkN84FbL4sdgGlsRuG-JWxBiGQtrBsHIItS9j6aMnAYbVR29gOce-HgRgt4fMc9rNAszdS2uQJPm9ayL3VbtQo0KhDBiU8zhV8p422wNzfrR1EdEGu7bghX6Yht8tpLDfpoz1x_gsT4hMb&amp;lang=sage" rel="nofollow noreferrer">plotting script</a>, running on the SageMathCell server. It has various options (including SVG display) which (I hope) are self-explanatory. The start &amp; stop values must be whole year numbers, possibly with an &quot;AD&quot; or &quot;BC&quot; prefix or suffix (this notation is needed for years before 100 AD). The step parameter has various options, see the <a href="https://ssd.jpl.nasa.gov/?horizons_doc#stepping" rel="nofollow noreferrer">Horizons docs</a> for details, but briefly &quot;6 Month&quot; steps by 6 calendar months, &quot;100 days&quot; steps by 100 days, and a plain number without any letters divides the timespan into that number of equal steps.</p>
<p>The script caches the last 3 sets of data fetched from Horizons, so if you just modify &quot;cosmetic&quot; options (without changing the timespan or time step) it can reuse the data rather than having to request the identical data again.</p>
<p>The script doesn't use any Sage features, apart from the plotting routines, so you can use the functions that fetch and parse Horizons data in a standard Python environment. (The code that converts Horizons commands to a URL is much more robust than the code I used in the 3D plot).</p>
<p>Here's an SVG corresponding to that Wikipedia diagram: 1945-1995, with 1 year steps. It has a mean distance of 822,369 km.</p>
<p><a href="https://raw.githubusercontent.com/gist/PM2Ring/663aece06fa7d06bbfdd1ebaa70012ed/raw/d9dfc044e0553d50313278d7d0432639c267c12a/SunSSB.svg" rel="nofollow noreferrer"><img src="https://raw.githubusercontent.com/gist/PM2Ring/663aece06fa7d06bbfdd1ebaa70012ed/raw/d9dfc044e0553d50313278d7d0432639c267c12a/SunSSB.svg" alt="Sun-Barycentre 1945-1995" /></a></p>
<hr />
<p>Outis Nemo mentions in the comments that there's an approximate 179 year cycle in the Sun - SSB distance. ~179 years is a multiple of the <a href="https://en.wikipedia.org/wiki/Orbital_period#Synodic_period" rel="nofollow noreferrer">synodic periods</a> of the 3 outer planets, relative to Jupiter. 9× Saturn, 13× Uranus, 14×Neptune gives 178.769349, -179.558288, -178.949050 respectively, in Julian years. So approximate alignments of all 4 outer planets repeat with a period of  ~179 years.</p>
<p>The most important contribution in this cycle is the Jupiter-Saturn cycle of 178.769349 Julian years, which is approximately 65295.5 days.</p>
<p>I illustrate this cycle in the following polar plot, spanning 1800 years, from AD 300 TO AD 2100, with a 60 day time step (using the Terrestrial Time scale, and the Gregorian calendar). In this plot, the radius gives the Sun-SSB distance (in millions of km), the angle (anticlockwise, from the +X axis) gives the date. The date wraps around with a period of 65295.5 days, so each degree corresponds to ~2 years. Each cycle is plotted in a different colour of the rainbow, starting at red.</p>
<p><a href="https://i.sstatic.net/E0Che5ZP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/E0Che5ZP.png" alt="Sun-Barycentre distance, polar plot" /></a></p>
<p>Here's a polar plot (using a different rainbow palette) spanning 20 cycles (~3600 years), starting from a Jupiter-Saturn conjuction. The solid circle shows the Sun's radius. The dotted circle (with radius 827,467 km) shows the mean distance.</p>
<p>The same symmetries are evident, but the pattern is definitely getting more complex. The end of the cycle is <em>not</em> a Jupiter-Saturn conjuction, but there is a conjunction a few months earlier, on 3013-Dec-17.</p>
<p><a href="https://i.sstatic.net/yrano2M0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yrano2M0.png" alt="Sun-Barycentre distance, polar plot, 3600 years" /></a></p>

CC BY-SA 4.0
2022-03-31T19:55:22.320Z
There's a more general plotting script [here](https://astronomy.stackexchange.com/a/47345/16685), which can plot the distance between pairs of bodies known to Horizons.
PM 2Ring
CC BY-SA 4.0
2022-03-31T21:52:59.810Z
Using the general plotting script, with a date range of 1698-Aug-8 to 2196-May-2, and a step of 2000, the mean distance is ~827,640 km. The graph crosses the mean line (going upwards) on those dates, so the area under the curve gives a more accurate mean.
PM 2Ring
CC BY-SA 4.0
2024-06-12T14:36:35.117Z
You should highlight the ~179-year cycle in the plots above, so as to show that there is some underlying periodicity there. Here I've plotted that 179-year cycle from -3000 to 3000: https://i.postimg.cc/MW7Bwn7s/solarbarycentriccycles3000.png You can see that there are some instabilities that cause parts of it to "flip" (think intermediate axis theorem, the "Dzhanibekov effect") after a certain number of cycles, but overall a lot of the cycle remains remarkably stable.
Outis Nemo
CC BY-SA 4.0
2024-06-12T15:30:40.150Z
@OutisNemo I'll think about it. That's a nice graph you have there. ~179 years is a multiple of the synodic period of the 3 outer planets, relative to Jupiter. 9× Saturn, 13× Uranus, 14×Neptune gives (178.769349, -179.558288, -178.949050) respectively, in Julian years, using [LLL reduction](https://en.wikipedia.org/wiki/Lenstra%E2%80%93Lenstra%E2%80%93Lov%C3%A1sz_lattice_basis_reduction_algorithm). Of course, the actual synodic periods vary a bit from their mean values, but the periodic interaction between Jupiter & Saturn is pretty strong.
PM 2Ring
CC BY-SA 4.0
2024-06-12T15:39:31.263Z
Yes, that's exactly correct. It's not my finding, of course, I've just seen it crop up in various papers (like e.g. this one: https://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1987SoPh..110..191F&defaultprint=YES&page_ind=0&filetype=.pdf) and decided to plot it out over a long time period. I was going to do it with a bigger ephemeris too, but I remember the library I used was having some issues with the biggest ones (DE431/DE441).
Outis Nemo
CC BY-SA 4.0
2024-06-12T15:54:49.180Z
@OutisNemo Here's a polar plot spanning 1100 years. https://i.sstatic.net/8GllUgTK.png The angle is proportional to the time, wrapping at 65295.5 days. (The radius is the distance in km).
PM 2Ring
CC BY-SA 4.0
2024-06-12T16:27:14.500Z
@Outis You can find other cycles using my LLL script. Just try bigger numbers in the `scale` field. The `data` values are synodic periods in Julian years. You can add other data values if you want, or comment out values by prepending the line with `#`. Sorry the code is a bit terse, I had to strip it down to fit it into a comment. ;)
PM 2Ring
CC BY-SA 4.0
2024-06-12T16:27:27.093Z
https://sagecell.sagemath.org/?z=eJxlUsFu4yAUvPMVT%2D6hkLrIuN0kXcnSag8rVUpvvaVZC9kkQbXBAoyrfH0fdqRWKieGmXnMe3ADu90OnGrHJmhrOCEXqCDLMiKe%2DHb9UK4FEQ98K0qxWRNR8s22LDa%5FSFKQP9oE5WQTSKuOUNO%2Dore%2DkZ26zUEUBcuhlUFWz2YYw1%5F7QVElxy5UlxzOSp%5FOoXpEjRyDrccBpar6Jzuv2G8CuJIXs%2DydnbgPTg%2DUwdE6QAzazDT3Q6dDp43ylB1mV4zoiaoJ1tG9lydVqyg7iqYfbtDHGUrTgrEBloukC37S4Uyzm4wd2Fx0wpqdMjTGBQ8OO6erGHPwaqiyN5PloEybdrhnZInSpygRVtDP%2DAVhL7GTD4rUCvl9cWDpyuadLgS%5FKGfpdC9ymBi7uu4qeOGvcHc181bLkzXYVOzZ%5FxLPxSLcF3lxSOq5MDIroBPcw%2DM1j4dUCN%2D7PjnZU8ZfvzXjc8jm6Ono26D88hhfwjSlQWo3aa%5Fqwdn0c9JgGPkEq4Cpww==&lang=sage
PM 2Ring
CC BY-SA 4.0
2024-06-12T16:59:07.727Z
That's very cool indeed, and I guess I could figure out exactly what you're doing so succinctly if I studied the code a bit, but I get the gist of it. The 40- and 139-year cycles are also interesting, as they add up to the 179-year cycle and have also been recognized in the literature: https://www.aanda.org/articles/aa/full_html/2018/07/aa32349-17/aa32349-17.html "One Jose-period is ~9 × JS ~179 yr; sometimes, ~2 × JS ~40 yr before a Jose-period, that is, ~7 × JS ~139 yr after an earlier inversion event, giant planets are already quasialigned and able to produce a retrograde motion."
Outis Nemo
CC BY-SA 4.0
2024-06-13T09:01:42.487Z
@Outis I've added an improved polar plot.
PM 2Ring
CC BY-SA 4.0
2024-06-13T09:32:44.557Z
Awesome! I had missed that plot in the comments earlier, but I see it now, and the fancier version in the post is very cool, where you can see each cycle more clearly too. What I've also always found interesting about it since generating the plot I sent are those parts of the cycle that seem to occasionally switch to a different path due to seemingly reversing direction instead of "passing by" the barycenter, which I believe I've seen referred to as "bimillennial orbital inversions" of retrograde Solar motion, and seen suggestions of possibly being caused by Uranus-Neptune dynamics.
Outis Nemo
CC BY-SA 4.0
2024-06-17T22:40:58.793Z
I saw the updated plot as well, really cool. I hope to find some time to make some such plots myself in the near future, maybe try to get the longest JPL ephemerides to work with the library I'm using, then I can try to plot some of the longer cycles detected with your script too. A thing I noticed about the script is that it provides some multiples of shorter cycles if you plug in larger values for the scale, but maybe there's no easy way to avoid that. I did try looking a bit at the code, but it's definitely a mouthful, and you're probably a bit more mathematically proficient than I am, heh.
Outis Nemo
CC BY-SA 4.0
2021-07-18T14:04:00.293Z
2024-06-15T09:29:43.073Z
2024-06-15T09:29:43.073Z
PM 2Ring
<p>The Sun's motion relative to the Solar System barycenter is dominated by the four planets Jupiter, Saturn, Uranus and Neptune. Neptune is a lot lighter than Jupiter but it's also a lot farther away, and contrary to intuition the farther out it is the <em>larger</em> the induced motion in the Sun around the barycenter.</p>
<p>*<strong>To first order</strong> we can treat the Sun's response to each planet as circular, and the final result as the linear superposition of four circular motions.</p>
<p>I lack the math background to derive the answer analytically, though I am confident someone will soon.</p>
<p><em>Approximate</em> distances of the Sun to the mathematical barycenter of each binary Sun + planet pair, &quot;amplitude&quot;:</p>
<pre><code> body        mass (Sun=1)    a (Rsun=1)    amplitude (Rsun=1)
Sun           1.000              -
Jupiter       9.548E-04      1.119E+03       1.068
Saturn        2.858E-04      2.060E+03       0.589
Uranus        4.366E-05      4.133E+03       0.180
Neptune       5.152E-05      6.465E+03       0.333
</code></pre>
<p>So the interesting thing is that if it were only for Jupiter, the Sun-Jupiter barycenter would always be slightly outside the Sun.</p>
<p>Let's run a simulation of four circular displacements with the amplitudes as shown and periods (not that it matters, as long as they are not rational number relationships) that scale as <span class="math-container">$a^{3/2}$</span> which conveniently will convert my four digit numbers into irrational numbers for me. :-)</p>
<p>As expected based on Jupiter alone putting the barycenter just outside the Sun, when all four main planets are taken into account the barycenter spends about 54% of the time outside the Sun (or the Sun spends 54% of the time further than one of it's radii from the barycenter).</p>
<pre><code>median r:  1.209
mean r:    1.189
max r:     2.17
fraction:  0.542
</code></pre>
<p>The histogram of radial distances shows some interesting structure, which I think should be pursued further both <em>mathematically</em> and numerically.</p>
<p>Since this is a statistical analysis (there are no harmonic relationships between planets in this model) time could just as well be sampled randomly rather than using equal spaces.</p>
<p><a href="https://i.sstatic.net/2vmDc.png" rel="noreferrer"><img src="https://i.sstatic.net/2vmDc.png" alt="Barycenter outside of one solar radius" /></a></p>
<p>In the plot above the <span class="math-container">$x$</span> value for each individual two-body motion is shown with color lines, but the absolute radial distance <span class="math-container">$r$</span> is shown in black for the combined motion.</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt

amplitude = np.array([1.068, 0.589, 0.180, 0.333])
period = np.array([1.119, 2.060, 4.133, 6.465])**1.5

time = np.arange(0, 100000, 0.01)
xd = amplitude[:, None] * np.cos(2 * np.pi * time / period[:, None])
yd = amplitude[:, None] * np.sin(2 * np.pi * time / period[:, None])
r = np.sqrt(xd.sum(axis=0)**2 + yd.sum(axis=0)**2)

bins = 0.01 * np.arange(int(100 * amplitude.sum())+10)
a, b = np.histogram(r, bins=bins)

r_median = np.median(r)
r_max = r.max()
r_mean = r.mean()
fraction = (r &gt; 1).sum() / r.sum() 

print('median r: ', r_median)
print('mean r:   ', r_mean)
print('max r:    ', r_max)
print('fraction: ', fraction)

n = 10000
lw = 0.5
fig, (ax1, ax2) = plt.subplots(2, 1)
for x in xd:
    ax1.plot(time[:n], x[:n], linewidth=lw)
ax1.plot(time[:n], r[:n], '-k', linewidth=lw)
ax2.plot(b[1:], a)
ax2.set_title('fraction &gt; 1 is ' + str(round(fraction, 3)))
plt.show()
</code></pre>

CC BY-SA 4.0
2021-07-15T23:54:06.997Z
2021-07-16T09:34:53.117Z
2021-07-16T09:34:53.117Z
uhoh
<p>Not a direct answer to your question (which others have given already), but maybe still worth considering here:</p>
<p>The dynamics of the solar system can to a high degree of accuracy be calculated by assuming the sun and planets as point masses, so whether the barycenter lies inside or outside the defined surface of the Sun is physically not really relevant for anything, given that it is only a mathematically-defined point, and that the diameter of the Sun will change over time.</p>

CC BY-SA 4.0
2021-07-16T17:53:57.867Z
2021-07-19T22:00:34.973Z
2021-07-19T22:00:34.973Z
Thomas
<p><strong>&gt; Is the barycenter of the solar system usually outside of the sun?</strong></p>
<p>===[ Yes, but it's all Jupiter.</p>
<p>You can separate the components of the barycenter motion. This is how the sun's center gets dragged around by the gas giants:</p>
<p><a href="https://i.sstatic.net/H3v2SGiO.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H3v2SGiO.gif" alt="enter image description here" /></a></p>
<p>The scale bar is the diameter of the sun (1,300,000 km).</p>
<p>Subtract Jupiter's contribution:</p>
<p><a href="https://i.sstatic.net/TYYVbvJj.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TYYVbvJj.gif" alt="enter image description here" /></a></p>
<p>We observe that the other planets, even added together, don't QUITE pull the barycenter outside the sun.</p>
<p>Here's the contribution of Uranus only. <em>Note the scale change.</em> The wiggles are due to the other gas giants perturbing Uranus (not on the sun):</p>
<p><a href="https://i.sstatic.net/3Gga6sSl.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3Gga6sSl.gif" alt="enter image description here" /></a></p>
<p>With a HUGE scale change (zoom in 1,000x), we see that Pluto only pulls the sun about 20 miles off center:</p>
<p><a href="https://i.sstatic.net/DaexOBy4.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DaexOBy4.gif" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2024-06-15T11:28:20.417Z
Sure, even Pluto makes a small (but measurable) contribution to the SSB position. Its orbit is pretty eccentric, so its barycentre distance varies from ~32 km to ~54 km. https://i.sstatic.net/WiL5Qjcw.png But that's for the whole Pluto system, not just Pluto itself. I used GM values from https://ssd.jpl.nasa.gov/astro_par.html When JPL added Kuiper belt masses, it shifted their SSB by 100 km! https://astronomy.stackexchange.com/a/44326/16685
PM 2Ring
CC BY-SA 4.0
2024-06-15T02:42:02.787Z
2024-06-15T02:53:18.087Z
2024-06-15T02:53:18.087Z
Miss Understands
<p>I came across this picture on wikipedia:
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Solar_system_barycenter.svg/1024px-Solar_system_barycenter.svg.png" alt="sun barycenter" /></p>
<p>Note: From a quick search I gathered that although there are slight differences between the limb of the sun and the accepted radius of the sun, these differences are rather tiny (~330km if I'm interpreting this correctly <a href="https://www.aanda.org/articles/aa/full_html/2018/08/aa32159-17/aa32159-17.html" rel="nofollow noreferrer"><em>Solar radius determined from PICARD/SODISM observations and extremely weak wavelength dependence in the visible and the near-infrared</em></a>).  Thus it seems fair to say that the points on this picture that are beyond the limb are &quot;outside&quot; of the sun, but feel free to correct me if I'm mistaken on this point.</p>
<p>From this picture, it looks like the barycenter is more often than not outside of the sun.  Going from the points alone, it looks to be about 60% outside, though perhaps this is not a fair representation. On longer timeframes (lets say 100's of millions of years), is the barycenter of the solar system usually outside of the sun?  Or does the possibility of a massive undiscovered object with a highly elliptical orbit make such long term estimation impossible?</p>

CC BY-SA 4.0
2021-07-14T22:16:31.530Z
You can only define the barycentre in terms of known objects.
ProfRob
CC BY-SA 4.0
2021-07-15T01:58:08.380Z
Related, if not a duplicate: [Where is the Solar system's barycenter located?](https://astronomy.stackexchange.com/questions/40782/31410)
WarpPrime
CC BY-SA 4.0
2021-07-15T04:37:40.260Z
It is due to Jupiter. Jupiter and the Sun circle around the barycenter. Sedna revolves around the Sun-Jupiter barycenter as well. The hypothetical massive planet would probably do so too.
John
CC BY-SA 4.0
2021-07-15T16:15:29.063Z
Mostly Jupiter and Saturn but as Section 2.2 of [Park et al. 2020](https://iopscience.iop.org/article/10.3847/1538-3881/abd414) for the new DE440 ephemeris: "Compared to DE430, SSBC _(Solar System BaryCenter)_ has shifted by ~100 km, which is mainly due to the addition of KBOs. _(Kuiper Belt Objects)_" (italics my acronym expansion)
astrosnapper
CC BY-SA 4.0
2021-07-20T08:19:05.650Z
Does this answer your question? [Where is the Solar system's barycenter located?](https://astronomy.stackexchange.com/questions/40782/where-is-the-solar-systems-barycenter-located)
Rory Alsop
CC BY-SA 4.0
2023-07-05T09:07:59.330Z
@astrosnapper: Weird; I was under the impression that the barycenter itself was defined by how the Solar system as a whole moves, and that its location is determined by keeping track of extragalactic objects that appear virtually immobile from our vantage point. As such I thought only the locations of objects relative to that center got their accuracies improved with new ephemerides, not that the barycenter itself gets updated with a new position. Why exactly is that the case?
Outis Nemo
<the-sun><orbit><solar-system>
Is the barycenter of the solar system usually outside of the sun?
eps
# Is the barycenter of the solar system usually outside of the sun?

(Asked by: username_0 on 2021-07-14)

I came across this picture on wikipedia:
![sun barycenter](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Solar_system_barycenter.svg/1024px-Solar_system_barycenter.svg.png)

Note: From a quick search I gathered that although there are slight differences between the limb of the sun and the accepted radius of the sun, these differences are rather tiny (~330km if I'm interpreting this correctly [*Solar radius determined from PICARD/SODISM observations and extremely weak wavelength dependence in the visible and the near-infrared*](https://www.aanda.org/articles/aa/full_html/2018/08/aa32159-17/aa32159-17.html)). Thus it seems fair to say that the points on this picture that are beyond the limb are "outside" of the sun, but feel free to correct me if I'm mistaken on this point.

From this picture, it looks like the barycenter is more often than not outside of the sun. Going from the points alone, it looks to be about 60% outside, though perhaps this is not a fair representation. On longer timeframes (lets say 100's of millions of years), is the barycenter of the solar system usually outside of the sun? Or does the possibility of a massive undiscovered object with a highly elliptical orbit make such long term estimation impossible?

**Tags:** the-sun, orbit, solar-system

> **Comments:**
> **username_1**: You can only define the barycentre in terms of known objects.  
> **username_2**: Related, if not a duplicate: [Where is the Solar system's barycenter located?](https://astronomy.stackexchange.com/questions/40782/31410)  
> **username_3**: It is due to Jupiter. Jupiter and the Sun circle around the barycenter. Sedna revolves around the Sun-Jupiter barycenter as well. The hypothetical massive planet would probably do so too.  
> **username_4**: Mostly Jupiter and Saturn but as Section 2.2 of [Park et al. 2020](https://iopscience.iop.org/article/10.3847/1538-3881/abd414) for the new DE440 ephemeris: "Compared to DE430, SSBC _(Solar System BaryCenter)_ has shifted by ~100 km, which is mainly due to the addition of KBOs. _(Kuiper Belt Objects)_" (italics my acronym expansion)  
> **username_5**: Does this answer your question? [Where is the Solar system's barycenter located?](https://astronomy.stackexchange.com/questions/40782/where-is-the-solar-systems-barycenter-located)  
> **username_6**: @username_4: Weird; I was under the impression that the barycenter itself was defined by how the Solar system as a whole moves, and that its location is determined by keeping track of extragalactic objects that appear virtually immobile from our vantage point. As such I thought only the locations of objects relative to that center got their accuracies improved with new ephemerides, not that the barycenter itself gets updated with a new position. Why exactly is that the case?  

---

## 4 answers

### Answer by username_7 on 2021-07-18. Score: 15

Yes, the Solar System barycentre (SSB) *is* usually outside of the Sun. That is, over the long term, the mean distance from the centre of the Sun to the SSB is greater than the Sun's radius of 695,700 km. (That's the IAU's nominal [solar radius](https://en.wikipedia.org/wiki/Solar_radius)).

As username_1 commented, we don't really know the exact location of the SSB, since we can only calculate it based on the known bodies in the Solar System, and we simply don't know the locations, trajectories, and masses of all the bodies in the outermost reaches of the system. So we use a nominal SSB with a location consistent with the motions of the known bodies, and that location is updated when new information becomes available.

The Jet Propulsion Laboratory (JPL) have been producing ephemerides since the 1960s. Their [JPL Development Ephemeris](https://en.wikipedia.org/wiki/Jet_Propulsion_Laboratory_Development_Ephemeris) series is not only used by NASA, it's also been the basis of the [Astronomical Almanac](https://en.wikipedia.org/wiki/Astronomical_Almanac) since 1981. Their ephemeris data covering 9999 BC to 9999 AD is freely available via the [Horizons](https://ssd.jpl.nasa.gov/?horizons) system. They recently updated their SSB info:

> [**April 12, 2021**](https://ssd.jpl.nasa.gov/?horizons_news)
> Due to the addition of KBO mass in DE440/441, the SSB has shifted about 100 km

---

A few months ago, I added a link to an interactive 3D version of the Sun-SSB diagram to [this answer](https://astronomy.stackexchange.com/a/28036/16685). I used that Python code as the basis of a new script that creates 2D plots of the radial distance of the centre of the Sun from the SSB for any timespan in the Horizons database. It also integrates the mean radial distance over the selected timespan. Here's an example plot, covering 1700 AD to 2200 AD, with a timestep of 1 calendar year, which yields a mean distance of 829,224 km. A timestep of 1 calendar month gives a mean distance of 829,185 km. That's comfortably larger than 695,700 km.

[![Sun-Barycentre distance, 1700-2200](https://i.sstatic.net/rmJpT.png)](https://i.sstatic.net/rmJpT.png)

The vertical scale is in kilometres, which the plotting library prints in scientific notation, with "1e6" near the top of the axis. The horizontal axis is labelled with [Julian day numbers](https://en.wikipedia.org/wiki/Julian_day), which are also displayed in scientific notation.

I chose 500 years because it's long enough to include a few orbits of Neptune and it's approximately a whole number of cycles of the 3 outer planets. It's also convenient that it's a whole number of decades. ;)

| Planet | Cycles |
| --- | --- |
| Jupiter | 42.15 |
| Saturn | 16.95 |
| Uranus | 5.95 |
| Neptune | 3.03 |

---

Here's a live version of the [plotting script](https://sagecell.sagemath.org/?z=eJyNF_1v2kj2d_8V02m12FlwIL1mr5zQLUkdLd0kIEy76lFkTfAAbo3tnRkTaJT__d6b8RekJ12kYM-b9_1tSimZciUivuPEzxOSpTJSUZqQX8iOx-kyUgcSMsXISqRb8kcqoh9pIi0CfywJyVqwbEMiJUkYScWSJTeIagPs0pgJ4h-k4lvywMRhyRMlOLF9_8qxNIu_RKQUT8jDgUzuyMU0StbkonvRc7u_ub1LjfIpA_E8JColueSacakFWUUxJ8PJqKB57_beGxrJJREsWXMwQz87Api0SZIqAmoqDsYtVSqkRSm1rGibpUIRARiC_51zqaSlzVjlCaClsSQFSizyYMmWG25ZuYjJgNCNUpnsn59LGbrfsthNmGTuOt2dsyw63xSaBqipCxBqwU-w40Kij4Ec1AYFHpjkwXIbIgQUuh7f3Q3vP8CpBTFpWdfe_cyb4vF38F3Luhv-6QXe5A_vDmFfPL9lzYZXt14w-zLxEPTZu56NpwAef5oFn-5HMx-hf951PrSsqXcTTG6H9xrRu74dTWajawP2v_gzw_PjRbfbbVnIJ7geT7Xs-_G9p0HB7fDKu_UNzEA-eLezYTArQdf-5-BmPL0bzioFx1cfgw_D2bBJpZVGwGXLBOL3yr_2lu1l9IMPokTZbx3HCvmKrLhabgJMRxuiKFQbgplm-Mszp69Db5y4Qm6v3rzxxzfWU-ncZ8ufDaezYDa600KfNI_nzkeWdHqkd9FHi_3ZeNLESLMXCN4k8Ef_KRF49txCUR6I0jagFpBFcF3mkgtFpWzIl7YupcFTa5WKLVOtPmkpvlet57ZOZQk3UZLleGG3QONWG-1xnh3NtM4awV3JmVhubEEx_T97U380vu9_lWf2V__MoTqPXeTtuGuR5pndMzyiVcXm1YA0ctF4D_8ygS5f0b-YSKAe-7rASqJIkqfiHZR-yBUUJMDkUkSZwluwjDw1-D7TotS3J3rb_5bO1zdfIUSe7Z7pV2_sNTUvFd4i3_s04ac60vsx0VXgTUc-dU5uj_mYqKhcJJqV1ThvKxfNe_2FZck8EQyz6PL9u9-6XfKajIafiNTdDC6iXEKiggQu2FLpvNyyKDEZOaC995ddahJzQKEvmQOHQ498oW0QHKZKDmYih26zzMWOl-9pnIoBFTzUWDr5L9vkMQrVZtADJrt1gclylQa57ouDGxZLXuQ--AobnI0CCMRBc3deeM3nMTQ_wqCbcSYVAXeQdEWOqOip10wQ9SQYvKhDV8IEyWzHmN088epUhVPz-J8RTQnPNnzLBWCYuZPmSfjqpT4NdfDhyiyOVBwlXNpO83IuzZXdareceb_TW-gchY6eaJSFRn6tgSJ9LMH9MovSR-dfRz54TSZ4Q7TlMF_QZPIxjyOGlAcJIIyMmZGFWTcwTPqQCGfIet5dzPsXC6eJMEv7hFQIoKTB0CgqgP4B9YTjZm7UPUAVyfoYQxgDhAGoyu5TgyoHvibeXmHukiWLeRICGSpc3QMUz1iv6SP0rqp56KEfPizbpJBVYBYOxo6NL4MTdEDEhyt4FrMlt6kLhlLquHH6yIVdIxdc8eFm4Fy9iNi0Qx1w2SmW5vyrPlk_Ma0OSJvE0XqjOira4nzHbaDdWAoq2m9hmwRwA00a-c9XccqULZ06XcAdi1oWpDIKx2CRAcztLtUbkVYPemsVk9rxp6HSujcvdVhhTcggKraNCiHEcWqhVS4cYWmdS7QQEgUDXmarr_MU9yazrD1GamP2M1j3TD8jWDcm1-IUFKukYKoWroc-f3SDOVpcTeACOdhzG-ih7HUDhfq3gag6LqoW9wBp8J22NY1Uh5gPaMfVTU8LgjIGCGjXuaqXxnK9BLK1iEJNOpjPc9BBByjHAGn_gRy6Zd9SQRclS7bnMojZA4-BhtapgXn4fUsAsYkS6Nbbc3vvcCyv9Ql_nMLYX8ENMFdsOtXOoyd2vjCzWAIViwMGqZhswaIBjflKlbMxMt23zhQtJEuhNUgbbIReUBtZhQC01rq9KyXqX6eM-1UexSG54j8iXjR105JUtoN4RTC-7IqVMU11IeHgf9cFhARNBFxzZejrjoONBQ62IXEMkAmOHbdbtR9Y0KD8dlrrbFebFypMJdIBiTVsj51ckXPytoahNuEBLkClM0BBZvp5VPFY74WdqELdfFAfcKR96GKngH8bOILY8OCAnAsHeaHEi2ZRa1OPixb7ILgD6w1NBkaoiuYKDHWiI1eEGe4IgYOzcI74GC-WpYuj5VRM7eEXASmcWYb3jmMOlx9dD1w9cviQKuq6JUlRN79oUP31ZXYxpB0Y_5zr7MVYxGlzJK3osYQBeUKyvvt29Uy-b2mjGpq1jzhV5evD4ig9j6q-T1_UFAqlR_Qn5P9XNZ3EUPN_0BkSZExtbBOIn9fNMAzrwag7ihm52yiBCMCQA1dMXDziioNvbA9vBgm7OqJAqulnR9NhonXd7ruqMMrWXjWtE12NLwg9-0cx4sAjmuZld4E9W0XLY29gqLmgDZO-5bDoMZnh4gdTL0r1zV7btAdF26f27Sv79sa-n9hsit4whSrbG4P32uDzYweYMMP2rwJDEGgt7K77T_BNwePcLLt1GGHlbTjGlWwH2wOkN84FbL4sdgGlsRuG-JWxBiGQtrBsHIItS9j6aMnAYbVR29gOce-HgRgt4fMc9rNAszdS2uQJPm9ayL3VbtQo0KhDBiU8zhV8p422wNzfrR1EdEGu7bghX6Yht8tpLDfpoz1x_gsT4hMb&lang=sage), running on the SageMathCell server. It has various options (including SVG display) which (I hope) are self-explanatory. The start & stop values must be whole year numbers, possibly with an "AD" or "BC" prefix or suffix (this notation is needed for years before 100 AD). The step parameter has various options, see the [Horizons docs](https://ssd.jpl.nasa.gov/?horizons_doc#stepping) for details, but briefly "6 Month" stusername_0 by 6 calendar months, "100 days" stusername_0 by 100 days, and a plain number without any letters divides the timespan into that number of equal stusername_0.

The script caches the last 3 sets of data fetched from Horizons, so if you just modify "cosmetic" options (without changing the timespan or time step) it can reuse the data rather than having to request the identical data again.

The script doesn't use any Sage features, apart from the plotting routines, so you can use the functions that fetch and parse Horizons data in a standard Python environment. (The code that converts Horizons commands to a URL is much more robust than the code I used in the 3D plot).

Here's an SVG corresponding to that Wikipedia diagram: 1945-1995, with 1 year stusername_0. It has a mean distance of 822,369 km.

[![Sun-Barycentre 1945-1995](https://raw.githubusercontent.com/gist/PM2Ring/663aece06fa7d06bbfdd1ebaa70012ed/raw/d9dfc044e0553d50313278d7d0432639c267c12a/SunSSB.svg)](https://raw.githubusercontent.com/gist/PM2Ring/663aece06fa7d06bbfdd1ebaa70012ed/raw/d9dfc044e0553d50313278d7d0432639c267c12a/SunSSB.svg)

---

username_6 mentions in the comments that there's an approximate 179 year cycle in the Sun - SSB distance. ~179 years is a multiple of the [synodic periods](https://en.wikipedia.org/wiki/Orbital_period#Synodic_period) of the 3 outer planets, relative to Jupiter. 9× Saturn, 13× Uranus, 14×Neptune gives 178.769349, -179.558288, -178.949050 respectively, in Julian years. So approximate alignments of all 4 outer planets repeat with a period of ~179 years.

The most important contribution in this cycle is the Jupiter-Saturn cycle of 178.769349 Julian years, which is approximately 65295.5 days.

I illustrate this cycle in the following polar plot, spanning 1800 years, from AD 300 TO AD 2100, with a 60 day time step (using the Terrestrial Time scale, and the Gregorian calendar). In this plot, the radius gives the Sun-SSB distance (in millions of km), the angle (anticlockwise, from the +X axis) gives the date. The date wraps around with a period of 65295.5 days, so each degree corresponds to ~2 years. Each cycle is plotted in a different colour of the rainbow, starting at red.

[![Sun-Barycentre distance, polar plot](https://i.sstatic.net/E0Che5ZP.png)](https://i.sstatic.net/E0Che5ZP.png)

Here's a polar plot (using a different rainbow palette) spanning 20 cycles (~3600 years), starting from a Jupiter-Saturn conjuction. The solid circle shows the Sun's radius. The dotted circle (with radius 827,467 km) shows the mean distance.

The same symmetries are evident, but the pattern is definitely getting more complex. The end of the cycle is *not* a Jupiter-Saturn conjuction, but there is a conjunction a few months earlier, on 3013-Dec-17.

[![Sun-Barycentre distance, polar plot, 3600 years](https://i.sstatic.net/yrano2M0.png)](https://i.sstatic.net/yrano2M0.png)

> **Comments:**
> **username_7**: There's a more general plotting script [here](https://astronomy.stackexchange.com/a/47345/16685), which can plot the distance between pairs of bodies known to Horizons.  
> **username_7**: Using the general plotting script, with a date range of 1698-Aug-8 to 2196-May-2, and a step of 2000, the mean distance is ~827,640 km. The graph crosses the mean line (going upwards) on those dates, so the area under the curve gives a more accurate mean.  
> **username_6**: You should highlight the ~179-year cycle in the plots above, so as to show that there is some underlying periodicity there. Here I've plotted that 179-year cycle from -3000 to 3000: https://i.postimg.cc/MW7Bwn7s/solarbarycentriccycles3000.png You can see that there are some instabilities that cause parts of it to "flip" (think intermediate axis theorem, the "Dzhanibekov effect") after a certain number of cycles, but overall a lot of the cycle remains remarkably stable.  
> **username_7**: @OutisNemo I'll think about it. That's a nice graph you have there. ~179 years is a multiple of the synodic period of the 3 outer planets, relative to Jupiter. 9× Saturn, 13× Uranus, 14×Neptune gives (178.769349, -179.558288, -178.949050) respectively, in Julian years, using [LLL reduction](https://en.wikipedia.org/wiki/Lenstra%E2%80%93Lenstra%E2%80%93Lov%C3%A1sz_lattice_basis_reduction_algorithm). Of course, the actual synodic periods vary a bit from their mean values, but the periodic interaction between Jupiter & Saturn is pretty strong.  
> **username_6**: Yes, that's exactly correct. It's not my finding, of course, I've just seen it crop up in various papers (like e.g. this one: https://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1987SoPh..110..191F&defaultprint=YES&page_ind=0&filetype=.pdf) and decided to plot it out over a long time period. I was going to do it with a bigger ephemeris too, but I remember the library I used was having some issues with the biggest ones (DE431/DE441).  
> **username_7**: @OutisNemo Here's a polar plot spanning 1100 years. https://i.sstatic.net/8GllUgTK.png The angle is proportional to the time, wrapping at 65295.5 days. (The radius is the distance in km).  
> **username_7**: @Outis You can find other cycles using my LLL script. Just try bigger numbers in the `scale` field. The `data` values are synodic periods in Julian years. You can add other data values if you want, or comment out values by prepending the line with `#`. Sorry the code is a bit terse, I had to strip it down to fit it into a comment. ;)  
> **username_7**: https://sagecell.sagemath.org/?z=eJxlUsFu4yAUvPMVT%2D6hkLrIuN0kXcnSag8rVUpvvaVZC9kkQbXBAoyrfH0fdqRWKieGmXnMe3ADu90OnGrHJmhrOCEXqCDLMiKe%2DHb9UK4FEQ98K0qxWRNR8s22LDa%5FSFKQP9oE5WQTSKuOUNO%2Dore%2DkZ26zUEUBcuhlUFWz2YYw1%5F7QVElxy5UlxzOSp%5FOoXpEjRyDrccBpar6Jzuv2G8CuJIXs%2DydnbgPTg%2DUwdE6QAzazDT3Q6dDp43ylB1mV4zoiaoJ1tG9lydVqyg7iqYfbtDHGUrTgrEBloukC37S4Uyzm4wd2Fx0wpqdMjTGBQ8OO6erGHPwaqiyN5PloEybdrhnZInSpygRVtDP%2DAVhL7GTD4rUCvl9cWDpyuadLgS%5FKGfpdC9ymBi7uu4qeOGvcHc181bLkzXYVOzZ%5FxLPxSLcF3lxSOq5MDIroBPcw%2DM1j4dUCN%2D7PjnZU8ZfvzXjc8jm6Ono26D88hhfwjSlQWo3aa%5Fqwdn0c9JgGPkEq4Cpww==&lang=sage  
> **username_6**: That's very cool indeed, and I guess I could figure out exactly what you're doing so succinctly if I studied the code a bit, but I get the gist of it. The 40- and 139-year cycles are also interesting, as they add up to the 179-year cycle and have also been recognized in the literature: https://www.aanda.org/articles/aa/full_html/2018/07/aa32349-17/aa32349-17.html "One Jose-period is ~9 × JS ~179 yr; sometimes, ~2 × JS ~40 yr before a Jose-period, that is, ~7 × JS ~139 yr after an earlier inversion event, giant planets are already quasialigned and able to produce a retrograde motion."  
> **username_7**: @Outis I've added an improved polar plot.  
> **username_6**: Awesome! I had missed that plot in the comments earlier, but I see it now, and the fancier version in the post is very cool, where you can see each cycle more clearly too. What I've also always found interesting about it since generating the plot I sent are those parts of the cycle that seem to occasionally switch to a different path due to seemingly reversing direction instead of "passing by" the barycenter, which I believe I've seen referred to as "bimillennial orbital inversions" of retrograde Solar motion, and seen suggestions of possibly being caused by Uranus-Neptune dynamics.  
> **username_6**: I saw the updated plot as well, really cool. I hope to find some time to make some such plots myself in the near future, maybe try to get the longest JPL ephemerides to work with the library I'm using, then I can try to plot some of the longer cycles detected with your script too. A thing I noticed about the script is that it provides some multiples of shorter cycles if you plug in larger values for the scale, but maybe there's no easy way to avoid that. I did try looking a bit at the code, but it's definitely a mouthful, and you're probably a bit more mathematically proficient than I am, heh.  

---

### Answer by username_8 on 2021-07-15. Score: 9

The Sun's motion relative to the Solar System barycenter is dominated by the four planets Jupiter, Saturn, Uranus and Neptune. Neptune is a lot lighter than Jupiter but it's also a lot farther away, and contrary to intuition the farther out it is the larger the induced motion in the Sun around the barycenter.
*To first order we can treat the Sun's response to each planet as circular, and the final result as the linear superposition of four circular motions.
I lack the math background to derive the answer analytically, though I am confident someone will soon.
Approximate distances of the Sun to the mathematical barycenter of each binary Sun + planet pair, "amplitude":
 body        mass (Sun=1)    a (Rsun=1)    amplitude (Rsun=1)
Sun           1.000              -
Jupiter       9.548E-04      1.119E+03       1.068
Saturn        2.858E-04      2.060E+03       0.589
Uranus        4.366E-05      4.133E+03       0.180
Neptune       5.152E-05      6.465E+03       0.333

So the interesting thing is that if it were only for Jupiter, the Sun-Jupiter barycenter would always be slightly outside the Sun.
Let's run a simulation of four circular displacements with the amplitudes as shown and periods (not that it matters, as long as they are not rational number relationships) that scale as $a^{3/2}$ which conveniently will convert my four digit numbers into irrational numbers for me. :-)
As expected based on Jupiter alone putting the barycenter just outside the Sun, when all four main planets are taken into account the barycenter spends about 54% of the time outside the Sun (or the Sun spends 54% of the time further than one of it's radii from the barycenter).
median r:  1.209
mean r:    1.189
max r:     2.17
fraction:  0.542

The histogram of radial distances shows some interesting structure, which I think should be pursued further both mathematically and numerically.
Since this is a statistical analysis (there are no harmonic relationships between planets in this model) time could just as well be sampled randomly rather than using equal spaces.

In the plot above the $x$ value for each individual two-body motion is shown with color lines, but the absolute radial distance $r$ is shown in black for the combined motion.
import numpy as np
import matplotlib.pyplot as plt

amplitude = np.array([1.068, 0.589, 0.180, 0.333])
period = np.array([1.119, 2.060, 4.133, 6.465])**1.5

time = np.arange(0, 100000, 0.01)
xd = amplitude[:, None] * np.cos(2 * np.pi * time / period[:, None])
yd = amplitude[:, None] * np.sin(2 * np.pi * time / period[:, None])
r = np.sqrt(xd.sum(axis=0)**2 + yd.sum(axis=0)**2)

bins = 0.01 * np.arange(int(100 * amplitude.sum())+10)
a, b = np.histogram(r, bins=bins)

r_median = np.median(r)
r_max = r.max()
r_mean = r.mean()
fraction = (r > 1).sum() / r.sum() 

print('median r: ', r_median)
print('mean r:   ', r_mean)
print('max r:    ', r_max)
print('fraction: ', fraction)

n = 10000
lw = 0.5
fig, (ax1, ax2) = plt.subplots(2, 1)
for x in xd:
    ax1.plot(time[:n], x[:n], linewidth=lw)
ax1.plot(time[:n], r[:n], '-k', linewidth=lw)
ax2.plot(b[1:], a)
ax2.set_title('fraction > 1 is ' + str(round(fraction, 3)))
plt.show()


---

### Answer by username_9 on 2021-07-16. Score: 3

Not a direct answer to your question (which others have given already), but maybe still worth considering here:

The dynamics of the solar system can to a high degree of accuracy be calculated by assuming the sun and planets as point masses, so whether the barycenter lies inside or outside the defined surface of the Sun is physically not really relevant for anything, given that it is only a mathematically-defined point, and that the diameter of the Sun will change over time.


---

### Answer by username_10 on 2024-06-15. Score: 0

**> Is the barycenter of the solar system usually outside of the sun?**

===[ Yes, but it's all Jupiter.

You can separate the components of the barycenter motion. This is how the sun's center gets dragged around by the gas giants:

[![enter image description here](https://i.sstatic.net/H3v2SGiO.gif)](https://i.sstatic.net/H3v2SGiO.gif)

The scale bar is the diameter of the sun (1,300,000 km).

Subtract Jupiter's contribution:

[![enter image description here](https://i.sstatic.net/TYYVbvJj.gif)](https://i.sstatic.net/TYYVbvJj.gif)

We observe that the other planets, even added together, don't QUITE pull the barycenter outside the sun.

Here's the contribution of Uranus only. *Note the scale change.* The wiggles are due to the other gas giants perturbing Uranus (not on the sun):

[![enter image description here](https://i.sstatic.net/3Gga6sSl.gif)](https://i.sstatic.net/3Gga6sSl.gif)

With a HUGE scale change (zoom in 1,000x), we see that Pluto only pulls the sun about 20 miles off center:

[![enter image description here](https://i.sstatic.net/DaexOBy4.gif)](https://i.sstatic.net/DaexOBy4.gif)

> **Comments:**
> **username_7**: Sure, even Pluto makes a small (but measurable) contribution to the SSB position. Its orbit is pretty eccentric, so its barycentre distance varies from ~32 km to ~54 km. https://i.sstatic.net/WiL5Qjcw.png But that's for the whole Pluto system, not just Pluto itself. I used GM values from https://ssd.jpl.nasa.gov/astro_par.html When JPL added Kuiper belt masses, it shifted their SSB by 100 km! https://astronomy.stackexchange.com/a/44326/16685  

---

