// test for betatron oscillation frequency calculation for PSI Ring cyclotron. // called by tuning.bash and work together with FIXPO EORBIT output data. // The require the distribution file two particles: first one is referenc particle, // and the other is off center particle with a dx and dz. as following: // 2 // 0.0 0.0 0.0 0.0 0.0 0.00 // 0.01 0.0 0.0 0.0 0.01 0.00 // When the totoal particle number equal to 2, SEO mode is triggered automatically, // navertheless of the existance of the cavity and other components. OPTION, ECHO= FALSE; OPTION, PSDUMPFREQ= 24500000; OPTION, SPTDUMPFREQ= 50; OPTION, PSDUMPEACHTURN= FALSE; OPTION, PSDUMPLOCALFRAME= FALSE; TITLE,STRING= "PSI Ring"; CALL,FILE= "data.dat"; // generated by the bash script Edes= energy/1000.0; //GeV r0 = r; //mm pr0 = pr/1000.0; //m_0*c f1= 50.65; gamma= (Edes+PMASS)/PMASS; beta= sqrt(1-(1/gamma^2)); gambet= gamma*beta; P0 = gamma*beta*PMASS; Ring: CYCLOTRON, TYPE="RING", CYHARMON=6, PHIINIT=0.0, PRINIT=pr0, RINIT=r0 , SYMMETRY=8.0, RFFREQ=f1, FMAPFN="bfield.dat",TCR1=4350, TCR2=4470, MBTC=14e-3,SLPTC=6.0; L1: LINE = (Ring); Dist1:DISTRIBUTION, DISTRIBUTION=FROMFILE, FNAME="dist1.dat"; Fs1:FIELDSOLVER, FSTYPE=NONE, MX=64, MY=64, MT=64, PARFFTX=true, PARFFTY=true, PARFFTT=false, BCFFTX=open, BCFFTY=open, BCFFTT=open; Beam1: BEAM, PARTICLE=PROTON, PC=P0, NPART=2, BCURRENT=1.0E-6, CHARGE=1.0, BFREQ= f1; SELECT, LINE=L1; TRACK, LINE=L1, BEAM= Beam1, MAXSTEPS= 720*100, STEPSPERTURN= 720; RUN, METHOD= "CYCLOTRON-T", BEAM= Beam1, FIELDSOLVER= Fs1, DISTRIBUTION= Dist1; ENDTRACK; STOP;