[Go to BBS]
All articles in a thread
SubjectSAD Update. V1.0.10.5a. WakeFunction in TrackParticles.
Article No726
Date: 2009/08/13(Thu) 09:32:46
ContributorK. Oide
Dear Users,

1. The next version will support WakeFunction in TrackParticles. The usage of WakeFunction is same as before:

WakeFunction[Longitudinal, comp]={{z1, wl1}, ..., {zn, wln}};
WakeFunction[Transverse, comp]={{z1, wt1}, ..., {zn, wtn}};

specify logitudinal and transverse dipole wake functions at a component comp
(string). Each functions is a list of {z, w} where z is the distance (z>=0)
and w is the value of the wake, in the unit of either V/C or V/C/m.
The wake funcitons are applied at the componet comp, giving kicks to each
orbit whose initial conditions are give by InitialOrbits. The sufficient
number of orbits depends on the situation.
WakeFunction is valid only when TRPT and INS, and also either TWAKE or
LWAKE is ON.
For tracking, it is only valid in TrackParticles. If a wake is given by
the WAKE command to the same component, WakeFunction supersdes.

It is recommended to use WakeFunction instead of the WAKE command, as the former is more versatile.

SubjectRe: SAD Update. V1.0.10.5a. WakeFunction in TrackParticles.
Article No727
Date: 2009/08/20(Thu) 11:03:04
ContributorAkio Morita
1.0.10.4a - 1.0.10.5a間の変更で、src/tcav.fでループ内の定数項を
ループ外に括り出す refactoringらしきもの(Rev. 1.25 - 1.26)が
行われています。この変更では、変数fw0に拘束されている値は、
e*pbunch*anbunch/amass/np0ですが、ループ定数括り出し最適化で
あるなら、e*pbunch*anbunch/amass/p0であるべきだと思われます
(np0は、COMMONブロック内にある粒子数を示す変数)

commitlogに変更の意図(refactoring or bug-fix)が記述されていない&
コンポーネントレベルのRegression testが無いために断言出来ませんが、
enbugした可能性が高いと思います。

Index: src/tcav.f
===================================================================
RCS file: /SAD/cvsroot/oldsad/src/tcav.f,v
retrieving revision 1.25
retrieving revision 1.26
diff -d -u -r1.25 -r1.26
--- src/tcav.f12 Jul 2009 02:38:01 -00001.25
+++ src/tcav.f13 Aug 2009 00:25:01 -00001.26
@@ -16,7 +16,7 @@
      $     v20a,v11a,v02a,phis,r,wl,r1,ws1,we,wsn,phic,
      $     dphis,offset,offset1,tlim,sv,a,dpz,al1,h2,p2,
      $     dp2,pr2,dvn,dzn,dp1r,p1r,p1,h1,dp2r,p2r,av,dpx,fw,
-     $     alx,dpepe,xi,pxi,
+     $     alx,dpepe,xi,pxi,fw0,
      $     asinh,t,ph,dh,dpr,dpy,dp,dp1,pr1,pe,vcorr
       logical*4 fringe
       if(harm .eq. 0.d0)then
@@ -94,6 +94,7 @@
         call tcavfrin(np,x,px,y,py,z,g,dv,al,v,w,p0,h0,
      $     dphis,offset)
       endif
+      fw0=(e*pbunch*anbunch/amass)/np0
       sv=0.d0
       do 110 n=1,ndiv
         wsn=ws(n)
@@ -155,7 +156,7 @@
           z(i)=-t*p2r*p0/h2-dzn
 20      continue
         if(lwake .or. twake)then
-          fw=e*pbunch*anbunch/p0/amass*wsn
+          fw=fw0*wsn
           call txwake(np,x,px,y,py,z,g,dv,int(anbunch),
      $         fw,lwl,wakel,lwt,waket,p0,h0,itab,izs,n .eq. 1)
         endif

SubjectRe^2: SAD Update. V1.0.10.5a. WakeFunction in TrackParticles.
Article No728
Date: 2009/08/20(Thu) 11:04:32
ContributorAkio Morita
> 1.0.10.4a - 1.0.10.5a間の変更で、src/tcav.fでループ内の定数項を
正しくは、1.0.10.3.4a - 1.0.10.3.5aです