Some math: the function ProductLog

Suppose we define a function y(x) by the following transcendental equation:  y=Exp[-yx]
Here is a visualizer which let’s you choose a value of x and see where the curves intersect:

Manipulate[Plot[{y,Exp[-x y]},{y,0,1.3}],{x,0,4}]

Spacetime diagrams

Here are the drawing functions from last week

event[{x_,t_},string_]:=Tooltip[{Gray,Disk[{x,t},.03]},string]
blueline[{x1_,t1_},{x2_,t2_},string_] := Tooltip[{Blue,Line[{{x1,t1},{x2,t2}}]},string]
redline[{x1_,t1_},{x2_,t2_},string_] := Tooltip[{Dotted,Red,Line[{{x1,t1},{x2,t2}}]},string]
thickredline[{x1_,t1_},{x2_,t2_},string_] := Tooltip[{Thick,Red,Line[{{x1,t1},{x2,t2}}]},string]
photon[{x1_,t1_},{x2_,t2_},string_] := Tooltip[{Dashed,Green,Line[{{x1,t1},{x2,t2}}]},string]

The Train/Tunnel “Paradox”

I’ve started a spacetime story by drawing worldlines for Alice and Bertrand, who move at β relative to each other.
Briefly, a train and a tunnel have the same proper length, but when they are in relative motion tunnel keeper Alice and train engineer Bertrand disagree about lengths, and their argument escalates to firing rockets and slamming doors shut. 
You can read all about it in the train/tunnel relativity tutorial posted to the webpage.

Your job: Read the train/tunnel paradox, and add events and worldlines to the story below.
Some examples:
  -- front and back rockets fire “now” according to Bertrand
  -- left and right gates close “now” according to Alice
  -- worldlines for closed gates (maybe use the thickredline[])
  -- worldlines for photons from various events

params= {γ->1/Sqrt[1-β^2],β->3/5,L->1}
AliceFrame=
{
redline[{0,-1},{0,1},"Alice worldline"],
redline[{L,-1},{L,1},"Tunnel exit"],
redline[{-L,-1},{-L,1},"Tunnel entrance"],
blueline[{-β,-1},{β,1},"Bertrand worldline"],
event[{0,0},"Origin"]
}//.params;
Manipulate[Graphics[GeometricTransformation[AliceFrame,{{1,v},{v,1}}/Sqrt[1-v^2]]],{{v,0},-.8,.8}]

Bonus section: The moving square

Here is some Mathematica code which figures out what an observer literally “sees” as square slides by at high speeds.
There is nothing to for you to do, but we’ll discuss some of this in class next week.

Begin["square`"]
β= .9; γ := 1/Sqrt[1-β^2];

Suppose an object (the lower left corner of a square to be precise) is to be found at x= x0+βt,y=y0.
If we want the corner to be at say (1,1) at t=0, then here is the Lorentz contracted “square”
which represents where the object really is at that moment.

plot1=Show[ParametricPlot[{1,1+y},{y,0,1},PlotRange->{{-1,2},{0,2.5}},AspectRatio->2.5/3,PlotStyle->Dashed],ParametricPlot[{1+x,1},{x,0,1/γ},PlotStyle->Dashed],ParametricPlot[{1+1/γ,1+y},{y,0,1},PlotStyle->Dashed],ParametricPlot[{1+x,1+1},{x,0,1/γ},PlotStyle->Dashed]]

We now ask what we actually “see” as we observe from our location at (0,0).
 Any light arriving at the origin from the corner just *now* (t = 0) was emitted an an earlier time.
 There are two solutions to the quadratic equation.  I claim we are interested in where the
 square was at the earlier time.  (What is the significance of the later time?)

solnt = Solve[(x0 + β t)^2 + y0^2 == t^2,t]
P[x0_,y0_] = {x0 + β t ,y0}/. solnt[[1]]

Here is a drawing of where the various photons were emitted, i.e. what we literally "see" as we look in various directions at time t=0:

plot2=Show[ParametricPlot[P[1,1+y],{y,0,1},PlotRange->{{-1,2},{0,2.5}},AspectRatio->2.5/3],ParametricPlot[P[1+x,1],{x,0,1/γ}],ParametricPlot[P[1+1/γ,1+y],{y,0,1}],ParametricPlot[P[1+x,1+1],{x,0,1/γ}]];
Show[plot1,plot2]

And finally, a movie wherein a square painting of Einstein is observed from the origin (0,0).

Clear[u,v]
einstein=;plot1=ParametricPlot[{1+u,1+v},{u,0,1/γ},{v,0,1},PlotRange->{{-1,2},{0,2.5}},AspectRatio->2.5/3,
Mesh->None,Axes->False,
PlotStyle->{Opacity[1],Texture[einstein]},TextureCoordinateFunction->({#1,#2}&)];
plot2=ParametricPlot[P[1+u,1+v],{u,0,1/γ},{v,0,1},Axes->False,PlotRange->{{-1,2},{0,2.5}},AspectRatio->2.5/3,Mesh->False,PlotStyle->{Opacity[1],Texture[einstein]},TextureCoordinateFunction->({#3,#4}&)]

t/.solnt[[1]];
temit[x0_,y0_]=%
ph[x_,y_,t_]:=With[{q=P[x,y],tt=t-temit[x,y]},Line[{q,q-(q/Norm[q])*If[(t<=0&&tt>=0),tt,0]}]]

The red dot indicates the origin, where we have placed a camera.
At any moment the rectangular Einstein is where the Lorentz-contracted square “is” right now, according to our ground definition “now”.
The curved image shows what the camera registers at the same moment.
 In particular we show the history of 4 photons which were created at the right time for them to arrive at the origin at t=0 (two of the photons are almost co-linear, as it happens).

Manipulate[Show[ParametricPlot[{{β t+u,1+v},P[β t+u,1+v]},{u,0,1/γ},{v,0,1},PlotRange->{{-9,5},{-.1,2.2}},AspectRatio->2.3/14,Axes->False,Frame->None,Mesh->False,PlotStyle->{{Opacity[.7],Texture[einstein]}},TextureCoordinateFunction->({#3,#4}&)],Graphics[{{Red,PointSize[.015],Point[{0,0}]},{Green,Dashed,ph[1/γ,1,t],ph[1/γ,2,t],ph[0,1,t],ph[0,2,t]}}],ImageSize->800],
{{t,0},-7,5}]