#----------------------------- # Add RF Node #----------------------------- teapot_latt.initialize() ZtoPhi = 2.0 * math.pi / lattlength dESync = 0.0 RF1HNum = 1.0 RF1Voltage = 0.000016 RF1Phase = 0.0 RF2HNum = 2.0 RF2Voltage = -0.000003 RF2Phase = 0.0 length = 0.0 rf1_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RF1HNum, RF1Voltage, RF1Phase, length, "RF1") rf2_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RF2HNum, RF2Voltage, RF2Phase, length, "RF2") position1 = 196.0 position2 = 196.5 RFLatticeModifications.addRFNode(teapot_latt, position1, rf1_node) RFLatticeModifications.addRFNode(teapot_latt, position2, rf2_node) #---------------------------------------------- #make 2.5D space charge calculator #---------------------------------------------- #set boundary nboundarypoints = 128 n_freespacemodes = 32 r_boundary = 0.110 boundary = Boundary2D(nboundarypoints, n_freespacemodes, "Circle", r_boundary,
# electron bunch for iota lattice = readLattice("iota_oct4.seq", "iota") addAperture2(lattice) """------------------------------- add RF Cavity -----------------------------""" ZtoPhi = 2.0 * pi / lattice.getLength() dESync = 0.0 RFHNum = 4 RFVoltage = 400 * pow(10, -9) RFPhase = 0.0 length = 0.05 name = "rfnode" rf_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RFHNum, RFVoltage, RFPhase, length, name) position = 25.79485606 RFLatticeModifications.addRFNode(lattice, position, rf_node) sizeX = 64 #number of grid points in horizontal direction sizeY = 64 #number of grid points in vertical direction sizeZ = 3 #number of longitudinal slices in the 2.5D space charge solver calc2p5d = SpaceChargeCalc2p5D(sizeX, sizeY, sizeZ) for node in lattice.getNodes(): if node.getType() == "drift teapot": if node.getLength() > 0.01 and node.getLength() < 0.1: node.setnParts(2) elif node.getLength() >= 0.1 and node.getLength() < 0.5: node.setnParts(3) elif node.getLength() > 0.5:
elem0.setLength(4.0) lattice.initialize() #/////////////////////////////////////////////////////////// ZtoPhi = 2.0 * math.pi / lattice.getLength() RFVoltage = 0.1 RFPhasep = 150.0 RFPhasem = -150.0 dRFPhasep = 30.0 dRFPhasem = 30.0 length = 0.0 name = "barrier_rfnode" rf_node = RFNode.Barrier_RFNode(ZtoPhi, RFVoltage,\ RFPhasep, RFPhasem,\ dRFPhasep, dRFPhasem,\ length, name) position = 1.0 RFLatticeModifications.addRFNode(lattice, position, rf_node) print "Lattice length = ", lattice.getLength() print "ZtoPhi = ", ZtoPhi print "RFVoltage = ", RFVoltage print "RFPhasep = ", RFPhasep print "RFPhasem = ", RFPhasem print "dRFPhasep = ", dRFPhasep print "dRFPhasem = ", dRFPhasem #/////////////////////////////////////////////////////////// print "==============BEFORE============================"
accelDict = {} accelDict["gammaTrans"] = 1.e+10 accelDict["RFHNum"] = 1 accelDict["n_tuple"] = 8 accelDict["time"] = (0, 5.e-09, 10.e-09, 15.e-09, 20.e-09,\ 25.e-09, 30.e-09, 35.e-09, 40.e-09) accelDict["BRho"] = (5.6573729517, 5.7573729517, 5.8573729517,\ 5.9573729517, 6.0573729517, 5.9573729517,\ 5.8573729517, 5.7573729517, 5.6573729517) accelDict["RFVoltage"] = (0.1, 0.11, 0.12, 0.13, 0.14,\ 0.13, 0.12, 0.11, 0.1) accelDict["RFPhase"] = (0., 30., 60., 90., 90.,\ 90., 60., 30., 0.) length = 0.0 name = "harmonic_rfnode" rf_node = RFNode.BRhoDep_Harmonic_RFNode(ZtoPhi, accelDict, b, length, name) position = 1.0 RFLatticeModifications.addRFNode(lattice, position, rf_node) print "Lattice length = ", lattice.getLength() #/////////////////////////////////////////////////////////// print "==============BEFORE============================" b.dumpBunch() print "==========================================" #=====track action ============ def bodyAction(paramsDict): node = paramsDict["node"]
lattice.initialize() #/////////////////////////////////////////////////////////// ZtoPhi = 2.0 * math.pi / lattice.getLength() RFHNum = 1.0 RatioRFHNum = 2.0 RFVoltage = 0.1 RatioVoltage = 0.5 RFPhase = 1.0 RFPhase2 = 1.0 length = 0.0 name = "dual_harmonic_rfnode" position = 0.0 rf_node = RFNode.Dual_Harmonic_RFNode(ZtoPhi, RFHNum, RatioRFHNum, RFVoltage, RatioVoltage, RFPhase, RFPhase2, length, name) RFLatticeModifications.addRFNode(lattice, position, rf_node) print "Lattice length = ", lattice.getLength() print "ZtoPhi = ", ZtoPhi print "RFHNum = ", RFHNum print "RFVoltage = ", RFVoltage print "RatioVoltage = ", RatioVoltage print "RFPhase = ", RFPhase #/////////////////////////////////////////////////////////// print "==============BEFORE============================" b.dumpBunch() print "=========================================="
ZtoPhi = 2.0 * math.pi / lattice.getLength() accelDict = {} accelDict["gammaTrans"] = 1.e+10 accelDict["RFHNum"] = 1 accelDict["n_tuple"] = 8 accelDict["time"] = (0, 5.e-09, 10.e-09, 15.e-09, 20.e-09,\ 25.e-09, 30.e-09, 35.e-09, 40.e-09) accelDict["SyncPhase"] = (0., 10., 20., 30., 40.,\ 30., 20., 10., 0.) accelDict["RFVoltage"] = (0.1, 0.11, 0.12, 0.13, 0.14,\ 0.13, 0.12, 0.11, 0.1) accelDict["RFPhase"] = (0., 30., 60., 90., 90.,\ 90., 60., 30., 0.) length = 0.0 name = "harmonic_rfnode" rf_node = RFNode.SyncPhaseDep_Harmonic_RFNode(ZtoPhi, accelDict, b, length, name) position = 1.0 RFLatticeModifications.addRFNode(lattice, position, rf_node) print "Lattice length = ", lattice.getLength() #/////////////////////////////////////////////////////////// print "==============BEFORE============================" b.dumpBunch() print "==========================================" #=====track action ============ def bodyAction(paramsDict): node = paramsDict["node"]
accelDict["time"] = (0, 5.e-09, 10.e-09, 15.e-09, 20.e-09,\ 25.e-09, 30.e-09, 35.e-09, 40.e-09) accelDict["RFVoltage"] = (0.1, 0.11, 0.12, 0.13, 0.14,\ 0.13, 0.12, 0.11, 0.1) accelDict["RFPhasep"] = ( 150., 140., 130., 120., 110.,\ 120., 130., 140., 150.) accelDict["RFPhasem"] = (-150., -140., -130., -120., -110.,\ -120., -130., -140., -150.) accelDict["dRFPhasep"] = ( 30., 40., 50., 60., 70.,\ 60., 50., 40., 30.) accelDict["dRFPhasem"] = ( 30., 40., 50., 60., 70.,\ 60., 50., 40., 30.) length = 0.0 name = "barrier_rfnode" rf_node = RFNode.TimeDep_Barrier_RFNode(ZtoPhi, accelDict, b, length, name) position = 1.0 RFLatticeModifications.addRFNode(lattice, position, rf_node) print "Lattice length = ", lattice.getLength() #/////////////////////////////////////////////////////////// print "==============BEFORE============================" b.dumpBunch() print "==========================================" #=====track action ============ def bodyAction(paramsDict): node = paramsDict["node"]