#-------------------------------------------------------------------------- # Animation of the string instanton solutions. This program generates a | # .dat numeric data file for each frame of the animation sequence. | # Usage (on UNIX): maple StringTheory.data.txt & | # | # Bob Bacus c.1997 | #------------------------- User input parameters -------------------------- p:=2: # F=e^(Pi*p*z) | q:=2: # G=e^(Pi*q*z) | startframe:=0: # Frame to start from | endframe:=400: # Frame to end on | points:=400: # Number of data points per frame | lmin:=-1:lmax:=1: # Range for the time parameter | smin:=-1:smax:=1: # Range for the length parameter | # ---------------------------- Main Program ------------------------------- gc(300000):interface(screenwidth=200):Digits:=4: readlib(unassign):readlib(write): unassign('t'):unassign('l'):unassign('n'):unassign('u'):unassign('s'): assume(t,real):assume(s,real): z:=t+I*s: #------------------------ X=[Im(F),Re(F),Re(G),Im(G)] -------------------------- # Torus Knots: F=z^p, G=-z^q imf:=Im(expand(z^p)): ref:=Re(expand(z^p)): reg:=Re(expand(-z^q)): img:=l: # Closed String Type V: F=e^(Pi*p*z), G=e^(Pi*q*z) imf:=((l/sin(Pi*q*s))^(p/q))*sin(Pi*p*s): ref:=((l/sin(Pi*q*s))^(p/q))*cos(Pi*p*s): reg:=(l/sin(Pi*q*s))*cos(Pi*q*s): img:=l: # Closed string Type B: F=e^(Pi*p*z), G=e^(Pi*q*z) imf:=sinh(Pi*p*arcsinh(l/(cos(Pi*q*s)-sin(Pi*q*s))))*(cos(Pi*p*s)+sin(Pi*p*s)): ref:=cosh(Pi*p*arcsinh(l/(cos(Pi*q*s)-sin(Pi*q*s))))*(cos(Pi*p*s)-sin(Pi*p*s)): reg:=-cosh(Pi*p*arcsinh(l/(cos(Pi*q*s)-sin(Pi*q*s))))*(cos(Pi*p*s)+sin(Pi*p*s)): img:=l: #------------------------------------------------------------------------------- l:=(lmax-lmin)/(endframe-startframe)*n+lmin: # n represents frame number; l is the proper time v:=(smax-smin)/(points-1): for n from startframe by 1 to endframe do open(cat(convert(p,string),`x`,convert(q,string),`-`,convert(n,string),`.dat`)): writeln(evalf(l)): writeln(points): for u from smin by v to smax do writeln(evalf(subs(s=u,[imf,ref,reg]))): od; close(): od; unassign('t'):unassign('l'):unassign('n'):unassign('u'): #-------------------------------------------------------------------------- # Use `StringTheory.data2gif.txt` to generate .gif frames. | #-------------------------------------------------------------------------- close(): quit: