Gravity forward modeling for regular-shaped bodies. Compute and visualize gravity anomalies and full tensor gravity gradiometry (FTG, 7 components) for 7 body types — analytical formulas for cuboids and spheres, hybrid analytical-numerical solutions for the rest, with multi-body superposition and parameter sensitivity analysis.
PolyBodyGrav is a MATLAB desktop application for forward gravity modeling of regular geometric bodies. It covers the complete workflow from geometry setup, forward computation, multi-body combination, sensitivity scanning, to GIS-standard format export.
| Body | Formula | Gravity | FTG (7 components) | 3D Color |
|---|---|---|---|---|
| Sphere | Point-mass analytical | ✓ | ✓ (analytical) | Gold |
| Cuboid | Nagy/Plouff (1976) prism | ✓ | ✓ (analytical) | Red |
| Vertical Cylinder | Axial + geometric attenuation | ✓ | ✓ (finite difference) | Green |
| Horizontal Cylinder | Finite line mass (Blakely 1996) | ✓ | ✓ (finite difference) | Blue |
| Tilted Cylinder | Blakely (1996) line integral | ✓ | ✓ (finite difference) | Cyan |
| Ellipsoid | Gauss-Legendre (32-node) + Z-Y-X Euler rotation | ✓ | ✓ (finite difference) | Purple |
| Frustum | Thin-disk trapezoidal integration | ✓ | ✓ (finite difference) | Orange |
| Multi-body | Linear superposition | ✓ | ✓ | Mixed |
All 7 gravity gradient tensor components available in all body types:
- Cuboid & sphere: analytical FTG via Plouff formula (satisfies Laplace
$V_{xx}+V_{yy}+V_{zz}=0$ ) - Other bodies: Vz analytical + gradient via 3-layer finite difference with free-space Laplace constraint
| Quantity | Unit | Conversion |
|---|---|---|
| Gravity Vz | μGal | |
| Gradient tensor | Eötvös (E) | |
| Density | g/cm³ (UI) → kg/m³ (SI) | × 1000 |
- 7 body types with analytical / hybrid-analytical formulas
- 7 FTG components per body type
- Constant or topographic observation surface (load external DEM as .asc/.grd/.dat/.txt/.xlsx)
- Gouraud-lit 3D visualization + plan-view contour map
- Select any scannable parameter as X-axis variable
- Define Min/Max range and step count
- Curve-family support with colon notation multipliers (e.g.,
0.5:0.5:2.5) - Multi-curve output with 3D model preview
- Combine arbitrary numbers of bodies (sphere, cylinder, cuboid, ellipsoid, frustum)
- Per-body editable name, color, and parameters
- Linear superposition of gravity fields
- JSON parameter export/import: Full parameter serialization across sessions
- Auto-persistence: Automatic save/restore of all inputs (
app_settings.mat) - GIS-standard export: ESRI ASCII Grid (.asc), Surfer 6 Grid (.grd), XYZ columnar (.dat)
- Columnar data export: TXT / XLSX formats
| Terrain | Description | Grid |
|---|---|---|
valley |
V-shaped valley | 201×201 @ 10m |
mountain |
Conical peak | 201×201 @ 10m |
slope_x |
X-direction slope | 201×201 @ 10m |
basin |
Basin depression | 201×201 @ 10m |
complex |
2 peaks + 1 valley | 201×201 @ 10m |
flat |
Zero-elevation plane | 201×201 @ 10m |
random |
Random topography | 201×201 @ 10m |
Parameter presets: preset_sphere.txt, preset_cuboid.txt, preset_vertical_cylinder.txt, preset_multibody.txt
8-corner sign-alternating kernel summation:
- Compute Vz analytically at 3 elevations: z₀, z₀±dz (dz=1.0m)
- Vzz = (Vz_top − Vz_bottom) / (2·dz) × 10⁹
- Vxz = ∂(Vz)/∂x, Vyz = ∂(Vz)/∂y (MATLAB
gradient) - Free-space Laplace constraint: Vxx = Vyy = −Vzz/2, Vxy ≈ 0
CODATA 2018:
| Component | Requirement |
|---|---|
| OS | Windows 10/11 (64-bit) |
| Runtime | MATLAB Runtime R2025a |
| Memory | 8 GB recommended |
Get the latest installer from Releases.
| Document | Content |
|---|---|
| 软件说明书 (Technical Manual) | Complete formulas for all 7 body types, finite-difference gradient theory, unit conversion, JSON parameter schema, file format specifications |
Spherical body forward modeling with Gouraud-lit 3D visualization and plan-view contour
Parameter sensitivity analysis curve family
- UI: Z upward positive, downward negative (ground = 0, subsurface bodies Z < 0)
- Computation kernel: Auto-converted internally
- Blakely, R. J. (1996). Potential Theory in Gravity and Magnetic Applications. Cambridge University Press.
- Nagy, D., Papp, G., & Benedek, J. (2000). The gravitational potential and its derivatives for the prism. Journal of Geodesy, 74, 552–560.
- Plouff, D. (1976). Gravity and magnetic fields of polygonal prisms. Geophysics, 41(4), 727–741.
- Werner, R. A. & Scheeres, D. J. (1997). Exterior gravitation of a polyhedron. Celestial Mechanics and Dynamical Astronomy, 65, 313–344.
Forward modeling for exploration geophysicists — analytical where possible, numerical where necessary.










