I A "continous" gravitational field formula r=0 to infinity

AI Thread Summary
The discussion centers on a model of the gravitational field for a non-rotating, spherically symmetric body, derived from Newton's law of universal gravitation. It presents a unified formula that accounts for gravitational behavior both inside and outside the sphere, using conditional expressions to avoid case splitting. The model requires only two inputs: the radius and density, and transitions smoothly at the sphere's surface, reflecting the principles of Newton's shell theorem. While some participants question the necessity of merging the two regimes into a single formula, others find it useful for programming and computational purposes. Overall, the model effectively captures the linear increase of gravity inside the sphere and the inverse-square decay outside, providing a compact representation of gravitational dynamics.
Owe Kristiansen
Messages
27
Reaction score
13
TL;DR Summary
Using Newton’s laws and the assumption of constant density, one can derive a gravitational field expression that works at all distances from the center of a sphere. The result is a compact, continuous formula that captures both the linear and inverse-square regimes of gravity using a single conditional structure. It requires two calibrated inputs: the radius R and the density d.
This model describes the gravitational field of a non-rotating, spherically symmetric body—without spin effects such as centrifugal acceleration or equatorial bulging.

The Construction Process
• Begin with Newton’s law of universal gravitation and a sphere of radius R with constant density d.
• For any point at distance r from the center:
• Only the mass enclosed within radius r contributes to the gravitational field.
• All mass outside radius r cancels out and exerts no net force. This follows from Newton’s shell theorem, which states that a spherically symmetric shell of mass exerts no gravitational force on a point inside it.

• The gravitational field is proportional to the enclosed mass divided by r², leading to two regimes:
• g(r) = G × (4/3) × π × d × (r³ / r²) for r < R
• g(r) = G × (4/3) × π × d × (R³ / r²) for r ≥ R

The Unified Formula
g(r) = G × (4/3) × π × d × [ r × (r < R) + R × (r ≥ R) ]³ / r²

Note on the conditional terms in the formula:
(r < R) and (r ≥ R) are logical expressions that evaluate to:
• 1 if the condition is true
• 0 if the condition is false

This allows the formula to automatically select the correct behavior depending on whether the point is inside or outside the sphere, without needing to split the expression into separate cases.

This expression:
• Is derived entirely from Newtonian gravity
• Requires two fixed inputs: the radius R and the calibrated density d
• Transitions smoothly at the surface
• Uses only density and radius—no need to assume total mass
• Encodes both gravitational regimes in a single line using a conditional structure

🔁 Why the Behavior Changes at the Surface of the sphere:
• Inside the sphere: As r increases, more mass is enclosed. The gravitational field grows linearly because the enclosed mass scales with r³, while the field scales with 1 / r².
• Outside the sphere: No additional mass is enclosed beyond R. The field now depends only on the total mass, and follows the inverse-square law: g(r) ∝ 1 / r².

This transition reflects the physical structure of the mass distribution and is a direct consequence of Newton’s shell theorem.

Calibrating the Model for Earth
To match Earth’s gravity, the density is calibrated using the known surface value:
g(R) = G × (4/3) × π × d × (R³ / R²) = G × (4/3) × π × d × R

Solving for d:
d = g(R) / [ G × (4/3) × π × R ]

With:
• g(R) = 9.832 m/s²
• R = 6.371 × 10⁶ m
• G = 6.67430 × 10⁻¹¹ m³/kg/s²

This gives:
d ≈ 5,517.4 kg/m³

Both R and d are required inputs to evaluate the field at any point.

📈 What the Model Predicts
• Correct gravity at the surface: g(R) = 9.832 m/s²
• Correct gravity at orbital altitudes: e.g. ISS → g ≈ 8.71 m/s²
• Linear increase inside the sphere
• Inverse-square decay outside the sphere

✨ The Result
• The formula is compact, continuous, and complete.
• It requires only two calibrated inputs: the radius R and the density d.
• The conditional trick allows both regimes to be expressed in a single expression—without case splitting or switching to total mass.
• The transition at r = R is physically motivated by Newton’s shell theorem: beyond that point, no additional mass contributes.
• The model assumes a non-rotating sphere—spin effects are not included.
 
  • Like
Likes robphy and Dale
Physics news on Phys.org
Owe Kristiansen said:
The result is a compact, continuous formula that captures both the linear and inverse-square regimes of gravity using a single conditional structure. It requires two calibrated inputs: the radius R and the density d.

• The gravitational field is proportional to the enclosed mass divided by r², leading to two regimes:
• g(r) = G × (4/3) × π × d × (r³ / r²) for r < R
• g(r) = G × (4/3) × π × d × (R³ / r²) for r ≥ R

The Unified Formula
g(r) = G × (4/3) × π × d × [ r × (r < R) + R × (r ≥ R) ]³ / r²

Note on the conditional terms in the formula:
(r < R) and (r ≥ R) are logical expressions that evaluate to:
• 1 if the condition is true
• 0 if the condition is false
...
• Transitions smoothly at the surface
...
• The formula is compact, continuous, and complete.
• It requires only two calibrated inputs: the radius R and the density d.
• The conditional trick allows both regimes to be expressed in a single expression—without case splitting or switching to total mass.
You've merely taken the two formulae and compacted them into a single line, using the logical "if/then" shortcut.

Other than using fewer characters (at the expense of overgeneralizing), does this serve a greater purpose?

Overgeneralizing: is there sufficient call for having these two systems (inside a sphere and outside a sphere) be part of the same scenario?
 
It is easy to know which equation to apply, so I see no need to merge the two equations.

The internal gravity model, that integrates material outwards from the centre, needs to be accompanied by a hydrostatic pressure model, that integrates mass inwards from the surface.
 
  • Like
Likes Owe Kristiansen
DaveC426913 said:
You've merely taken the two formulae and compacted them into a single line, using the logical "if/then" shortcut.

Other than using fewer characters (at the expense of overgeneralizing), does this serve a greater purpose?

Overgeneralizing: is there sufficient call for having these two systems (inside a sphere and outside a sphere) be part of the same scenario?

I find what I say in my article educating. Maybe someone else will also? Maybe I posted it in the wrong forum? Or maybe I should post it as a lower level.
 
Baluncore said:
It is easy to know which equation to apply, so I see no need to merge the two equations.

The internal gravity model, that integrates material outwards from the centre, needs to be accompanied by a hydrostatic pressure model, that integrates mass inwards from the surface.
I wanted to test if I could use the density formula all the way to infinity, without switching to the mass formula, and it worked. That was cool.
 
These “logical expressions” comprise a sometimes useful computational trick to avoid case-statements, as you say. This can be implemented in Desmos, for example, with a slightly different syntax for piecewise.

In most programming languages, TRUE evaluates to 1 (possibly after a cast). However, in some languages (like some old BASIC dialects), TRUE evaluates to -1.
So, obviously check your work.

These expressions are essentially appropriately positioned and signed Heaviside step functions,
which are useful for encoding superposition.
For example, you could consider a problem with nested possibly-non uniform shells of matter.
 
  • Like
Likes Owe Kristiansen
DaveC426913 said:
is there sufficient call for having these two systems (inside a sphere and outside a sphere) be part of the same scenario?
I usually combine them in a single function like this for programming convenience. Often when I want to avoid the infinite energy that you get by using the point mass approximation all the way down.
 
  • Like
Likes Owe Kristiansen
It's worth noting that the Earth is nowhere near uniform density. The core is much higher density than the rest, so in practice the gravitational field strength continues to rise well into the mantle.

The general formula is $$g(R)=\frac{4\pi G}{R^2}\int_0^R\rho(r)r^2dr$$This includes the simple case in the OP, where ##\rho(r)## is ##\rho## below the Earth's surface and 0 above, and the general case where the density varies with depth.
 
  • Like
Likes Owe Kristiansen and TensorCalculus
  • #10
For the TeX lovers like me:
##g(r) = \frac {4 G\pi d r^3}{3 r^2}## for ##r < R##
##g(r) = \frac{4 G \pi d R^3}{3r^2}## for ##r >= R##
And then the unified formula he provides:
$$g(r) = \frac{4 G \pi d [r\times (r < R) + R \times (r >= R)]^3}{r^2}$$

Very interesting, but probably only useful when writing things programmatically. Otherwise, just picking one or the other is more convenient - in my opinion.
 
  • Like
Likes Owe Kristiansen and DaveC426913
  • #11
TensorCalculus said:
For the TeX lovers like me:
##g(r) = \frac {4 G\pi d r^3}{3 r^2}## for ##r < R##
##g(r) = \frac{4 G \pi d R^3}{3r^2}## for ##r >= R##
And then the unified formula he provides:
$$g(r) = \frac{4 G \pi d [r\times (r < R) + R \times (r >= R)]^3}{r^2}$$

Very interesting, but probably only useful when writing things programmatically. Otherwise, just picking one or the other is more convenient - in my opinion.

Some suggestions:
##g(r) = \frac {4 \pi G d r^3}{3 r^2}## for ##r < R##
##g(r) = \frac{4 \pi G d R^3}{3r^2}## for ##r \ge R## (use \ge )
and
$$g(r) = \frac{4 \pi G}{3} \frac{ [r (r < R) + R (r \ge R)]^3}{r^2}$$ ( times symbol when it's not a cross-product is painful to see, missing 3 )
 
  • Like
Likes TensorCalculus
  • #12
Whoops - my bad. Yes that looks a lot better
 
  • #13
Dale said:
I usually combine them in a single function like this for programming convenience. Often when I want to avoid the infinite energy that you get by using the point mass approximation all the way down.
Yes, thanks for mentioning that, GM/r is way off at r close to 0.
 
  • #14
Thanks for visualizing my formula and letting me know about desmos.
 
Last edited:
  • #15
Thread is closed temporarily for Moderation.
 
  • #16
After a Mentor discussion, the thread is reopened provisionally.
 
  • #17
Owe Kristiansen said:
Yes, thanks for mentioning that, GM/r is way off at r close to 0.
More precisely, if you use that formula with ##M## as a constant then you are saying that all the mass is contained within the sphere of radius ##r##. This is an inaccurate choice below the surface of the Earth. You can continue to use the same formula if you interpret ##M## as ##M(r)##, the mass enclosed within a sphere of radius ##r## centered on the center of spherical symmetry of the mass (that's what the integral I posted in #8 is).
 
Last edited:
  • Like
Likes Owe Kristiansen

Similar threads

Back
Top