Linking elements
Posted: 01 Aug 2008, 16:10
Any time I alter MBX1E02.ANGLE, I want MBW1E0?.ANGLE = MBX1E02.ANGLE * -.5
I thought I had set up the link_elements and alter_elements commands correctly, but when I run DOG.ele and look at DOG.new, the angle for MBX1E02 has changed as expected, but the angles for MBW1E0? haven't changed. What Am I doing wrong? Thanks
DOG.ele
&run_setup
lattice="DOG.lte",
use_beamline="DOG",
p_central_mev=444.999706595186,
final="%s.fin"
parameters="%s.parms"
centroid="%s.cen"
sigma="%s.sig"
&end
&twiss_output
filename="%s.twi",
matched=0,radiation_integrals=1,
beta_x=1.353736269767569e+01, alpha_x=-8.175905502777217e-01,
beta_y=3.508702734979261e+01, alpha_y=6.216759265147694e-01
&end
&run_control n_steps=1
&end
&alter_elements
name=MBX1E02,
item = ANGLE,
value = 2
&end
&link_elements
target = MBW1E01,
item = ANGLE,
source = MBX1E02,
equation = ".5 *"
&end
&save_lattice
filename = "%s.new"
&end
&floor_coordinates
filename="%s.flr",
X0 = 8.059999999999999e+01,
Y0 = 1.999997326307599e+00,
Z0 = 1.521585078431476e+02,
theta0 = 0.00
&end
&bunched_beam
n_particles_per_bunch=1,
emit_x=6.2e-9, emit_y=6.2e-9,
beta_x=1.353736269767569e+01, alpha_x=-8.175905502777217e-01,
beta_y=3.508702734979261e+01, alpha_y=6.216759265147694e-01
sigma_dp=0,sigma_s=0,
distribution_type[0] = 3*"gaussian",
distribution_cutoff[0] = 3*3,
enforce_rms_values[0]=1,1,1
&end
&track
&end
DOG.lte
D121: DRIFT, L=0.4803
MBW1E01: SBEND, L=0.500137, ANGLE=-0.0405309085544383, K1=0 &
, TILT=-0 &
, E1=-0, HGAP=0, FINT=0.5, &
E2=-0.0405309085544383, EDGE_ORDER=1
D122: DRIFT, L=5.75472
MBX1E02: SBEND, L=1.00027, ANGLE=0.0810616425759514, K1=0 &
, TILT=-0 &
, E1=0.0405309085544383, HGAP=0, FINT=0.5, &
E2=0.0405309085544383, EDGE_ORDER=1
MBW1E03: SBEND, L=0.500137, ANGLE=-0.0405309085544383, K1=0 &
, TILT=-0 &
, E1=-0.0405309085544383, HGAP=0, FINT=0.5, &
E2=-0, EDGE_ORDER=1
D123: DRIFT, L=0.525003
DOG: LINE=(D121, MBW1E01, D122, MBX1E02, D122, MBW1E03, D123)
I thought I had set up the link_elements and alter_elements commands correctly, but when I run DOG.ele and look at DOG.new, the angle for MBX1E02 has changed as expected, but the angles for MBW1E0? haven't changed. What Am I doing wrong? Thanks
DOG.ele
&run_setup
lattice="DOG.lte",
use_beamline="DOG",
p_central_mev=444.999706595186,
final="%s.fin"
parameters="%s.parms"
centroid="%s.cen"
sigma="%s.sig"
&end
&twiss_output
filename="%s.twi",
matched=0,radiation_integrals=1,
beta_x=1.353736269767569e+01, alpha_x=-8.175905502777217e-01,
beta_y=3.508702734979261e+01, alpha_y=6.216759265147694e-01
&end
&run_control n_steps=1
&end
&alter_elements
name=MBX1E02,
item = ANGLE,
value = 2
&end
&link_elements
target = MBW1E01,
item = ANGLE,
source = MBX1E02,
equation = ".5 *"
&end
&save_lattice
filename = "%s.new"
&end
&floor_coordinates
filename="%s.flr",
X0 = 8.059999999999999e+01,
Y0 = 1.999997326307599e+00,
Z0 = 1.521585078431476e+02,
theta0 = 0.00
&end
&bunched_beam
n_particles_per_bunch=1,
emit_x=6.2e-9, emit_y=6.2e-9,
beta_x=1.353736269767569e+01, alpha_x=-8.175905502777217e-01,
beta_y=3.508702734979261e+01, alpha_y=6.216759265147694e-01
sigma_dp=0,sigma_s=0,
distribution_type[0] = 3*"gaussian",
distribution_cutoff[0] = 3*3,
enforce_rms_values[0]=1,1,1
&end
&track
&end
DOG.lte
D121: DRIFT, L=0.4803
MBW1E01: SBEND, L=0.500137, ANGLE=-0.0405309085544383, K1=0 &
, TILT=-0 &
, E1=-0, HGAP=0, FINT=0.5, &
E2=-0.0405309085544383, EDGE_ORDER=1
D122: DRIFT, L=5.75472
MBX1E02: SBEND, L=1.00027, ANGLE=0.0810616425759514, K1=0 &
, TILT=-0 &
, E1=0.0405309085544383, HGAP=0, FINT=0.5, &
E2=0.0405309085544383, EDGE_ORDER=1
MBW1E03: SBEND, L=0.500137, ANGLE=-0.0405309085544383, K1=0 &
, TILT=-0 &
, E1=-0.0405309085544383, HGAP=0, FINT=0.5, &
E2=-0, EDGE_ORDER=1
D123: DRIFT, L=0.525003
DOG: LINE=(D121, MBW1E01, D122, MBX1E02, D122, MBW1E03, D123)