Page 1 of 1

using formulas in lattice files.

Posted: 22 Jul 2010, 09:18
by roblin
One feature that would be very useful is the ability to use formulas to define magnet settings directly in the lattice file.

I often do that when I design a chicane or other symmetric piece of beam line. I am aware we can use expressions in the command file but is it
possible in the lattice file?

Re: using formulas in lattice files.

Posted: 22 Jul 2010, 11:41
by roblin
never mind. I think I answered my own question. I can define the variable in the lattice file and write the expressions in the command file.

Re: using formulas in lattice files.

Posted: 22 Jul 2010, 12:51
by michael_borland
Yves,

You can also put expressions directly into the lattice file, e.g,.

! Define a rectangular bend for a ring with 80 equal bends
% pi 40 / sto myAngle
B1: SBEN,L=1.0,ANGLE=''myAngle'',E1=''myAngle 2 /'',E2=''myAngle 2 /''

-Michael