Skip to content

CosmoTransducer/SpaceTimeFabric-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

SpaceTimeFabric-simulator

Visualization of how mass warps spacetime, inspired by Einstein's General Theory of Relativity — explained using the classic "rubber sheet" analogy and simulated in Python using `matplotlib`.

space-time fabric

General Theory of Relativity

In simple words, mass and energy tell spacetime how to curve, and curved spacetime tells matter how to move.

The greater the mass (or concentrated energy), the deeper the curve in the space-time fabric — resulting in a stronger gravitational pull.


Key Requirements

  • Simulate mass and energy in 2D space
  • Show how one object affects another (i.e., simulate relativity)
  • Represent time dilation based on the curve intensity
  • Solid understanding of Python + NumPy + Matplotlib
  • Clear grasp of general relativity

Basic Approach

  1. Create a 2D grid representing space: X, Y
  2. Add mass at the center (or anywhere on the grid)
  3. Apply a gravitational potential function to warp the grid:
$$Z(x, y) = - \frac{G \cdot M}{\sqrt{(x - x_0)^2 + (y - y_0)^2 + \varepsilon}}$$

Where:

  • G: gravitational constant (set to 1 for simplicity)
  • M: mass value
  • (x₀, y₀): coordinates of the mass
  • ε: a small value to avoid division by zero
  1. Use a 3D surface plot (matplotlib) to visualize space-time curvature.

Setup Requirements

pip install numpy matplotlib

spiral

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages