N-body Gravity Simulation by Curvature of Wave Propagation

Simulate the solar system, orbital precession, time delay, light deflection, black hole shadow, star clusters, and spacecraft trajectories.
58 Downloads
Updated 16 Jan 2026

View License

For the Curvature of Wave Propogation Method (CWPM)
The Example script files included:
Example 1: The solar system and Mercury’s orbital precession.
Example_1_the_solar_system.m is the original file - fastest solution
Example_1_the_solar_system_dvdt.m is the Runge-Kutta option - traditional solver option. This calculates the solution with an acceleration vector that is derived from the curvature of motion.
The radial acceleration vector is derived from Equation TMG Eq 7-9 contained in the N-body paper listed below.
The tangential acceleration vector is derived from Equation 5
This paper will be revised to include the derivation, with a tentative
revision date of Fall 2025.
Example 2: Shapiro time delay and the bending of light. Sample results Movie_Ex_2_Shapiro_Time_delay_1967.mp4 Movie_Ex_2_Shapiro_Time_delay_1970.mp4
Example 3: Apparent black hole shadow diameter for M87. Sample results Movie_Ex_3_Apparent_black_hole_shadow_1.mp4
Example 4: Simple trajectory motion
Example 6: Pioneer 10, 11, Voyager 1, and 2 trajectories. Sample results Movie_Ex_6_Pioneer_and_voyager_probes_1.mp4
A pre-print of the paper
N-body Gravity Simulation by Curvature of Wave Propagation
documenting these script files is available at:
Initial paper:
Updated paper with acceleration vector and full documentation of the CWPM method:
Please let me know if you find any errors or have suggested changes.

Cite As

Morris G. Anderson (2026). N-body Gravity Simulation by Curvature of Wave Propagation (https://www.mathworks.com/matlabcentral/fileexchange/178949-n-body-gravity-simulation-by-curvature-of-wave-propagation), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.11

Modified Description information

1.0.10

add link to updated report

1.0.9

The Example 1, 2, and 6 script files have been updated to align with the NASA TDB convention by setting both the standard speed of light and the speed of light away from the influence of the solar system = 299792458 m/s.

1.0.8

Added comments to a few script files to enhance the documentation for the acceleration vector and Runge-Kutta method.

1.0.7

Added Example 1 option that is solved using an acceleration vector and a Runge-Kutta method

1.0.6

minor changes for plotting results

1.0.5

updated draft paper link

1.0.4

minor changes

1.0.3

Updated draft paper documenting the method and results.

1.0.2

updated Description

1.0.1

Improved compatibility with Matlab online

1.0.0