Skip to content

Commit

Permalink
Updated test and reverted rotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpersson committed Feb 19, 2021
1 parent 33c946a commit 2d36bee
Show file tree
Hide file tree
Showing 4 changed files with 517 additions and 677 deletions.
46 changes: 23 additions & 23 deletions src/twiss.f90
Expand Up @@ -6721,23 +6721,23 @@ SUBROUTINE tmxrot(ftrk,orbit,fmap,ek,re,te)
if (angle .eq. 0) return

angle = angle * node_value('other_bv ')
al_errors(4) = -angle
!al_errors(4) = -angle
!---- Kick.
!ca = cos(angle)
!sa = sin(angle)
!ta = tan(angle)
ca = cos(angle)
sa = sin(angle)
ta = tan(angle)

!ek(4) = sa
ek(4) = sa

call tmali1(orbit,al_errors,beta,gamma,orbit,re)
!call tmali1(orbit,al_errors,beta,gamma,orbit,re)
!---- Transfer matrix.
!re(3,3) = 1/ca
!re(4,4) = ca
!re(4,6) = sa/beta
!re(5,3) = -ta/beta
re(3,3) = 1/ca
re(4,4) = ca
re(4,6) = sa/beta
re(5,3) = -ta/beta

!---- Track orbit.
!if (ftrk) call tmtrak(ek,re,te,orbit,orbit)
if (ftrk) call tmtrak(ek,re,te,orbit,orbit)

end SUBROUTINE tmxrot

Expand Down Expand Up @@ -6770,26 +6770,26 @@ SUBROUTINE tmyrot(ftrk,orbit,fmap,ek,re,te)
!---- Initialize.
angle = node_value('angle ')
if (angle .eq. 0) return
al_errors = 0d0
!al_errors = 0d0
angle = angle * node_value('other_bv ')
al_errors(5) = - angle
call tmali1(orbit,al_errors,beta,gamma,orbit,re)
!al_errors(5) = - angle
!call tmali1(orbit,al_errors,beta,gamma,orbit,re)

!---- Kick.
!ca = cos(angle)
!sa = sin(angle)
!ta = tan(angle)
ca = cos(angle)
sa = sin(angle)
ta = tan(angle)

!ek(2) = sa
ek(2) = sa

!---- Transfer matrix.
!re(1,1) = 1/ca
!re(2,2) = ca
!re(2,6) = sa/beta
!re(5,1) = -ta/beta
re(1,1) = 1/ca
re(2,2) = ca
re(2,6) = sa/beta
re(5,1) = -ta/beta

!---- Track orbit.
!if (ftrk) call tmtrak(ek,re,te,orbit,orbit)
if (ftrk) call tmtrak(ek,re,te,orbit,orbit)

end SUBROUTINE tmyrot

Expand Down
4 changes: 2 additions & 2 deletions tests/test-crabcavity/fodo.ptc
Expand Up @@ -84,8 +84,8 @@
@ PTCOMAX %le 0.0004634515107
@ TITLE %08s "no-title"
@ ORIGIN %16s "5.06.01 Linux 64"
@ DATE %08s "18/02/21"
@ TIME %08s "16.15.13"
@ DATE %08s "19/02/21"
@ TIME %08s "09.37.28"
* NAME S X Y PT T RE11 RE12 RE15 RE25 RE56
$ %s %le %le %le %le %le %le %le %le %le %le
"SEQ$START" 0 0 0 0 -0 1 0 0 0 0
Expand Down

0 comments on commit 2d36bee

Please sign in to comment.