spacetime
A real(istic) time simulator.
spacetime
attempts to model time propagation of clocks across the Earth-Moon
system. It focuses on how network topology and time synchronization evolve in a
growing lunar ecosystem, evaluating both centralized and decentralized
Positioning, Navigation, and Timing (PNT) service network configurations.
Relativity Intuitions
This section builds intuitions about relativity and spacetime.
Here are some excellent videos to get started:
Intuitions for Special Relativity
Special Relativity is a theory of space and time that describes how space and time are affected by motion. It follows the natural consequences of the constancy of the speed of light in all reference frames. The special in special relativity refers to the fact that it is a special case of general relativity: situations when objects are moving at constant velocities in a vacuum.
The speed of light is constant in all inertial reference frames, regardless of the motion of the observer or the source of the light. This is a fundamental postulate of special relativity.
Inertial reference frames
The first key insight is to approach the problem with the understanding that motion is relative to the inertial reference frame of the observer. In any situation, we can always choose an inertial reference frame in which one object is at rest and everything else is moving relative to it.
Ash
is a train conductor, and Brock
is waiting for the train to arrive at the
station. The train is moving at speed relative to the station.
From Brock
’s perspective:
- The train is moving towards the station at speed .
- The station is at rest.
Ash
and Brock
experience the world from their respective inertial reference
frames. Each of their observations are true, and they are all valid.
The second key insight is to understand that the speed of light is constant for every observer regardless of their motion or the source of the light.
Here we will ignore the effects of light passing through a medium for the sake of brevity, but know that the physics still holds. This video provides an excellent intuition about how the speed of light can be constant and also how light moves “slower” through a medium.
TLDW; The speed of light is constant in any medium. The “slower” speed is a sort of illusion caused by “phase kicks” between the light and the medium.
The speed of light is constant
The first postulate of special relativity is that the speed of light is constant in all inertial reference frames.
Another way to think about this is to consider a perfect “light clock” that each observer watches. The light clock consists of a photon that bounces between two mirrors once per second. Since the speed of light is constant in all inertial reference frames, an observer watching their clock will always observe the photon moving at the speed of light, .
Let’s give a light clock to Ash
and Brock
and see what happens.
Ash
is a train conductor, and Brock
is waiting for the train to arrive at
the station. The train is moving at speed relative to the station.
Ash
holds a light clock called A
. Brock
also holds a light clock called
B
. Ash
and Brock
both observe the speed of light in their own light clocks
and in each other’s light clocks.
From Ash
’s perspective:
- The station is moving towards the train at speed .
- Light clock
A
is at rest. - The photon in the light clock
A
is moving at speed . - Light clock
B
is moving towards the train at speed . - The photon in the light clock
B
is moving at speed .
From Brock
’s perspective:
- The train is moving towards the station at speed .
- Light clock
A
is moving towards the station at speed . - The photon in the light clock
A
is moving at speed . - Light clock
B
is at rest. - The photon in the light clock
B
is moving at speed .
Light clock A
is moving at speed relative to Brock
, but he observes the
photon inside to be moving at speed , not . How can this be?
It is natural to pause at this point and ask “how can this be true?” or “why is the speed of light constant?”—stop yourself. For a moment, accept that it is true and instead we should ask “what must happen for this to be true?” Trust me, it actually makes more sense to approach the problem this way.
The emergence of time dilation
Let’s follow the math and see what happens when we assume all of the observations are true.
distance traveled in one second
Brock * 0 m
Ash *--* 100 m
Light *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~* 300_000_000 m
In order for the speed of light to be constant in both cases, the elapsed time must be different for each observer!
The time experienced by an observer at rest is called its proper time. Remember that it an observer only ever sees themself at rest. The proper time is always “normal” for the observer. (This is where the twin paradox comes from.)
Intiutions for General Relativity
General Relativity is a theory of gravity that describes how gravity affects the curvature of spacetime. It builds on the principles of Special Relativity, following the natural consequences of the constancy of the speed of light further and leading to the emergence of gravity and curved spacetime.
Space-time coordinates
Instead of thinking only in spatial coordinates, we can think in space-time
coordinates. One axis is movement through time, and the other is movement
through space. This coordinate system is called
Minkowski space. Before
continuing, it is critical to remember that in this coordinate system we think
of an object moving at any speed as having a larger component along the
space
axis. So forget the direction of motion for now.
Let’s first consider the spatial component for our example. From Brock
’s
perspective, he is at rest—his space-time vector has zero space component.
Ash
is moving at speed relative to Brock
, so his space-time vector has
a component along the space
axis proportional to .
* Brock
*------* Ash
+---------------→ Space
Now we consider the time component—this is where the magic happens. Let’s
“tick” time forward by one instant. From the last section, we know that Ash
will experience slightly less time than Brock
.
Time
▲ Brock
│ * (1,11)
│ |
│ | Ash
│ | * (8,8)
│ | /
│ | /
│ | /
│ | /
│ | /
│ |/
│ * (1,1)
+---------------→ Space
Working out the math, we find that the length of both space-time vectors is exactly .
Timekeeping Intuitions
Positioning, Navigation, and Timing Networks
Devlog
This page is a log of development notes and thoughts as I work on the project. It is not a part of the main body of the book.
2024-12-08
I switched the docs to use mdbook today and I’m feeling good about diving back in to this project. Previous devlogs are available on the repository’s archive.
Since the last devlog I’ve gotten a lot more experience with Rust and Bevy. I have a strong sense of how to structure a Bevy project and I’m comfortable with its features now, so I’m ready to drop krabmaga and start building the project from scratch.
To start, I’m going to build the simulation without any rendering or graphics. Just enough to see what’s happening through logs or maybe egui. Unlike previous attempts, I’m going to focus on implementing the math from the research papers I found, rather than trying to jump straight to the end goal.
2024-12-15
Here are two videos that really helped me find intuitions for the math of general relativity:
- https://youtu.be/OpOER8Eec2A?si=22VBvAKu8VV6ye5E
- https://youtu.be/S78h8zQwQe0?si=1ptIvQqqiFlSOqdG
I think it would be helpful to make this app demonstrate these intuitions. Let’s follow the videos’ trains of thought and see if we can implement them along the way. One thing these videos do very well is to build up ideas bit by bit. Similarly, I think we can build up the app’s features bit by bit.
While the math could be implemented with real physical constants, it would be much easier to see what’s happening if we use simple scale factors, especially if we can change them on the fly.
I’ve said this before and I’ll say it again: I am a huge fan of the “retro radar” aesthetic. It would be fun to lean into that. Here is a Pinterest board for inspiration: https://pin.it/CgMRWzHFl
2024-12-22
I watched a very insightful video series that explains special relativity in a way that I think is very intuitive. I think it would be helpful to implement these intuitions here.