Presentation is loading. Please wait.

Presentation is loading. Please wait.

Function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definition pages 1 .. 2 theory pages 3 .. 5 examples pages 6 ...

Similar presentations


Presentation on theme: "Function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definition pages 1 .. 2 theory pages 3 .. 5 examples pages 6 ..."— Presentation transcript:

1 function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K )
definition pages theory pages examples pages 6 ...

2 calculates kernel function for undulator trajectory for
definition function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) calculates kernel function for undulator trajectory for finite and infinite undulator, local or periode-averaged (only for infinite undulator), 1d beam or cross-section averaged mesh and usage: du = mesh step =  [nu1,nu2] = mesh range function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) with Kern =

3 gamma = relativistic factor for resonance energy
definition undulator: gamma = relativistic factor for resonance energy lambda_u = length of undulator period K = planar undulator parameter function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K )  photon wavelength transverse parameters: xy_param.type = 1 / 2 xy_param.off = [xoff,yoff] xy_param.cor = [cxx,cxy,cyy(,Nsigma,Nstep)] function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) “1” for 1D-beam, “2” for transverse averaging “1” for 1D-beam, “2” for transverse averaging only for 1D-beam: offset with respect to trajectory only for transverse averaging: cxx, cxy, cyy = transverse correlation, f.i. cxx=emittance*beta_x optional: Nsigma [3] = size of integration range (per direction) Nstep [13] = number of steps (per direction) of tr. integration longitudinal parameters: z_param.finite = true / false z_param.local = true / false z_param.Nav z_param.Z0_obs z_param.N_per function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) finite or infinite undulator true: calculate local wake false: calculate period averaged wake (only for infinite u.) number of points for period averaging longitudinal observer position relative to beginning of finite undulator or to point with maximal horizontal offset in infinite undulator number periods of finite undulator

4 theory geometry trajectory observer with relative to observer tangential trajectory (depends on observer)

5 theory kernels kernel 1 kernel 2 kernel 3 with
integral 1, substitution integral 2 kernel 3 substitution with

6 kernel 2, technical aspect
theory kernels kernel 2, technical aspect with with kernel 4

7 examples example 1 % FFT CONVOLUTION figure 1
function [ c,nc1,nc2 ] = conv_fft( a,b,na1,nb1,nc1in,nc2in ) P = numel(a); Q = numel(b); L = P + Q - 1; K = 2^nextpow2(L); c = ifft(fft(a, K) .* fft(b, K)); c = c(1:L); if nargin>2 nc1=na1+nb1; nc2=nc1+L-1; end if nargin>4 L_zeile=size(c,1)==1; if nargin==5, nc2in=nc2; end if L_zeile cc=zeros(1,nc2in-nc1in+1); else cc=zeros(nc2in-nc1in+1,1); nc1h=max(nc1,nc1in); nc2h=min(nc2,nc2in); cc(1-nc1in+(nc1h:nc2h))=c(1-nc1+(nc1h:nc2h)); c=cc; nc1=nc1in; nc2=nc2in; example 1 x_off=0.0001; y_off= ; sig=10.0E-6; q=0.01E-9; % UNDULATOR gamma=100; lambda_u=0.03; K=2.0; lambda_ph=lambda_u/(2*gamma^2)*(1+K^2/2); % MESH u_min=-sqrt(x_off^2+y_off^2); u_max=max(lambda_ph*30,8*sig); du=min(lambda_ph/10,sig/5); nu1=floor(u_min/du); nu2=ceil( u_max/du); % BUNCH n1=-round(4*sig/du); n2=round(4*sig/du); lam=q/sqrt(2*pi)/sig*exp(-0.5*((n1:n2)*du/sig).^2); % transverse parameters xy_param.type=1; xy_param.off=[x_off,y_off]; % longitudinal parameters Nav=250; z_param.finite=false; z_param.local=false; z_param.Nav=Nav; % KERNEL kern=kern_undulator(xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K); % CONVOLUTION wake=conv_fft(lam,kern,n1,nu1,n1,n2)*du; figure(1); plot((n1:n2)*du,wake); figure 1

8 examples for examples 2, 3 and 4: bunch 1: bunch 2:

9 example 2: FLASH, ORS undulator
examples example 2: FLASH, ORS undulator infinite undulator periodic wake Nav= 250 bunch 1 (0.5 nC), coarse du = 1 µm, fine du = 0.25 µm bunch 2 (0.1 nC, modulated), du = µm bunch 2 (0.1 nC, modulated), du = µm, Nsigma = 4, Nstep = 25 bunch 2 (0.1 nC, modulated), du = µm, (Nsigma = 3, Nstep = 13)

10 example 3: FLASH, SEEDING undulator
examples example 3: FLASH, SEEDING undulator infinite undulator periodic wake Nav= 250 bunch 1 (0.5 nC), coarse du = 1 µm, fine du = 0.25 µm bunch 2 (0.1 nC, modulated), du = µm bunch 2 (0.1 nC, modulated), du = µm, Nsigma = 4, Nstep = 25 bunch 2 (0.1 nC, modulated), du = µm, (Nsigma = 3, Nstep = 13)

11 example 4: FLASH, SASE undulator
examples example 4: FLASH, SASE undulator infinite undulator periodic wake Nav= 250 bunch 1 (0.5 nC), coarse du = 1 µm, fine du = 0.25 µm


Download ppt "Function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definition pages 1 .. 2 theory pages 3 .. 5 examples pages 6 ..."

Similar presentations


Ads by Google