Skip to content

Edge focusing has wrong sign when bv=-1 and k0=0 #1237

@rdemaria

Description

@rdemaria

This simple example shows the problem.

b1: rbend, l=1,angle=0.1,k0:=bk0;

s1: sequence,l=1; b1,at=0.5; endsequence;
s2: sequence,l=1; b1,at=0.5; endsequence;

beam,sequence=s1,bv=1;
beam,sequence=s2,bv=-1;

bk0=0.1;
use,sequence=s1; twiss,betx=100,bety=100; value,table(twiss,b1,alfy);
use,sequence=s2; twiss,betx=100,bety=100; value,table(twiss,b1,alfy);

bk0=0.0;
use,sequence=s1; twiss,betx=100,bety=100; value,table(twiss,b1,alfy);
use,sequence=s2; twiss,betx=100,bety=100; value,table(twiss,b1,alfy);

The output shows:

table( twiss b1 alfy ) =       0.9833842228 ;
table( twiss b1 alfy ) =       0.9833842228 ;
table( twiss b1 alfy ) =       0.9833842228 ;
table( twiss b1 alfy ) =       -1.018409258 ;

The expected results is 0.9833842228 for the 4 cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions