# Presentation: 219024

## Parmila Code Prescriptionsfor UsersH. Takeda

- Linac Design and Beam Dynamics Simulation code
- June 25-26,2001 SNS Mini Workshop

## Parmila Code Designs Linacs

- Designs DTL, CCDTL, CCL, and SC linacs
- The layout of cells (length) is determined along the acceleration
- Using the Transit time factor tables for
- 1. Middle Cell
- 2. End Cell
- 3. Cell adjacent to the long bore tube

## 	          Parmila Code 			Calculates Beam Dynamics

- The multi-particle simulation with space charge through linacs of DTL, CCDTL, CCL, SC, and pre-defined transport structure.
- The “Transport Structure” which normally connects the designed linac structures can be an independent structure.

## The Parmila Input file Building Blocks

- Global parameters: 				Input particle distribution. Starting energy, charge, rf frequency, etc.
- Linac “Structures”
- A linac type (DTL,CCL etc.) is a “Structure	“. 	       A linac type can straddled over “Structures”.  		 Up to 50 “Structures” can be in an input file.
- The Transit time factor tables-linear interpolation for  each cell.
- The linac design/beam dynamics commences with “begin”.

## “Structure” keyword:		

- “Structure” keyword:
- Parameters define a section of linac
- ;Structure id,Nlast,F0,Fsf,deltaphi
- Structure   4 48  402.5 402.5  0.
- Define the Linac type: DTL, CCL, SC1, SC2...     -CavityAmplitude, Phase ramping if needed.	         -Individual quad override settings if needed.            -Transit time factor tables.			         ( parameters for linac definition completes here.)   -Individual quad override settings for TR3D file.   -Cell range control of run

## At the junction of Structures, the ending energy as specified  by the ending cell (“Stop”, “Nlast in Structure” is automatically transferred. Also, in some situations, the quadrupole gradients are also transferred to the proceeding structure.

**The interpretations of Transit time factor tables:**
- The transit time factor tables for the SC linacs should be created for each beam particle velocity for a fixed geometrical beta (fixed cavity shape) cavity as designed by Superfish code.
- The transit time factor tables for the Room temperature structure (DTL, CCL, CCDTL) should be created for each geometrical beta (varying cavity shape). The particle beta and the geometrical beta must coincide.

## A DTL design:

- 	FODO type lattice, FFODDO type lattice
- 	The Quads can be ramped, The E0 and Design phase 	can be specified, with/without ramping.The length of 	cell is determined by synchronism condition 		  	internally.
-      Example:
-      DTL 1     -24 -25.0  3.658  0.000    3.658  0.  0. 3. -3.           	3.5   5    5   11   0.    1.25  0.  0.  0.  0			 	1 1 0 0 0   -25
- 	The part of design can be overridden by specific 		modifications: quads, phase etc.

## A CCL Design:

- 	The quadrupole lattice: FODO, or Doublet type
- 	The quadrupole placements: equal distance from last cell,
- 		gradually moved from the last cell.
- 	The quadrupole ramping, E0 and phase ramping available.
- 	Code assumes each cell is phase locked by a multiple of 180
- 	Degrees: The spacing between segments are determined
- 	by the code. The cell lengths are identical within each
- 	segment. Internally calculated.
- Example input
- ;ccl Wf,  Phid,  E0,  Ncav,Nbeta  B,  Lquad Quad     Quad     Quad  Lattice,Dds,Polarity
- ;                                         lamb                  Sequence Location entry Type
- ccl 145.0 -30.  3.06  8         2.5  2667.0  8.   1010        1               0      1

## The  SuperConducting Design:

- 	The SC structure can be an independently phase driven 		cavities. Some cavities may be phase locked together.        		The spacing or placement of cavities are specified 			as input. The SC cavity lengths are externally specified.    		The driving rf phase is calculated, and it accommodates the 		phasing requirement.
- Example:
- ;    Wf    Phi       Nlo Ncel LaTyp  Qentry BetS     DWseg  Nsq    Dseg  DqsS
- SC2 342.0  -20.5 1    6          2       0         0.5550  3.3633      3      51.00 175.445263

## The Algorithm for the Cell Lengths

- Acceleration through a gap is represented by
- A Gap transformation: Drift+Thin Lens+Drift
- Uses Transit time factor.
- Reference Particle must be synchronized with the rf wave.
- The Phase advance and the distance traveled by a particle:

- Determining the cell length requires iteration:

## Gap Transformation

**Gap Transformation**

## 1. Graded      cell design: DTL type etc.

-     For each half cell: ( in an iteration loop)

- 2. Symmetric cell design: CCDTL, CCL types:
- A reference particle is propagated through a symmetric unit (cavity,
- segment) multiple times (cavity or multiple cavities with the same
-     determines the cell length.)
- Assuming               as the cell length, we let a test particle
- propagate the entire unit. We record the phase correction, and
- velocities at the entry, and the exit at each cell.

## CCDTL Synchronism Example

- Gap

- In terms with length,

- Phase Correction term needs included:

## For multiple gaps, the synchronism condition is written as

- Solve for      ,

- Repeat the whole process in iteration, to calculate better

## The segment entry phase is set such that the average of phases at the center of each gap is equal to the design phase. This is done by a single particle dynamics.

- The distance between segment to segment           is adjusted such that the beam bunch enters the next segment at a correct phase. (The exit phase is normally slightly different from the entry phase.)

**Phases for Room Temperature linac**

## For the Superconducting structure, the average of phases at the center of gap in each rf driven cavities is made equal to the set phase (Note the large phase slip cell to cell.) Under other design, we can impose also the energy gain through the cavity is a set value--determines E0.

- For the Superconducting structure, the relative phase between rf driver phases for each SC cavity/segment is calculated and set such that when the particle enters the first cell in the next SC cavity, it arrives at a correct phase.

**Phases for Superconducting Linac**

## 		Particle Dynamics

- The Formalism is based on La’postolle prescription.
- Both the Transverse, and Longitudinal dynamics conforms to relativity.
**The relativistic Gap transformation for the phase ** (Prome term):

- Ignoring the           term, this is approximated as

## Correction for the Phase Discontinuity

- Gap Center

- 		Prome Term

- Gap Entry

- Gap Exit

## Slide 19

## The Energy gain across the Gap:

## r transformation for a gap

## For each transverse coordinate,

##  r’ transformation through a Gap

- In the parmila code, to conserve the emittance, the r’ term is represented by the inverse of coefficient from the r term.

-  **r’ transformation through a Gap**

## We use, the following equation to force the 

- We use, the following equation to force the
- emittance conservation by changing the second term.