-
Notifications
You must be signed in to change notification settings - Fork 0
Superposition of Lattice Elements
Superposition is used when elements overlap spatially. In such a case Bmad creates slave elements that will be tracked through and lord elements that represent the individual elements.
To superimpose an element you need to specify where the element is placed. To do this, a reference position is specified and the superimposed element is placed at that position shifted by a specified offset.
beginning[beta_a] = 10. ! m a-mode beta function
beginning[beta_b] = 10. ! m b-mode beta function
beginning[e_tot] = 10e6 ! eV Or can set p0c
parameter[geometry] = open ! or closed
q: quadrupole, L = 1, k1 = 0.2
d: drift, L = 1
m1: marker, superimpose, ref = q, ref_origin = beginning, offset = 0.3
m2: marker, superimpose, ref = q, ref_origin = end, offset = 0.4
lat: line = (q, d) ! List of lattice elements
use, lat ! Line used to construct the lattice
Save the lattice to a file "superimpose.bmad" and run:
> tao -lat superimpose.bmad
Tao> show lat
Values at End of Element:
Index name key s l beta phi eta orbit beta phi eta orbit Track_State
a a a x [mm] b b b y [mm]
0 BEGINNING Beginning_Ele 0.000 --- 10.00 0.000 0.00 0.000 10.00 0.000 0.00 0.000 Alive
1 Q#1 Quadrupole 0.300 0.300 9.83 0.030 0.00 0.000 10.19 0.030 0.00 0.000 Alive
2 M1 Marker 0.300 0.000 9.83 0.030 0.00 0.000 10.19 0.030 0.00 0.000 Alive
3 Q#2 Quadrupole 1.000 0.700 8.22 0.107 0.00 0.000 12.24 0.094 0.00 0.000 Alive
4 D#1 Drift 1.400 0.400 6.97 0.160 0.00 0.000 14.24 0.124 0.00 0.000 Alive
5 M2 Marker 1.400 0.000 6.97 0.160 0.00 0.000 14.24 0.124 0.00 0.000 Alive
6 D#2 Drift 2.000 0.600 5.37 0.258 0.00 0.000 17.58 0.162 0.00 0.000 Alive
7 END Marker 2.000 0.000 5.37 0.258 0.00 0.000 17.58 0.162 0.00 0.000 Alive
Lord Elements:
8 Q Quadrupole 1.000 1.000 8.22 0.107 0.00 0.000 12.24 0.094 0.00 0.000 Alive
Index name key s l beta phi eta orbit beta phi eta orbit Track_State
a a a x [mm] b b b y [mm]
Values at End of Element:
The quadrupole Q has been split by marker M1. The two super_slave elements Q#1 and Q#2 will be used when tracking a particle through the lattice.
Tao> show ele Q#1
Element # 1
Element Name: Q#1
Key: Quadrupole
... etc...
Slave_status: Super_Slave
Associated Super_Lord(s):
Index Name Type
8 Q Quadrupole
Lord_status: Not_a_Lord
The Q super_lord element represents the actual quadrupole.
Tao> show ele Q
Element # 8
Element Name: Q
Key: Quadrupole
... etc...
Slave_status: Free
Lord_status: Super_Lord
Slaves:
Index Name Type
1 Q#1 Quadrupole
3 Q#2 Quadrupole
If parameters of element Q are modified, Bmad bookkeeping routines will automatically update the super_slaves.
Tao> change ele Q k1 0.11
Old New Old-Design New-Design Delta
0.200000 0.310000 0.110000 0.110000 0.110000 Q
Tao> show ele 1
Element # 1
Element Name: Q#1
Key: Quadrupole
S_start, S: 0.000000, 0.300000
Ref_time: 1.002001E-09
Attribute values [Only non-zero/non-default values shown]:
1 L = 3.0000000E-01 m
4 K1 = 3.1000000E-01 1/m^2
... etc...
Parameter values of the super_slave elements may not be directly set:
Tao> change ele Q#1 k1 0.01
[ERROR | 2017-AUG-28 22:38:36] tao_change_ele:
ATTRIBUTE NOT FREE TO VARY. NOTHING DONE
Notes:
- No super_lord element is made when a drift element is split. Thus in the above example, there is no D super_lord and the two elements D#1 and D#1 and not super_slaves.
A more complicated example involving superposition of an element with finite length:
beginning[beta_a] = 10. ! m a-mode beta function
beginning[beta_b] = 10. ! m b-mode beta function
beginning[e_tot] = 10e6 ! eV Or can set p0c
parameter[geometry] = open ! or closed
Q: quad, l = 4
D: drift, l = 12
S: solenoid, l = 8, superimpose, ref = Q, ele_origin = beginning
M: marker, superimpose, ref = S, offset = 1
lat: line = (Q, D)
use, lat
Save the lattice to a file "superimpose2.bmad" and run:
> tao -lat superimpose2.bmad
Tao> show lat
Values at End of Element:
Index name key s l beta phi eta orbit beta phi eta orbit Track_State
a a a x [mm] b b b y [mm]
0 BEGINNING Beginning_Ele 0.000 --- 10.00 0.000 0.00 0.000 10.00 0.000 0.00 0.000 Alive
1 Q#1 Quadrupole 2.000 2.000 10.40 0.197 0.00 0.000 10.40 0.197 0.00 0.000 Alive
2 Q\S Sol_Quad 4.000 2.000 11.60 0.381 0.00 0.000 11.60 0.381 0.00 0.000 Alive
3 S#1 Solenoid 7.000 3.000 14.90 0.611 0.00 0.000 14.90 0.611 0.00 0.000 Alive
4 M Marker 7.000 0.000 14.90 0.611 0.00 0.000 14.90 0.611 0.00 0.000 Alive
5 S#2 Solenoid 10.000 3.000 20.00 0.785 0.00 0.000 20.00 0.785 0.00 0.000 Alive
6 D#1 Drift 16.000 6.000 35.60 1.012 0.00 0.000 35.60 1.012 0.00 0.000 Alive
7 END Marker 16.000 0.000 35.60 1.012 0.00 0.000 35.60 1.012 0.00 0.000 Alive
Lord Elements:
8 Q Quadrupole 4.000 4.000 11.60 0.381 0.00 0.000 11.60 0.381 0.00 0.000 Alive
9 S Solenoid 10.000 8.000 20.00 0.785 0.00 0.000 20.00 0.785 0.00 0.000 Alive
Index name key s l beta phi eta orbit beta phi eta orbit Track_State
a a a x [mm] b b b y [mm]
Values at End of Element:
The Q\S super_slave element has both Q and S elements as super_lords
Tao> show ele q\s
Element # 2
Element Name: Q\S
... etc...
Slave_status: Super_Slave
Associated Super_Lord(s):
Index Name Type
8 Q Quadrupole
9 S Solenoid
Lord_status: Not_a_Lord
Notes:
- This superposition works since Bmad has a sol_quad element which is a combination solenoid/quadrupole. It is not possible to superimpose a quadrupole with a sextupole since Bmad does not have a combination quadrupole/sextupole element.
- With closed lattices, a superimposed element may "wrap" around so that part of the superimposed element is at the end of the lattice and part of the element is at the beginning of the lattice.