Request for Input: 2D Minkowski Spacetime Diagram Generator

In summary, this tool would allow the user to:Draw the four light years between Bob and TedDraw Alice's path from Bob to TedCreate diagrams of time passing in various ways (e.g. as circles, ellipses, lines, etc.)Save diagrams in various formatsRelate diagrams to certain frames of referenceCreate animationsIf there is interest, I am willing to share the tool for free.
  • #1
Freixas
307
42
TL;DR Summary
I’m planning to write a 2D Minkowsky spacetime diagram generator tool. At this point, I am looking for help reviewing the specification.
I’m planning to write a 2D Minkowsky spacetime diagram generator tool. At this point, I am looking for help reviewing the specification. I am not looking for help with the implemenation.

To be clear, I’ve written a complete specification, but it would be a waste if it was missing features that could make it useful to others. I’m willing to share the tool for free if there’s interest.

History

Some years ago, I wrote the first generation of a Minkowski spacetime diagram generator. Version 1 is still running and I used it to create the diagrams at the end of this post. Version 2 had a lot more features and was working, but I trashed it on the way to version 3.

The second generation tool, the one for which I’ve written a specification, is what I imagined version 3 would be. The reason v3 never came to be is because it really needed to be a full rewrite, and not an upgrade from v2. But v1 and v2 provided the practical experience that has shaped my thinking for generation 2.

I posted about v1 on this forum to a deafening silence. It may be that the people here have little need or interest in 2D Minkowski spacetime diagrams. It might be of more interest to physics teachers, for example, because I see it as a teaching and learning tool. I don’t know how to reach that audience—tips are welcome.

Feedback

There are specific types of feedback that I would appreciate:
  • Sources for Minkowsky spacetime diagrams (I’ve used Google image search, so it would have to be something more interesting).
  • Particular problems that you’d like to diagram.
  • Features you’d like to have in a Minkowsky spacetime diagram generator.
  • Offers to review the tool’s specification to look for missing features or missed opportunities.
Known Missing Features
  • This tool is for standard2D Minkowsky spacetime diagrams. If there are useful variants, you could make a case for them.
  • This tool is for 2D diagrams, not for 3D diagrams (or projections of 3D diagrams onto 2D). When I search for spacetime diagrams, I do get a number of images showing cones representing past and future light cones. All these diagrams look pretty much the same and seem to be illustrating the same thing.
  • Quite a few diagrams show hyperbolic curves. As I understand them, a single curve shows all the various coordinates for a specific point in spacetime as seen from every possible inertial frame. I might include these if someone could point out the value of having such a curve in illustrating a particular problem (as opposed to illustrating a general principle) and could also suggest how such a curve might be specified.
  • The diagrams are for problems in special relativity. I’m not sure how general relativity problems could be included, but am open to suggestions.
Feature Summary

Diagrams are drawn using a custom script language (there is no way a user interface could provide enough options to handle generic problems—most user-interface-driven tools I’ve seen model variations of a single problem).

The current specification allows the script to:
  • Draw axes for any inertial frame with proper angles and units
  • Automatically label axes and tick marks
  • Include unlimited observers
  • Create worldline to consist of segments of constant velocity or constant acceleration
  • Draw lines and fills
  • Draw events
  • Draw arbitrary labels
  • Draw the lines, fills, and text using various styles (colors, dashed lines, arrowheads, fonts, etc.)
  • Save diagrams as image files
  • Set up a diagram relative to a rest frame; draw it relative to any inertial frame
  • Perform some math operations and special functions provided with the ability to store results in variables
  • Create flexible animations
  • Pan and zoom the diagram
More Details

I’m not going to waste more space here. I’ve place a PDF of the specification at:



It includes a one-page overview and a one-page syntax. The syntax is explained in detail starting at page 5. A section on the user interface follows, and then a set of examples. The sixth sample has nine variations and illustrates how one can start with a specific problem and then vary either the problem, the visualization, or both.

Sample Diagram with Variations

Here is the sample problem:

Let Bob and Ted be two observers four light years apart and at rest. Let Alice be an observer on a path from Bob to Ted at a constant velocity of 0.8 c. When Alice reaches Bob, Bob’s and Ted’s clocks read 0 (relative to either Bob or Ted). Alice’s clock also reads 0 (relative to Bob and Alice). Ted sends a light signal to Bob at Ted’s clock time of -4 years. Bob sends a light signal to Ted at Bob’s clock time of 1 years.​

Keep in mind that the various scripts that follow have not been tested since the tool doesn’t yet exist. The diagrams were drawn with my gen 1 version 1 tool and may also have errors. Since I can’t do animation, I capture one moment in time and then use arrows to indicate what’s moving. The final variation is too tough for me to even try to draw.

let bobColor = [style color: black];
let tedColor = [style color: blue];
let aliceColor = [style color: red];
let lightColor = [style color: yellow];

let textStyle = [style font: “Georgia”, slant: italic];
let bobStyle = [style bobColor, textStyle];
let tedStyle = [style tedColor, textStyle];
let aliceStyle = [style aliceColor, textStyle];

let bob = [observer ];
let ted = [observer origin (4, 0)];
let alice = [observer velocity 0.8];

let signal1 = [line angle -45 point (4, -4)];
let signal2 = [line angle +45 point (0, 1)];

axes frame: ted, x: false, tedStyle;
axes frame: bob, xLabel: “x”, tLabel “t”, bobStyle;
axes frame: alice, xLabel: “x’”, tLabel “t’”, aliceStyle;

line line: signal1, clip: (4, -4) (inf, inf);
line line: signal2, clip: (0, 1) (inf, inf);


Original Problem.jpg


Variation 1

Start with the original script, but draw the diagram with Alice as the rest observer.

# Add this line anywhere

diagram frame: alice;

Variation 1.jpg


Variation 2
Start with the original script and animate the positions of the three observers along bob’s line of simultaneity. Display each observer’s clock where the simultaneity line intersects the observer.

# Add these lines at the top

let animation t = 0 to 5 step .01;
animation reps: 1;

# Add these lines before the axes commands

let simul = [line axis x bob offset t];
let bobLoc = intersect(simul, bob);
let tedLoc = intersect(simul, ted);
let aliceLoc = intersect(simul, alice);

# Add these lines at the end

event location: bobLoc, label: tauFromT(t, bob), bobStyle;
event location: tedLoc, label: tauFromT(t, ted), tedStyle;
event location: aliceLoc, label: tauFromT(t, alice), aliceStyle;

line line: simul, color: #AAA, dashed: true;

Variation 2.jpg

Variation 3

Start with variation 2 but now using Alice’s line of simultaneity. The diagram is still from Bob’s viewpoint.

# Change the animation assignment to

let animation t = 0 to 3 step .01;

# Change the simul variable to

let simul = [line axis x alice offset t];

Variation 3.jpg


Variation 4

Start with variation 3 but now draw the diagram from Alice’s viewpoint.

# Add this line anywhere

diagram frame: alice;

Variation 4.jpg


Variation 5

Start with variation 2. We will just show the events and use the animation’s time represent the time axis—each frame of the animation will be one-dimensional view. We will see Alice’s dot move from a steady dot representing Bob to a steady dot representing Ted. Each observer’s clock time is displayed by each dot.

# Add this line anywhere after t is defined.

diagram frame: [observer origin (0, -t)];

# Remove the axes and line statements

Variation 5.jpg


Variation 6

Start with variation 2. Again, we will just show the events and use the animation’s time to represent the time axis, but from Alice’s viewpoint this time. We will see Bob’s dot move away from Alice’s dot (which won’t move). We will also see Ted’s dot move toward and reach Alice’s dot. Each observer’s clock time is displayed by each dot.

# Change the animation assignment to

let animation t = 0 to 3 step .01;

# Change the simul variable to

let simul = [line axis x alice offset t];

# Add these lines anywhere

let alicePos = (0, t < alice);
diagram frame: [observer origin alicePos, velocity 0.8];

# Remove the axes and line statements

Variation 6.jpg


Variation 7

Start with variation 1, but let’s display Bob and Ted in the positions that Alice would see them. Also , display the clock times Alice would see. Note that I had to zoom out to get Ted's event dot in the attached diagram, so the scale is different from all the other diagrams.

# Remove everything after the “let alice = ...” statement

# Add these lines

let animation t = 0 to 3 step .01;

let aliceLoc = (0, t, <alice);
let lightLine = [line angle +45 point aliceLoc];
let bobLoc = intersect(lightLine, bob);
let lightLine = [line angle -45 point aliceLoc];
let tedLoc = intersect(lightLine, ted);

event location: aliceLoc, label: t, aliceStyle;
event location: (tedLoc.x, t), label: tedLoc.t, tedStyle;
event location: (bobLoc.x, t), label: bobLoc.t, bobStyle;

diagram frame: [observer origin alicePos, velocity 0.8];

Variation 7.jpg


Variation 8

Start with the original script.

Alice now starts he journey in the same rest frame as Bob and Ted. She accelerates at 1g until she is one light year from Bob (as measured by Bob). She coasts until she is one light year from Ted (as measured by Bob). She then decelerates at 1g until she reaches Ted, where her acceleration ends. She should now be in Bob’s and Ted’s rest frames again.

Display Alice’s ending clock time at her ending position.

# Replace the assignment to Alice’s observer variable to this

let alice = [observer acceleration 1 d 1, velocity d 3, acceleration 1 d 1];

# Remove Alice’s axes

# Add this at the end

let aliceTau = tauFromD(5, &alice);
worldline observer: alice, clip: (0, 0), (4, inf), aliceStyle;
label location: (4, aliceTau), text: aliceTau;

Variation 8.jpg


Variation 9

Start with variation 8, but animate the display so we can use Alice as the rest observer. Since Alice is accelerating, her rest frame is not consistent. Each frame of the animation will use her instantaneous moving frame at her point in time. I didn't try to create the diagram.

# Add these lines somewhere after &alice is defined

let animation tau = 0 to tauFromT(5, &alice) step .01;
animation reps: 1;

# Add this line anywhere after &alice and tau are defined

diagram frame: [frame alice at tau tau];
 
  • Like
Likes LBoy
Physics news on Phys.org
  • #2
Whoops! I forgot about grids! Yes, you can also draw grids for any inertial frame. As the relative speed of the moving frame increases, grids can get crazy dense, so the tool will automatically decrease the density of the grid lines as needed.
 
  • #3
Interactivity would be a nice feature.

Hyperbolic graph paper is somewhat useful, analogous to polar graph paper.
(Here are some from Tom Moore's website.)
http://www.physics.pomona.edu/sixideas/resources.html

A single hyperbola is good to show how events are mapped under a boost.
A single hyperbola (the Minkowskian circle) also defines "perpendicular" as the tangent-to-a-circle.
Hyperbolas also describe uniformly accelerated astronauts.

Of course, I will also suggest "clock diamonds" and "causal diamonds" drawn on "rotated graph paper".
See my Insights for details.
See also my AAPT presentation (where I argue that "rotated graph paper" is the best kind of graph paper for special relativity): https://www.aapt.org/docdirectory/m...dGraphPaper-CalculatingWithCausalDiamonds.pdf

Here's how I have used them: (image search)
https://www.google.com/search?q=relativity+on+rotated+graph+paper&tbm=isch
https://www.google.com/search?q=relativity+on+rotated+graph+paper+site:stackexchange.com&tbm=isch
https://www.google.com/search?q=relativity+on+"rotated+graph+paper"+site:physicsforums.com&tbm=isch

In addition to [itex] \beta [/itex] and [itex] \gamma [/itex],
I think there should be support for [itex] k [/itex] (the Doppler factor, the Bondi k-factor), rapidities, and light-cone coordinates.
 
  • Like
Likes vanhees71 and Freixas
  • #4
robphy said:
Interactivity would be a nice feature.

Hyperbolic graph paper is somewhat useful, analogous to polar graph paper.
(Here are some from Tom Moore's website.)
http://www.physics.pomona.edu/sixideas/resources.html

A single hyperbola is good to show how events are mapped under a boost.
A single hyperbola (the Minkowskian circle) also defines "perpendicular" as the tangent-to-a-circle.
Hyperbolas also describe uniformly accelerated astronauts.

Of course, I will also suggest "clock diamonds" and "causal diamonds" drawn on "rotated graph paper".
See my Insights for details.
See also my AAPT presentation (where I argue that "rotated graph paper" is the best kind of graph paper for special relativity): https://www.aapt.org/docdirectory/m...dGraphPaper-CalculatingWithCausalDiamonds.pdf

Here's how I have used them: (image search)
https://www.google.com/search?q=relativity+on+rotated+graph+paper&tbm=isch
https://www.google.com/search?q=relativity+on+rotated+graph+paper+site:stackexchange.com&tbm=isch
https://www.google.com/search?q=relativity+on+"rotated+graph+paper"+site:physicsforums.com&tbm=isch

In addition to [itex] \beta [/itex] and [itex] \gamma [/itex],
I think there should be support for [itex] k [/itex] (the Doppler factor, the Bondi k-factor), rapidities, and light-cone coordinates.
Thanks for all the suggestions!

I have some ideas for interactivity, but it probably won't happen on the first pass. It would require defining input variables and the widgets they are attached to (a slider, most likely). Whenever the user alters the widget, the diagram gets redrawn with the variable's value changed to match the widget's value. Something like:

let float i = [widget slider from 0 to 100 value 50];

None of this is planned to work on the web--my tool will be an application one runs. If you want to give someone interactivity, you would need to give them the script and they would need the tool. And if you have the tool and the script, you can always just type in whatever value you want for any variable. It's not a great way to do it, but it would get the job done.

A hyperbolic grid is relatively easy to add. Regular grids are drawn relative to some frame, but I gather this makes no sense for hyperbolic grids.

Hyperbolic event boosts are possible. Sometimes the hardest part is thinking up the syntax. I want to make things easy, not hard. I wasn't sure how to specify this, but I'm thinking I could just give an event with from and to frames, something like:

event location: (10, 0 <frame1), boost: frame2;

Without the boost, this just converts (10,0) from frame1 to the rest frame and puts a circle there. With the boost, it would convert (10,0) from frame2 to the rest frame as well and then join the two points with a hyperbola. With "boost: inf", it would draw the entire hyperbolic curve. Would that work?

The rotated graph paper seems easy. I don't like to do a specific case when I can do something more general: take any grid and rotate it by any number of degrees. I think this gets you part way. I'll have to check out your papers to see what else I'm missing.

As for support for Doppler factor, rapidities, etc., keep in mind that I am a programmer and not a physicist. I use formulas and processes given to me by physicists. So the odds that these things would be included rise proportionally with the amount of assistance I get in specifying the interface and in spelling out how the math gets applied. Ideally, I'd like to see some suggested syntax and then a drawing of the expected result, plus the math used to generate it.

Using coordinates that could be transformed into the standard Minkowsky Cartersian coordinates is not hard (once one has the right formulas). Drawing a different coordinate system altogether is another kettle of fish. Some coordinate systems are easier than others. For example, a coordinate system that turns a straight line into a different straight line is easier than one that turns it into a curve. The former just requires transforming the endpoints, the latter requires entirely different drawing techniques.
 
  • Like
Likes vanhees71
  • #5
Here's something I work on from time to time.
https://www.desmos.com/calculator/emqe6uyzha ( robphy's spacetime diagrammer for relativity v.8e-2021 (time upward) )
https://www.desmos.com/calculator/led14lihz2 ( robphy spacetime diagrammer for relativity (v9g) )

https://www.geogebra.org/m/HYD7hB9v (old version: Relativity on Rotated Graph Paper (robphy) - MAA2016) - https://www.geogebra.org/m/HYD7hB9v#material/VrQgQq9R
Use this tool to draw a segment between two points.
Click back on the arrow/cursor... then you can drag the points of the segment.
That's a "spacetime ruler". (Inkscape? for spacetime diagrams.)
1633025062231.png
 
Last edited:
  • Like
Likes vanhees71 and Freixas
  • #6
robphy said:
Here's something I work on from time to time.
Thanks for your input.

The Desmos tool is rather neat. It's a pretty flexible diagram generator. Looking at it, the question I asked myself is whether there is any value in what I'm proposing. Why not just use Desmos? My conclusion is that there is value, because Desmos doesn't really know anything about S.R.--the person creating the diagrams (you, in this case) provides that knowledge through the equations. And some things might be a bit clumsy. I can draw a worldline in v1 that includes segments under constant acceleration and segments under constant velocity, but it takes some time, swearing, and an adjacent spreadsheet.

Generic diagramming tools have strengths and weaknesses as do specialty diagramming tools (one's strength tends to be the other's weakness).

The spacetime ruler, if I understand from using it, basically acts as a measuring device. If the angle of the segment is less than 45, it's a space ruler and if greater, it is a time ruler. The angle of the line implies a particular inertial frame. Because I haven't had time to go through all your materials, I'm not sure what the boxes tell you. For instance, if you just had tick marks, would we lose any information?

I can see how this could be useful. I was planning on displaying the coordinates under the cursor, but a ruler could be handy. I'll have to think about this, because I might want a ruler capable of measuring both time and space relative to a given inertial frame.

By the way, in the prior post when you put the words "hyperbola", "event", and "boost" in close proximity, it gave me an idea of how to support event boosting. Until I saw your post, it wasn't clear to me how to incorporate the concept. I think what helped was looking at this curve as an extension of an event, so that was super handy.

Your input is exactly the kind of thing I was looking for. I may not incorporate everything you suggested, but it's pointing at things I should consider.
 
  • Like
Likes vanhees71
  • #7
Freixas said:
Thanks for your input.

The Desmos tool is rather neat. It's a pretty flexible diagram generator. Looking at it, the question I asked myself is whether there is any value in what I'm proposing. Why not just use Desmos? My conclusion is that there is value, because Desmos doesn't really know anything about S.R.--the person creating the diagrams (you, in this case) provides that knowledge through the equations. And some things might be a bit clumsy. I can draw a worldline in v1 that includes segments under constant acceleration and segments under constant velocity, but it takes some time, swearing, and an adjacent spreadsheet.

Desmos has some advantages like interactivity.
But it's hard to maintain. Every update, it seems, generates a new URL.
So, it's good for keeping versions [if you keep track of them], but hard to "update" and share it automatically with others.

On the other hand, using Glowscript or Python on http://trinket.io, there is a fixed URL for a program, which one may continually update.

Freixas said:
The spacetime ruler, if I understand from using it, basically acts as a measuring device. If the angle of the segment is less than 45, it's a space ruler and if greater, it is a time ruler. The angle of the line implies a particular inertial frame. Because I haven't had time to go through all your materials, I'm not sure what the boxes tell you. For instance, if you just had tick marks, would we lose any information?
The diamonds are the ticks of a "standard-issue" light clock along the timelike diagonal.
The area of a diamond is Lorentz-invariant.
The diamonds define the tickmarks... operationally, essentially via a radar method.

Pedagogically, they are not "calculated" because that's what some formula says it should be.
Instead, the ticking light clock determines the tickmarks (for time and space) for that inertial observer's frame of reference. They determine the "spacetime grid" for that observer.

The diagonals of the diamond yield the time and space axes for that observer
(they encode perpendicularity and are a proxy for a hyperbola).
The edges of the diamond yield the light-cone coordinates for that observer.
Freixas said:
I can see how this could be useful. I was planning on displaying the coordinates under the cursor, but a ruler could be handy. I'll have to think about this, because I might want a ruler capable of measuring both time and space relative to a given inertial frame.
One light-clock diamond is the prototypical unit of displacement in spacetime and
can be used to tile the plane to lay out the "spacetime grid" for an observer.
Hence, the "rotated graph paper" as the grid for the observer at rest in the diagram,
and also as a graphical aid to more easily [by construction and counting] draw the grid for another observer.

Freixas said:
By the way, in the prior post when you put the words "hyperbola", "event", and "boost" in close proximity, it gave me an idea of how to support event boosting. Until I saw your post, it wasn't clear to me how to incorporate the concept. I think what helped was looking at this curve as an extension of an event, so that was super handy.

Your input is exactly the kind of thing I was looking for. I may not incorporate everything you suggested, but it's pointing at things I should consider.
I'm glad it has been helpful.
 
  • Like
Likes vanhees71

FAQ: Request for Input: 2D Minkowski Spacetime Diagram Generator

1. What is a 2D Minkowski spacetime diagram?

A 2D Minkowski spacetime diagram is a graphical representation of the spacetime coordinates of an object or event in special relativity. It is used to visualize the effects of time dilation and length contraction in the context of the theory of relativity.

2. Why is a 2D Minkowski spacetime diagram useful?

A 2D Minkowski spacetime diagram allows us to better understand the concepts of time and space in special relativity. It also helps us visualize the effects of relativistic phenomena, such as the twin paradox and the relativity of simultaneity.

3. How does the 2D Minkowski spacetime diagram generator work?

The 2D Minkowski spacetime diagram generator uses mathematical equations and algorithms to plot the spacetime coordinates of an object or event. It takes into account the speed of light and the principles of special relativity to accurately depict the effects of time and space.

4. What are some applications of a 2D Minkowski spacetime diagram?

2D Minkowski spacetime diagrams are commonly used in physics and engineering to study the behavior of objects and events in special relativity. They are also used in educational settings to help students understand and visualize the concepts of time and space in the theory of relativity.

5. Are there any limitations to the 2D Minkowski spacetime diagram generator?

As with any scientific tool, the 2D Minkowski spacetime diagram generator has its limitations. It can only accurately depict objects and events moving at constant speeds in a straight line. It also does not take into account the effects of gravity, which would require a more complex 4D spacetime diagram.

Similar threads

Replies
5
Views
1K
Replies
70
Views
3K
Replies
1
Views
2K
Replies
20
Views
2K
Replies
4
Views
4K
Replies
14
Views
2K
Replies
10
Views
1K
Replies
56
Views
4K
Back
Top