using formulas in lattice files.

Moderators: cyao, michael_borland

Post Reply
roblin
Posts: 7
Joined: 05 May 2010, 11:50

using formulas in lattice files.

Post by roblin » 22 Jul 2010, 09:18

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?

roblin
Posts: 7
Joined: 05 May 2010, 11:50

Re: using formulas in lattice files.

Post by roblin » 22 Jul 2010, 11:41

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.

michael_borland
Posts: 1796
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: using formulas in lattice files.

Post by michael_borland » 22 Jul 2010, 12:51

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

Post Reply