Page 1 of 1

Cavity Phase

Posted: 26 Aug 2009, 07:02
by tennant
Hi,

I have a linac comprised of a number of cavities. I would like to vary the phase at which these are run. Is there a way I can define a single phase variable in the lattice file and change one number rather than many 10s of cavities individually?

Thanks,
chris

Re: Cavity Phase

Posted: 26 Aug 2009, 14:30
by michael_borland
Chris,

There are several ways to do this.

1. Inside the lattice file, define a variable and then use it in the element definitions
% 10.7 sto phase1
l1: rfca,phase="phase1",...
l2: rfca,phase="phase1"
etc.

2. Same as 1, but set the phase1 value in the elegant command file:
&rpn_expression expression = "10.1 sto phase1"

&run_setup ... &end

3. Use the alter_elements command from within the elegant command file
&run_setup ... &end

&alter_elements
name = L*, type=RFCA, item=PHASE, value=10.1
&end

--Michael