0001 function gkE = dresp_dke_yp(res,phf,kd,k)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 if nargin < 4,
0023 error('Wrong number of input arguments for dresp_dke_yp');
0024 end
0025
0026 [qe,me,mp,mn,e0,mu0,re,mc2,clum,alpha] = pc_dke_yp;
0027
0028 if min(size(k)) > 1,
0029 error('k must be a vector');
0030 end
0031 k = k(:);
0032 k = k';
0033 nk = length(k);
0034 deltak = k(2)-k(1);
0035 E = k;
0036
0037 gkE = zeros(nk,nk);
0038
0039 Rk = (interp1(kd,phf,k,'spline'))';
0040 dEk = (res(1)*k.^res(2)).*k;
0041 Ec = (2*k.^2)./(2*k+mc2);
0042 dEc = (res(1)*Ec.^res(2)).*Ec;
0043
0044 for i=1:nk,
0045 ic = max(find(E<=Ec(i)));
0046 if isempty(ic),ic = 0;end
0047
0048 if dEk(i)~=0,
0049 gkEph = Rk(i)*2*sqrt(log(2)/pi)*exp(-4*log(2)*(E - k(i)).^2/dEk(i)^2)/dEk(i);
0050 if ic==0,
0051 gkE(i,:) = gkEph;
0052 else
0053 E1 = E(1:ic);
0054 E2 = E(ic+1:nk);
0055 gkEco1 = (1 - Rk(i))/(0.5*dEc(i)/2/sqrt(log(2)/pi) + Ec(i))*ones(1,size(E1,2));
0056 gkEco2 = (1 - Rk(i))/(0.5*dEc(i)/2/sqrt(log(2)/pi) + Ec(i))*exp(-4*log(2)*(E2 - E2(1)).^2/dEc(i)^2);
0057 gkEco = [gkEco1,gkEco2];
0058 gkE(i,:) = gkEph + gkEco;
0059 end
0060 else
0061 gkEph0 = speye(i,nk);
0062 gkEph = Rk(i)*gkEph0/deltak;
0063 if ic==0,
0064 gkE(i,:) = gkEph;
0065 else
0066 E1 = E(1:ic);
0067 E2 = E(ic+1:nk);
0068 gkEco1 = ((1 - Rk(i))/Ec(i))*ones(1,size(E1,2));
0069 gkEco2 = 0.0*ones(1,size(E2,2));
0070 gkEco = [gkEco1,gkEco2];
0071 gkE(i,:) = gkEph + gkEco;
0072 end
0073 end
0074 end
0075
0076