next up previous contents
Next: ``Incorrectly'' fixing the problem Up: Tracking the beam sizes Previous: ``Correctly'': Routine extract_beam_sizes   Contents


``Incorrectly'': using lattice functions and Chao emittances

This piece of code is instructive: the lattice functions are only valid in the symplectic case and the Chao emittances, while better than Sands, are not accurate concepts for large damping. Therefore this code, when compared with the results of section 6.3.1, gives us a idea of the accuracy of the Chao synchrotron integrals formalism. (Usually extremely accurate unless the machine is on a linear coupling resonance!)

Equation

$\displaystyle \underbrace{\left\langle{{x}_{1}^{2}}\right\rangle}\limits_{{\tt ...
...({{A}_{15}^{2}+{A}_{16}^{2}}\right)}\limits_{{\tt bet(3)}}^{}{\varepsilon }_{3}$     (6.2)

appears as
sizes(1,1)=(bet(1)*nf%emittance(1)+bet(2)*nf%emittance(2)+bet(3)*nf%emittance(3)) 
in the following piece of software.

!!!!!!!!!!   Tracking a probe_8 to beam sizes around the ring using emittances  !!!!!!!!!!

 call kanalnummer(mf,"beam_xx_inf_using_emittances.dat")
 
 state=default0+radiation0+envelope0
 xs0=x     ! closed orbit intializing a probe
 m=nf%a_t  ! damapspin set to A
 xs=xs0+m  ! Probe_8 = closed orbit probe + Identity
 
  p=>als%start 

 bet(1)=(m%m%v(1).sub.'1')**2+(m%m%v(1).sub.'01')**2
 bet(2)=(m%m%v(1).sub.'001')**2+(m%m%v(1).sub.'0001')**2
 bet(3)=(m%m%v(1).sub.'00001')**2+(m%m%v(1).sub.'000001')**2
 sizes(1,1)=(bet(1)*nf%emittance(1)+bet(2)*nf%emittance(2)+bet(3)*nf%emittance(3)) 
 bet0=sizes(1,1)
 write(mf,*) p%mag%name, sizes(1,1)

do i=1,als%n
 call track_probe(als,xs,state,fibre1=i,fibre2=i+1) 
 m=xs
 bet(1)=(m%m%v(1).sub.'1')**2+(m%m%v(1).sub.'01')**2
 bet(2)=(m%m%v(1).sub.'001')**2+(m%m%v(1).sub.'0001')**2
 bet(3)=(m%m%v(1).sub.'00001')**2+(m%m%v(1).sub.'000001')**2
 sizes(1,1)=(bet(1)*nf%emittance(1)+bet(2)*nf%emittance(2)+bet(3)*nf%emittance(3)) 
 p=>p%next
 write(mf,*) p%mag%name, sizes(1,1)
enddo
 betf=sizes(1,1)
 write(mf,*) " log of change after one turn and damping "
 write(mf,*)  log(betf/bet0)/2.d0,nf%n%damping(1)
close(mf)
!!!!!!!!!!   Tracking a probe_8 to beam sizes around the ring using emittances  !!!!!!!!!!


Frank Schmidt 2010-10-15