[Go to BBS]
All articles in a thread
Subject3D Envelope Calculations with Space Charge
Article No44
Date: 2005/11/29(Tue) 11:29:59
ContributorC.K. Allen < >
The SAD development branch (ckallen2) containing 3D envelope simulation with space charge has now been merged with the main repository trunk so that these features are available to all users.

There is still some discrepency between Trace3D and the SAD simulations, primarily in the longitudinal direction. This difference is not large but is cumulative and can become significant for long beamlines. I am currently trying to determine the source of this discrepency.

The new features are located in the SAD Packages Scheff.n, TwissUtility.n, Trace3dToSadn., and MatrixFunctions.n. Also, a function EllipticRd(x,y,z) has been added to the compiled portion of SAD. This function is Carlson's elliptic intregral of the second kind given by Int[1/(t+x)^1/2(t+y)^1/2(t+z)^3/2]t=0->Inf.

And example of using the envelop simulation is given below.


!!========================================
!!
!! Initialize SAD
!!
!!========================================


FFS;

GetMAIN["~ckallen/J-Parc/linac/simdb-LI_L3BT01-nopmq0000.sad"];
L3BT01 = ExtractBeamLine["L3BT01all"];

USE L3BT01;
TRPT;
INS;
CAL;

NOCOD;
RFSW;


!
! TRACE3D Parameters
!

f = 324.0e6; ! RF frequency (Hz)

Er = 939.29432e6; ! particle rest energy (eV)
W = 181.0338e6; ! beam kinetic energy (eV)
XI = 30.0e-3 ! beam current (A)

vecTwissXt3d = {-0.44117, 5.774, 1.889};
vecTwissYt3d = {0.21808, 6.4229, 1.706};
vecTwissZt3d = {0.3095, 2.0888, 466.99};



!
! Compute SAD Parameters
!


Q = XI/f; ! beam bunch charge (C)


vecTwissX = TraceToSadTransTwiss[vecTwissXt3d];
vecTwissY = TraceToSadTransTwiss[vecTwissYt3d];
vecTwissZ = TraceToSadLongTwiss[f, Er, W, vecTwissZt3d];

!
! RUN SIMULATION
!

! Compute generalized perveance and initial moment matrix

K0 = ComputePerveance[f, Er, W, Q];
sig0 = CorrelationMatrix6D[vecTwissX, vecTwissY, vecTwissZ];


! Run simulation
!
! lstPos - list of each element entrance position
! lstGamma - list of the relativistic factor at each element entrace
! lstSig - list of beam matrices at each element position

{lstPos, lstGamma, lstSig} = ScheffSimulate[K0, sig0];

! Store results
SaveBeamMatrixData[strFileOut, lstPos, lstGamma, lstSig];

SubjectRe: 3D Envelope Calculations with Space Charge
Article No45
Date: 2005/11/29(Tue) 18:26:58
ContributorAkio Morita
This commit breaks following official MAIN trunk ports: Darwin, Linux