DECLARE SUB intro () DECLARE SUB betakeus () DECLARE SUB toonklok () DECLARE SUB wisklok () DECLARE SUB tooncoor () DECLARE SUB tekenklok () COMMON SHARED pi, d, dist, distb, yxr, yxh, alfkl, xkl, ykl COMMON SHARED x0, t0, beta, gama, xhh, thh, thv, xhv, xvh, tvh, xvv, tvv COMMON SHARED colh, colv, colvh, colhv COMMON SHARED tith$, titv$ dumx = 5000 colh = 7: colv = 2: colvh = colv: colhv = colh SCREEN 12 intro pi = ATN(1) * 4 'kijkhoogte h0 = 300: 'hoogte reizend voorwerp h = 160: 'window voor h, dist WINDOW (-320, 240)-(320, -240) 'retour- en vertrek- kijkafstanden (distb: x=0; diste: x=x0) diste = 1100: distb = 100: 'schermordinaten retour, vertrek, factor t.o.v. kijkhoogte y0 = 100: y1 = -180: eta = (y0 - y1) / h0 'SLEEP 1 nieuwbeta: '********************************************** 'initialiseer snelheid (beta=v/c), reistijd en afstand(jaar, lichtjaar) '********************************************** betakeus gama = 1 / SQR(1 - beta * beta) 'reis volgens home t0 = 50 'jaar terugkeer; heen+terug= 2*t0 x0 = t0 * beta 'x=0 -> x0 voor d=distb -> dist dist = distb + INT((diste - distb) * beta) 'reis volgens voyager tr = t0 / gama 'jaar terugkeer xr = -x0 / gama 'positie home 'referentietijden td = t0 / (gama * gama) 'hometijd-heen gelijktijdig met voyager's retour te = 2 * t0 - td 'hometijd-terug " " " " " herhaalbeta: '********************************************** 'herhaal vorige cyclus beta '********************************************** 'init d = 0: x = 0: y = 0 'schermordinaat en kijkhoogte voor retourpunt: yxr = y1 + eta * h0 * (dist - distb) / dist hxr = eta * h * distb / dist 'idem voor vertrekpunt: yxh = y1 + 0 hxh = eta * h '********************************************** '1. standpunt thuisblijver '********************************************** 'afstand bij retour voor reiziger xr = -x0 / gama CLS LOCATE 3, 35 COLOR 11 PRINT USING "(v = #.##c)"; beta tith$ = "1: OBSERVATION HOMETWIN" titv$ = "(corresp. data TravTwin)" '********************************************** '1.1. heenreis: '********************************************** colv = 6 'tekenklok tekenklok 'STEP = afloop proportioneel aan snelheid beta FOR de = distb TO diste 'STEP beta 'proportioneel beta d = distb + (de - distb) * beta 'schermordinaat yx = y1 + eta * h0 * (d - distb) / d 'kijkhoogte hx = eta * h * distb / d 'twinvoorwerp LINE (-hx / 2, yx)-(hx / 2, yx + hx), colv, B 'coordinaten in home-system: colvh = colv: colhv = colh 'voyager: xhv = x0 * (d - distb) / (dist - distb) thv = xhv / beta 'home: xhh = 0: thh = thv 'coordinaten in voyager system: 'home: SELECT CASE thh 'voor returnpoint: CASE IS <= td tvh = gama * thh xvh = -beta * tvh 'tijdens returnpoint-overgang referentiestelsel: CASE IS > td colvh = 13: 'colhv = colvh tvh = t0 / gama bet = (1 - thh / t0) / beta: gam = 1 / SQR(1 - bet * bet) xvh = x0 / gam 'xvh = stilte END SELECT 'voyager: tvv = thh / gama xvv = 0 toonklok tooncoor 'wachtlus proportioneel aan "(kijk-)snelheid" FOR dum = 0 TO dumx: NEXT 'huidige posities wissen: 'twinvoorwerp LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B 'vertrek- en retourposities tonen: LINE (-hxh / 2, yxh)-(hxh / 2, yxh + hxh), colh, B wisklok NEXT de LINE (-hx / 2, yx)-(hx / 2, yx + hx), colv, B 'tooncoor toonklok SLEEP 1 LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B '********************************************** '1.2. terugreis: '********************************************** 'disto = d colv = 2 'FOR d = disto TO distb STEP -beta FOR de = diste TO distb STEP -1 'proportioneel beta d = distb + (de - distb) * beta yx = y1 + eta * h0 * (d - distb) / d hx = eta * h * distb / d LINE (-hx / 2, yx)-(hx / 2, yx + hx), colv, B 'coordinaten in homestelsel: colvh = colv: colhv = colh 'voyager xhv = x0 * (d - distb) / (dist - distb) thv = t0 + (x0 - xhv) / beta 'home xhh = 0: thh = thv 'coordinaten in voyager-system: 'home: SELECT CASE thh 'gedurende return overgang referentiestelsel: CASE IS < te tvh = tr bet = (1 - thh / t0) / beta: gam = 1 / SQR(1 - bet * bet) xvh = x0 / gam 'xvh = stilte colvh = 13: 'colhv = colvh 'na return CASE IS >= te tvh = 2 * tr - gama * (2 * t0 - thh) xvh = xr + beta * (tvh - tr) END SELECT 'voyager: xvv = 0 tvv = thh / gama toonklok tooncoor FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yx)-(hx / 2, yx + hx), 0, B LINE (-hxh / 2, yxh)-(hxh / 2, yxh + hxh), colhv, B wisklok NEXT de 'tooncoor toonklok 'LINE (-hx / 2, yx)-(hx / 2, yx + hx), colh, B COLOR 11: LOCATE 1, 1 PRINT "(Wait a sec...)" SLEEP 3: B$ = INKEY$: IF B$ = " " THEN END wisklok '********************************************** '2. standpunt reiziger '********************************************** CLS LOCATE 3, 35 COLOR 11 PRINT USING "(v =-#.##c)"; beta tith$ = "(corresp. data HomeTwin)" titv$ = "2: OBSERVATION TRAVTWIN" '********************************************** '2.1. heenreis: '********************************************** 'tekenklok tekenklok colv = 6 '********************************************** '2.1.1. Tot retourpunt '********************************************** distv = distb + ((dist - distb) / gama) FOR de = distb TO distb + INT((distv - distb) / beta) 'STEP beta 'proportioneel beta d = distb + (de - distb) * beta 'schermordinaat yx = y1 + eta * h0 * .75 * (d - distb) / d 'kijkhoogte hx = eta * h * distb / d 'twinvoorwerp (blijft nu 'ter plaatse'!) LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B '(thuisvoorwerp 'verwijdert' zich nu!) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colh, B 'klokken: colvh = colv x = x0 * (d - distb) / (dist - distb) t = x / beta 'coordinaten voyagerstelsel 'home xvh = -x0 * (d - distb) / (gama * (distv - distb)) tvh = -xvh / beta 'voyager xvv = 0 tvv = tvh 'coordinaten homestelsel 'home thh = tvh / gama xhh = 0 'voyager thv = gama * tvh xhv = beta * thv toonklok tooncoor 'wachtlus proportioneel aan "(kijk-)snelheid" FOR dum = 0 TO dumx: NEXT 'huidige posities wissen: 'twinvoorwerp 'hou rekening met afronding STEP beta 'IF d > INT(dist / gama) - beta THEN col = colv ELSE col = 0 LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), 0, B '(home 'verwijdert' zich nu!) 'IF d > INT(dist / gama) - beta THEN col = colhv ELSE col = 0 LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B wisklok NEXT de 'tooncoor toonklok 'onthou yx voor omkeer yxo = yx 'afronding door STEP beta verrekenen distvo = d - beta FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B colvh = 13: colhv = colvh: SLEEP 1 LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B '********************************************** '2.1.2. instant omkering stelsels in retourpunt '********************************************** 'bet = beta TO -beta => perceptie afstanden = x'0 TO -x0 TO x'0 '1ste: beta TO 0; x'0 TO -x0 (distv TO dist) '********************************************** FOR d = INT(distv) TO dist '= distvo TO dist 'STEP beta sign = 1 GOSUB keerom NEXT d LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B toonklok SLEEP 1 wisklok 'bet = 0: oranje (bet>0 = verwijd) wordt groen (bet<0 = nader) colv = 2 LINE (-hxh / 2, yxo)-(hxh / 2, yxo + hxh), colv, B '2de: 0 TO -beta ; -x0 TO x'0 (dist TO distv) '********************************************** disto = d - 1 FOR d = dist TO INT(distv) STEP -1 '= disto TO distvo STEP -1 sign = -1 GOSUB keerom NEXT d LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B toonklok SLEEP 1 wisklok LINE (-hxh / 2, yxo)-(hxh / 2, yxo + hxh), 0, B '********************************************** '2.1.3. terugreis: '********************************************** FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B colv = 2: colvh = colv: colhv = colh 'FOR d = distvo TO distb STEP -beta FOR de = distb + INT((distv - distb) / beta) TO distb STEP -1 'STEP beta 'proportioneel beta d = distb + (de - distb) * beta yx = y1 + eta * h0 * .75 * (d - distb) / d hx = eta * h * distb / d 'hxx = eta * h * distb / (dist / gama - d + distb) LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), colv, B '(thuisvoorwerp 'nadert' nu!) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colh, B 'klokken colh = 7: colv = 2 x = x0 * (d - distb) / (dist - distb) t = tr + (xr - x) / beta 'coordinaten voyagerstelsel 'home xvh = -x0 * (d - distb) / (gama * (distv - distb)) tvh = 2 * t0 / gama + xvh / beta 'voyager xvv = 0 tvv = tvh 'coordinaten homestelsel 'home thh = 2 * t0 + xvh / (beta * gama) xhh = 0 'voyager thv = gama * tvh xhv = beta * (2 * t0 - thv) toonklok tooncoor FOR dum = 0 TO dumx: NEXT IF d = distb THEN col = colv ELSE col = 0 LINE (-hxh / 2, yx)-(hxh / 2, yx + hxh), col, B LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), col, B wisklok NEXT de 'tooncoor toonklok LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colv, B '********************************************** 'volgende cyclus: '********************************************** COLOR 11: LOCATE 1, 1 PRINT "-> PRESS KEY (SPACE=End, ENTER=New velocity, Else=Repeat)" SLEEP: a$ = INKEY$ IF a$ = " " THEN END wisklok IF a$ = CHR$(13) THEN GOTO nieuwbeta ELSE GOTO herhaalbeta END IF END '********************************************** 'SUBroutine omkeer (helft heen, helft weer) '********************************************** keerom: x = x0 * (d - distb) / (dist - distb) gam = x0 / x bet = sign * SQR(1 - 1 / (gam * gam)) t = t0 * (1 - bet * beta) 't = x / beta 'bet = (1 - t / t0) / beta 'gam = 1 / SQR(1 - bet * bet) yx = y1 + eta * h0 * .75 * (d - distb) / d hx = eta * h * distb / d '(thuisvoorwerp ) LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), colhv, B '(voyager) LINE (-hxh / 2, yxo)-(hxh / 2, yxo + hxh), colv, B 'coordinaten voyagerstelsel 'home xvh = -x0 / gam 'tvh = -xvh / beta 'voyager xvv = 0 'tvv = tvh 'coordinaten homestelsel 'home thh = t xhh = 0 'voyager 'thv = gama * tvh 'xhv = beta * thv toonklok tooncoor FOR dum = 0 TO dumx: NEXT LINE (-hx / 2, yxh)-(hx / 2, yxh + hx), 0, B 'LINE (-hxh / 2, yxo)-(hxh / 2, yxo + hxh), 0, B wisklok RETURN SUB betakeus CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtiviTY: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 11 'PLAY "l21o3gp21fp21ep21d" LOCATE 8, 1 INPUT " -> velocity beta (=v/c, between +.1 and +.9999, 0=END) : ", beta IF beta < .1 OR beta > .9999 THEN END ''''EXIT SUB CLS 'PLAY "l21o3cp21cp21dp21e" END SUB SUB intro CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtiviTY: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 2 PRINT " 1/2" PRINT " This 'TwinTy Simulator' shows how the Paradox Twins measure up" PRINT " each others' movement during the forth/back trip of the traveler," PRINT " in accordance with the relativistic Lorentz equations," PRINT " displaying also the instantaneous transition effects" PRINT " experienced by the traveling twin at his return point" PRINT " (limit case of continuous de- and accelerated return!)." PRINT PRINT " The two standpoints are shown: " PRINT " 1. Observation by HomeTwin (and corresponding data TravTwin)" PRINT " 2. Observation by TravTwin (and corresponding data HomeTwin)" PRINT " HomeTwin shown as the lower square; TravTwin shown as the upper square. " PRINT " Data shown: clocks of/by either twin, and distance bar;" PRINT " left side: HomeTwin's data, right side: TravTwin's data." PRINT PRINT " Colors:" PRINT " HomeTwin white; TravTwin orange at forth trip, green at back trip;" PRINT " magenta during 'instant' turning back (also data HomeTwin)." LOCATE 28, 1 COLOR 11 PRINT " -> PRESS KEY..." SLEEP a$ = INKEY$ 'PLAY "l21o3gp21fp21ep21d" CLS : LOCATE 3, 15: COLOR 11 PRINT "RELAtiviTY: the TWIN PARADOX" LOCATE 5, 15: COLOR 14 PRINT "Credits: guido wuyts 2006" COLOR 2 PRINT " 2/2" PRINT " Travel time according to HomeTwin is set to 100 Ys (years): " PRINT " 50 years forth and 50 back, so either velocity is equal (+v and -v)." PRINT " Distance reached according to HomeTwin = 50*v/c LYs (lightyears)." PRINT PRINT " Notice the equal duration of both trip halves, valid for either twin," PRINT " but with the contracted duration in the case of the traveler." PRINT PRINT " Notice the intermediate interval of the homestayer left out of" PRINT " both 'forth' and 'back' inertial systems of the traveler." PRINT " That interval is actually covered by his 'instantaneous' return event," PRINT " described as a succession of instantaneous (with constant time = " PRINT " return time) inertial systems (from velocity v to 0 to -v)" PRINT " through which he evolves." PRINT " Notice how these systems measure up distances, in function of velocity," PRINT " that evolve from the contracted value (of TravTwin's 'forth trip' system)" PRINT " to the rest value (when he 'reaches' rest w.r.t. HomeTwin), and" PRINT " back again to the contracted value (when he ends up to his" PRINT " 'back trip' system)." PRINT PRINT " > Choose velocity v, or rather, beta=v/c..." PRINT " " LOCATE 28, 1 COLOR 11 PRINT " -> PRESS KEY..." SLEEP a$ = INKEY$: a$ = INKEY$ END SUB SUB tekenklok 'wijzerplaten' 'klokken van thuisblijver 'klok voor retourpunt: CIRCLE (-200, yxr), 40, colh, 0, pi 'klok voor vertrekpunt: CIRCLE (-200, yxh), 40, colhv, 0, pi hoek = .5 * pi * beta * beta CIRCLE (-200, yxh), 40, 13, .5 * pi - hoek, .5 * pi + hoek 'klokken van reiziger 'klok voor retourpunt: CIRCLE (200, yxr), 40, 6, 0, .5 * pi / gama CIRCLE (200, yxr), 40, 2, .5 * pi / gama, pi / gama 'klok voor vertrekpunt: CIRCLE (200, yxh), 40, 6, 0, .5 * pi / gama CIRCLE (200, yxh), 40, 2, .5 * pi / gama, pi / gama END SUB SUB tooncoor COLOR colh LOCATE 3, 8 PRINT tith$ LOCATE 7, 8 PRINT USING " time:####.## Ys"; thv LOCATE 20, 8 PRINT USING "< dist:####.## LYs"; xhv COLOR colhv LOCATE 22, 8 PRINT USING " time:####.## Ys"; thh 'LOCATE , 8 'PRINT USING "x:####.##"; xhh COLOR colv LOCATE 3, 55 PRINT titv$ LOCATE 7, 55 PRINT USING " time':####.## Ys"; tvv 'LOCATE , 55: PRINT USING " x':####.##"; xvv COLOR colvh LOCATE 22, 55 PRINT USING " time':####.## Ys"; tvh LOCATE 20, 55: PRINT USING " dist':####.## LYs>"; xvh END SUB SUB toonklok 'wijzers' 'voyager volgens home 'wijzerhoek 'alfkl = d * pi * .5 / dist alfkl = thv * pi * .5 / t0 'wijzer-x en -y xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) 'wijzers: LINE (-200, yxr)-(-200 + xkl, yxr + ykl), colh 'home volgens home alfkl = thh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (-200, yxh)-(-200 + xkl, yxh + ykl), colhv 'voyager volgens voyager alfkl = tvv * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxr)-(200 + xkl, yxr + ykl), colv 'home volgens voyager alfkl = tvh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxh)-(200 + xkl, yxh + ykl), colvh 'afstand volgens home LINE (-280, yxh)-(-280, yxh + (ABS(xhv) / x0) * (yxr - yxh)), colhv LINE -(-280, yxr), 0 'afstand volgens voyager 'PSET (280, yxh), colvh 'IF colvh <> colv THEN LINE -(280, yxh + (yxr - yxh) / gama), colv 'LINE -(280, yxh + (ABS(xvh) / x0) * (yxr - yxh)), colvh 'LINE -(280, yxr), 0 LINE (280, yxr)-(280, yxh + (ABS(xvh) / x0) * (yxr - yxh)), 0 IF colvh <> colv THEN LINE -STEP(0, -(yxr - yxh) / gama), colv LINE -(280, yxh), colvh PSET STEP(0, 0), 0 END SUB SUB wisklok 'LINE (-200, yxr)-(-200 + xkl, yxr + ykl), 0 'LINE (-200, yxh)-(-200 + xkl, yxh + ykl), 0 'LINE (200, yxr)-(200 + xkl, yxr + ykl), 0 'LINE (200, yxh)-(200 + xkl, yxh + ykl), 0 'voyager volgens home 'wijzerhoek 'alfkl = d * pi * .5 / dist alfkl = thv * pi * .5 / t0 'wijzer-x en -y xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) 'wijzers: LINE (-200, yxr)-(-200 + xkl, yxr + ykl), 0 'home volgens home alfkl = thh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (-200, yxh)-(-200 + xkl, yxh + ykl), 0 'voyager volgens voyager alfkl = tvv * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxr)-(200 + xkl, yxr + ykl), 0 'home volgens voyager alfkl = tvh * pi * .5 / t0 xkl = 30 * COS(alfkl) ykl = 30 * SIN(alfkl) LINE (200, yxh)-(200 + xkl, yxh + ykl), 0 ''afstand volgens home 'LINE (-280, yxh)-(-280, yxh + (ABS(xhv) / x0) * (yxr - yxh)), 0 ''afstand volgen voyager 'LINE (280, yxh)-(280, yxh + (ABS(xvh) / x0) * (yxr - yxh)), 0 END SUB