Example #1
0
 def __str__(self):
     ret = "SectorMapMatrix:\n"
     ret += util.prettyPrint66(self.RE)
     return ret
Example #2
0
 def __str__(self):
     ret = "RFCavity_Matrix: "
     ret += "voltage = %10g[V], wavelength = %10g[m], phase = %10g[rad], E0 = %10g[GeV], m0 = %10g[MeV/c^2]" % (self.voltage,self.wavelength,self.phase, self.E0/1e9, self.m0/1e6)
     ret += util.prettyPrint66(self.RE)
     return ret
Example #3
0
ifile.close()

#Sanity check input
if myRing==None:
    print "ERROR: No ring was set up"
    exit(1)
if myBeam==None:
    print "No beam was set up"
    exit(1)
print

print "Ring:"
print myRing
print "Total matrix:"
totalRE = myRing.getTotalMatrix()
print util.prettyPrint66(totalRE)
print "Eigenvalues and vectors:"
(w, v) = np.linalg.eig(totalRE)
for i in xrange(6):
    print "#%i : abs= %16.10g, angle= %16.10g [2pi] -> "%(i,np.absolute(w[i]), np.angle(w[i])/(2*np.pi)), w[i]
    #print "\t", v[i] #Complex vector, needs some better formatting...
print

print "Beam:"
print myBeam
print

#Track!
print "Tracking!"
print "# particles = ", myBeam.getNumParticles()
print "# elements  = ", myRing.getNumElements()