JSPEC User Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 12

Sectionname Category Usage
section_scratch scratch Definevariablesanddocalculationswiththevariables.Thevariables
definedinthissectioncanbeusedindefinitionsections.
section_ion definition Setparametersfortheionbeam
section_ring definition Setparametersfortheionring
section_e_beam definition Setparametersforthecoolingelectronbeam
section_cooler definition Setparametersforthecooler
section_ibs definition SetparametersforIBSratecalculation
section_ecool definition Setparametersforelectroncoolingratecalculation
section_run operation Createtheobjectives(ionbeam,ionring,electronbeam,cooler)and
performthecalculationand/orthesimulation.
JSPECv.1.0.0UserManual
Usingthetextbaseduserinterface
RunJSPECwiththeinputfile
PuttheinputfileinthesamedirectorywiththeJSPECprogramandrunJSPECas:
jspec.exeinputfile
Formatoftheinputfile
Theinputfileisaplaintextfileanditwillbeparsedbytheprogramlinebyline.Eachcommandorexpression
shouldoccupyaseparateline.Commentsstartwith"#".Everythingbehindthe"#"inthelinewillbeignoredby
theprogram.Blanklines,whitespacesandtabsarealsoignored.TheinputfileisNOTcasesensitive.
Theinputfileisorganizedbyvarioussections.Allthesectionsfallintothreedifferentcategories:(1)scratch
section,(2)definitionsectionsand(3)operationsection.Allthesectionswiththerespectivecategoriesand
usagesarelistedinthefollowingtable.
Theinputfilestartswithasectionbycallingthesectionname.Onceasectionnameiscalled,therespective
sectioniscreated,andthissectionendswhenanothersectionnameiscalledorwhentheinputfileends.
Sectionscanberepeatedcalledandthelatteroneoverwritethepreviousones.Butifaparametersisnotset
againinthelatterone,itsvalueremains.
Thefollowingexampleincludesthreedifferentsectionsinthreedifferentcategories.
Constant Value Meaning
k_c 299792458.0 speedoflight,inm/s
k_e 1.602176565E1 Elementarycharge,inC
k_pi 3.1415926535897932384626
k_u 931.49406121 Atomicmassunit,inMeV/c^2
k_me 0.510998928 Electronmass,inMeV/c^2
k_ke 8.9875517873681764E+9 Coulomb'sconstant,inN*m^2/C^2
section_scratch#scratchsection
 m=938.272
 ke=8000
 gamma=ke/m+1
 printgamma
 list_const
section_e_beam#definitionsection,definetheparametersforelectronbeam
 gamma=gamma
 tmp_tr=0.1
 tmp_l=0.1
 shape=dc_uniform
 radius=0.004
 current=2
section_run#operationfunction
 create_e_beam
Thefirstsectionisascratchsection.Inthissection,threevariables,m,ke,andgamma,aredefined.Thevalues
ofmandkeareassigned,andgammaiscalculatedfromkeandm.Thecalculationissupportedbythemath
parser,muParser.Fundamentalcalculationsandfunctionsaresupported,includingsummation,subtraction,
multiplication,division,squareroot,exponentialfunction,etc.FormoredetailsaboutthemuParser,pleasereferto
http://beltoforion.de/article.php?a=muparser.Thecommand"printgamma"willprintthevalueofgammatothe
screen.Thefollowingcommandwillshowalistofalltheconstantvariablessupportedbythescratchsectionon
thescreen.Alltheconstantvariablesandtheirvaluesarelistedinthefollowingtable.
Thesecondsectionisadefinitionsection,whichsetstheparametersforthecoolingelectronbeam.Inallthe
expressionsinthissection,theleftsideofthe"="signisakeywordinsection_e_beam,whichcorrespondstoa
parameteroftheelectronbeam,andtherightsideisthevaluedassigntothekeyword(theparameter).Thefirst
expressioninthissectionis"gamma=gamma".1Theleftgammaisakeyword,whichrepresentstheLorentz
factoroftheelectronbeam.Therightgammaisthevariabledefinedintheabovescratchsection.This
expressionassignsthevalueofthescratchvariablegammatothekeywordgamma.Pleasenotethatascratch
variablecanbeusedinothersectionstosetthevalueforakeyword,butakeywordcannotbeusedinthesame
way.Akeywordshouldalwaysbeontheleftsideofthe"="sign.Thisisthemostimportantdifferencebetweena
scratchvariableandakeyword.Thefollowingexpressionsassignvaluesforotherparametersoftheelectron
beam,whicharethetransversetemperature,thelongitudinaltemperature,theshape,theradiusandthecurrent
oftheelectronbeamrespectively.Dependingontheshapeoftheelectron,variousparametersneedtobeset.In
thisexample,oneneedstosettheradiusandthecurrentforauniformDCelectronbeam.Othersupported
shapesandtherelatedparameters(keywords)canbefoundinthelistsinthenextchapter.
Thethirdsectionistheoperationsection.Intheoperationsection,onecancreatetheobjectsoftheelements,
calculatetheexpansionrateandperformthesimulation.Inthisexample,wecreateanobjectoftheelectron
beamthathasbeendefinedintheabovedefinitionsection.Pleasenotethatthedefinitionsectiononlyrecords
thevaluesoftheparameters,anelementwillnotbecreateduntiltherespectivecommandiscalledinthe
operationsection.Formorecommandssupportedintheoperationsection,pleasecheckoutthelistinthenext
chapter.
IBSExpansionRateCalculation
TocalculatetheIBSexpansionrate,oneneedstodefinetheionbeamandthering.Thensettheparametersfor
IBSratecalculation.Finally,intheoperationsectioncreatetheionbeamandthering,andcallthecommandto
calculatetheIBSexpansionrate.
section_ion  #Definetheionbeam
 ......
section_ring #Definethering
 ......
section_ibs  #SetparametersforIBSratecalculation
 ......
section_run 
 create_ion_beam #Createtheionbeam
create_ring  #Createthering
calculate_ibs  #CalculatetheIBSrate
Tocalculatethetotalexpansionrate,whichisthesummationoftheIBSexpansionrateandtheelectroncooling
rate,onecancallthecommand"total_expansion_rate"insection_run.
CoolingRateCalculation
Tocalculatethecoolingrate,oneneedstodefinetheionbeam,thering,theelectronbeamandthecooler.Then
settheparametersforcoolingratecalculation.Finally,intheoperationsectioncreatealltherelatedelements
aforementionedandcallthecommandtocalculatethecoolingrate.
section_ion  #Definetheionbeam
...... 
section_ring #Definethering
 ......
section_e_beam #Definetheelectronbeam
 ......
sectoin_cooler #Definethecooler
 ......
section_ecool #Settheparametersfortheelectroncoolingratecalculation
 ......
section_run
 create_ion_beam #Createtheionbeam
create_ring  #Createthering
create_e_beam  #Createtheelectronbeam
create_cooler  #Createthecooler
 calculate_ecool #Calculatetheelectroncoolingrate
Keywords Meaning
list_var listallthevariablesthathasbeendefined.
list_const listalltheconstants
list_exp listalltheexpression
print Usethiscommandinformat"printx"anditwillprintthevalueofthevariablexinthescreen
Simulation
OnecansimulatetheevolutionoftheionbeamundertheIBSeffectand/orelectroncoolingeffectduringa
predeterminedtime.Theemittances,momentumspread,bunchlength(forbunchedionbeam),andthetotal
expansionrateinallthethreedimensionswillbeoutputtedintoatextfile.Ifdesired,thecoordinatesofalltheion
samplescanalsobesavedintofiles.Theseparametersaresetinsection_simulation,andthesimulationstarts
whenthecommand"run_simulation"iscalledinsection_run.
section_simulation#Settheparametersforthesimulation
 ......
section_run
run_simulation #Startsimulation
Keepaconstantbunchlengthoftheionbeaminsimulation
Themomentumspreadoftheionbeamchangesduetotheintrabeamscatteringeffectandtheelectroncooling
effectduringthesimulation,hencethebunchlengthchangesiftheRFvoltageisconstant.However,iftheRF
voltagechangesaccordinglywiththemomentumspread,itispossibletomaintainaconstantbunchlength.
JSPECallowstheusertochoosewhethertokeepthebunchlengthconstantinthesimulation.Whenthebunch
lengthismaintainedconstant,theRFvoltageiscalculatedandsavedintheoutputfile.
Tousethisfeature,oneneedstosettheparameter"fixed_bunch_length"insection_simulationtobetrue.One
alsoneedstosettheparameters,rf_h(harmonicnumber),rf_phi(RFphase),andgammar_tr(transitiongamma)
insection_ring.
section_ring#definethering
 ...
 rf_h=3584
 rf_phi=0
 gamma_tr=12.46
 
...
section_simulation
 ...
 fixed_bunch_length=true
Listofsections,keywords,andcommands
section_scratch
Keywords Meaning
charge_number Numberofthechargesoftheion
mass Massin[MeV/c2]oftheion
kinetic_energy Kineticenergyin[MeV]oftheion
norm_emit_x Normalizedhorizontalemittancein[m*rad]oftheionbeam
norm_emit_y Normalizedverticalemittancein[m*rad]oftheionbeam
momentum_spread Momentumspreadoftheionbeam
particle_number Totalparticlenumberforcoastingionbeamortheparticlenumberofonebunchfor
bunchedionbeam.
rms_bunch_length RMSbunchlengthforbunchedionbeamin[m]
Keywords Meaning
lattice Thenameofthefilethatsavesthelattice.ThisfileshouldbeintheMADXoutputformat
(.tfs).
qx Transversebetatrontune
qy Verticalbetatrontune
qs Synchrotrontune
gamma_tr Transitiongamma
rf_v VoltageoftheRFcavityin[V]
rf_h Harmonicnumber
rf_phi RFphasein[2 ]
section_ion
section_ring
section_cooler
Keywords Meaning
length Lengthofthecoolerin[m]
section_number Numberofthecoolers
magnetic_field Magneticfieldin[T]
bet_x Betafunctioninhorizontaldirectionin[m]
bet_y Betafunctioninverticaldirectionin[m]
disp_x Dispersioninhorizontaldirectionin[m]
disp_y Dispersioninverticaldirectionin[m]
alpha_x Alphainhorizontaldirection
alpha_y Alphaininverticaldirection
disp_dx Derivativeofthedispersioninhorizontaldirection
disp_dy Derivativeofthedispersioninverticaldirection
section_e_beam
Keywords Meaning
gamma Lorentzfactorgammaforthecoolingelectronbeam
tmp_tr Transversetemperaturein[eV]
tmp_l Longitudinaltemperaturein[eV]forthecoolingelectronbeam
shape
Electronbeamshape.Choosefromdc_uniform,bunched_gaussian,
bunched_uniform,bunched_uniform_elliptic,dc_uniform_hollow,
bunched_uniform_hollow,bunched_user_defined.
radius Radiusofdc_uniformorbunched_uniformelectronbeamin[m].
current Currentofdc_uniformorbunched_uniformelectronbeam.Forbunched_uniform
beam,setthecurrentasifitisadc_uniformbeamin[A].
length Lengthofthebunched_uniformelectronbeamin[m].
sigma_x RMSsizeinhorizontaldirectionofbunched_gaussianelectronbeamin[m].
sigma_y RMSsizeinverticaldirectionofbunched_gaussianelectronbeamin[m].
sigma_z RMSbunchlengthofbunched_gaussianelectronbeamin[m].
rh Lengthofthesemiaxisinhorizontaldirectionin[m].
rv Lengthofthesemiaxisinverticaldirectionin[m].
r_inner Innerradiusofahollowbeamin[m]
r_outter Outterradiusofahollowbeamin[m]
particle_file Nameofthefilethatsavestheparticlesifthebeamshapeisdefinedas
"bunched_user_defined"
total_particle_number Totalnumberofparticlestoloadfromtheuserprovidedfile
box_particle_number Maximumnumberofparticlesineachchildlessboxwhenconstructingthetree
structure.Defaultis200.
line_skip Numberoflinestoskipwhenloadingparticlesfromtheuserprovidedtextfile.
vel_pos_corr Whethertoconsiderthecorrelationbetweenthevelocityandtheposition.Default
isfalse.
binary_file Whethertheuserprovidedfileisinbinaryformat.Defaultisfalse,whichmeansa
textfile.
buffer_size Buffersizewhenloadingparticlesfromtheuserprovidedbinaryfile.
section_ibs
Keywords Meaning
nu Setthegridnumberinhorizontaldirectionforthe3Dintegration.
nv Setthegridnumberinverticaldirectionforthe3Dintegration.
nz Setthegridnumberinlongitudinaldirectionforthe3Dintegration.
log_c Coulomblogarithm.Iflog_cisset,thentheintegrationinthelongitudinaldirectionisreplaced
bytheCoulomblogarithm.Thustheparameternzisignored.
coupling Transversecouplingrate,rangingfrom0to1.
model ModelforIBSexpansionratecalculation:MartiniorBM.
Keywords Meaning
sample_number Numberofthesampleions.
force_formula Choosetheformulaforfrictionforcecalculation.NowonlysupporttheParkhomchuk
formul,usingforce_formula=PARKHOMCHUK.
section_ecool
section_simulation
Keywords Meaning
time Totaltimetosimulate,in[s].
step_number Totalnumberofsteps.Thetimeintervalofeachstepistime/step_number.
sample_number
Numberofthesampleions.TheparametermustbesetwhenusingtheParticle
modeltosimulatetheIBSexpansionprocesswithoutcooling.Whensettingthis
parameterwithcoolingeffect,the"sample_number"parameterinthe
"section_ecool"willbeoverwrittenbythisvalue.
ibs ChoosetosimulatetheIBSeffectornotbysettingthevalueas"true"or"false".
e_cool Choosetosimulatetheelectroncoolingeffectornotbysettingthevalueas"true"
or"false".
model "RMS"or"Particle"modeltochooseforthesimulation.
output_file Outputfilename
output_interval Theintervalofstepstowriteintotheoutputfile.Defaultisone.
save_particle_interval
Theintervalofstepstosavethe6Dcoordinatesoftheions.Nosavingifthe
valueislessthanzero.Defaultis1.ThisisonlyusefulwhenusingtheParticle
modelinsimulations.
ref_bet_x
TWISSparametersforthereferencepoint.Onlyneededwhenthe"modelbeam"
methodisselectedandtheelectroncoolingeffectisnotincludedinthe
simulation.
ref_bet_y Sameasabove.
ref_alf_x Sameasabove.
ref_alf_y Sameasabove.
ref_disp_x Sameasabove.
ref_disp_y Sameasabove.
ref_disp_dx Sameasabove.
ref_disp_dy Sameasabove.
fixed_bunch_length Maintainaconstantionbunchlength.Defaultisfalse.
section_run
Keywords Meaning
create_ion_beam Createtheionbeam.
create_ring Createthering.Mustcreatetheionbeambeforecallingthiscommand.
create_e_beam Createtheelectronbeam
create_cooler Createthecooler.
calculate_ibs CalculatetheIBSrateandoutputtothescreen.Mustcreatetheionbeamandthe
ringbeforecallingthiscommand.
calculate_ecool Calculatetheelectroncoolingrateandoutputtothescreen.Mustcreatetheion
beam,thering,theelectronbeam,andthecoolerbeforecallingthiscommand.
total_expansion_rate
Calculatethetotalexpansionrate(summationoftheibsrateandelectroncooling
rate)andoutputtothescreen.Mustcreatetheionbeam,thering,theelectron
beam,andthecoolerbeforecallingthiscommand.
run_simulation SimulatetheevolutionoftheionbeamunderIBSand/orelectroncoolingeffect(s).
Example
Inthefollowingexample,aDCelectroncoolerandabunchedprotonbeamisdefined.TheIBSrateandthe
electroncoolingratearecalculated.ThentheevolutionoftheprotonbeamunderboththeIBSeffectandthe
electroncoolingeffectissimulatedfor600seconds.
section_ion    #Definetheion(proton)beam
charge_number=1 #Chargenumber
mass=938.272  #Massoftheion
 kinetic_energy=8000 #Kineticenergy
norm_emit_x=2.2e‐6 #Normalizedemittanceinhorizontaldirection
norm_emit_y=2.2e‐6 #Normalizedemittanceinvertialdirection
 momentum_spread=0.0006 #Momentumspread
particle_number=6.58e11 #Totalionnumber(perbunch)
rms_bunch_length=7  #Rmsbunchlengthofthebunchedionbeam
section_ring        #Definethering
lattice=MEICColliderRedesign1IP.tfs #filethatsavesthelatticeofthering
section_ibs#definetheargumentsforIBScalculation
 nu=100  #GridnumberinhorizontaldirectionforIBSintegration
 nv=100  #GridnumberinvertialdirecitonforIBSintegration
 nz=40  #GridnumberinlongitudinaldirectionforIBSintegration
log_c=20.6 #DefineCoulomblogrithm.nzisignoredafterlog_cisdefined.
coupling=0 #Nocoupling
section_cooler    #Definethecooler
length=3.4  #Coolerlength
section_number=1  #Numberofcoolers
magnetic_field=0.039 #Magneticfield
 bet_x=10    #Twissparameteratthecooler
 bet_y=10
 #disp_x=0    #Ifthevaluesarezero,thecommandcanbe
omitted.
 #disp_y=0
 #alpha_x=0
 #alpha_y=0
 #disp_dx=0
 #disp_dy=0
section_scratch   #Ascratchsection
 m=938.272    #Definevariablemandassignavalue.
 ke=8000    #Definevariablekeandassignavalue.
 gamma=ke/m+1  #Definevariablegammaandcalculateitsvalue.
section_e_beam    #Definetheelectronbeam
gamma=gamma  #Lorentzfactor,theright"gamma"isthevariabledefine
above.
tmp_tr=0.1  #Transversetemperature
tmp_l=0.01  #Longitudinaltemperature
shape=dc_uniform  #Shapeoftheelectronbeam,DCbeamwithuniformcharge
density
radius=0.004  #RadiusoftheDCelectronbeam
 current=2    #Currentis2A
section_ecool      #Setparametersforelectroncoolingrate
calculation
 sample_number=10000   #Numberofionsamples
force_formula=PARKHOMCHUK  #Formulaforfrictionforcecalculation
section_run      #Operationsection
 create_ion_beam
 create_ring
 calculate_ibs    #CalculatetheIBSrate
 create_e_beam
 create_cooler
1.Theauthorintendedtowritethisexpressioninthiswayinordertoemphasizethedifferencebetweenascratchvariableandakeyword.However,this
expressionmaybeconfusing.Soitisnotrecommendedtousescratchvariableswiththesamenameofakeyword.
 calculate_ecool   #Calculatetheelectroncoolingrate
total_expansion_rate  #Calculatethetotalrate=IBSrate+electroncooling
rate
section_simulation       #Setparametersfor
simulation
 ibs=on        #SimulateISB
effect
 e_cool=on        #Simulate
electroncoolingeffect
 time=600        #Timetosimulate
 step_number=600      #Numberofsteps
 sample_number=100000     #Numberofionsamples
#save_particle_interval=100  #Savethecoordinatesoftheionsevery
100steps
output_file=simulation_test.txt  #Filetosavethesimulationresults
 model=particle      #Selectthemodelusedin
thesimulation
section_run      #Operationsection
 run_simulation    #Startsimulation
Page 1 of 12 - JSPEC User Manual
Page 2 of 12 - JSPEC User Manual
Page 3 of 12 - JSPEC User Manual
Page 4 of 12 - JSPEC User Manual
Page 5 of 12 - JSPEC User Manual
Page 6 of 12 - JSPEC User Manual
Page 7 of 12 - JSPEC User Manual
Page 8 of 12 - JSPEC User Manual
Page 9 of 12 - JSPEC User Manual
Page 10 of 12 - JSPEC User Manual
Page 11 of 12 - JSPEC User Manual
Page 12 of 12 - JSPEC User Manual

Navigation menu