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 ) definitionpages 1.. 2 theorypages 3.. 5 examplespages 6...

Similar presentations


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

1 function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definitionpages theorypages examplespages 6...

2 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 with Kern = function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definition

3 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)] 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 ) definition “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 finite or infinite undulator “1” for 1D-beam, “2” for transverse averaging 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 geometry trajectory observer with relative to observer tangential trajectory (depends on observer) theory

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

6 kernel 2, technical aspect with kernels kernel 4 theory

7 examples % FFT CONVOLUTION 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); end nc1h=max(nc1,nc1in); nc2h=min(nc2,nc2in); cc(1-nc1in+(nc1h:nc2h))=c(1-nc1+(nc1h:nc2h)); c=cc; nc1=nc1in; nc2=nc2in; end end 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); example 1 figure 1

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

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

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

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


Download ppt "Function [ Kern ] = kern_undulator( xy_param,z_param,du,nu1,nu2,gamma,lambda_u,K ) definitionpages 1.. 2 theorypages 3.. 5 examplespages 6..."

Similar presentations


Ads by Google