0001 function [Zmomcoef] = momentumcoefbuilder_dke_yp(gridDKE,mksa)
0002
0003
0004
0005
0006
0007 [qe,me,mp,mn,e0,mu0,re,mc2,clum,alpha] = pc_dke_yp;
0008
0009 z = mksa.betath_ref*gridDKE.pn;
0010 z2 = z.*z;
0011 z3 = z2.*z;
0012 zm = mksa.betath_ref*gridDKE.pnm;
0013 z2m = zm.*zm;
0014 zp = mksa.betath_ref*gridDKE.pnp;
0015 z2p = zp.*zp;
0016 xz = z'*ones(1,length(z));
0017 xz2 = xz.*xz;
0018 xz3 = xz2.*xz;
0019
0020 gamma = sqrt(1 + z2);
0021 gamma2 = gamma.*gamma;
0022 gammam = sqrt(1 + z2m);
0023 gamma2m = gammam.*gammam;
0024 gammap = sqrt(1 + z2p);
0025 gamma2p = gammap.*gammap;
0026 xgamma = gamma'*ones(1,length(gamma));
0027 xgamma2 = xgamma.*xgamma;
0028 Xgamma = gamma'*ones(1,gridDKE.nmhu);
0029 XXgamma = repmat(Xgamma,[1,1,gridDKE.nr]);
0030 Xgammam = gammam'*ones(1,gridDKE.nmhu);
0031 XXgammam = repmat(Xgammam,[1,1,gridDKE.nr]);
0032 Xgammap = gammap'*ones(1,gridDKE.nmhu);
0033 XXgammap = repmat(Xgammap,[1,1,gridDKE.nr]);
0034
0035 gammamm = [1,gamma(1:gridDKE.npn-1)];
0036 gammapp = [gamma(2:gridDKE.npn),gamma(gridDKE.npn)];
0037 Xgammamm = gammamm'*ones(1,gridDKE.nmhu);
0038 Xgammapp = gammapp'*ones(1,gridDKE.nmhu);
0039 XXgammamm = repmat(Xgammamm,[1,1,gridDKE.nr]);
0040 XXgammapp = repmat(Xgammapp,[1,1,gridDKE.nr]);
0041
0042 sigma = asinh(z);
0043 sigmam = asinh(zm);
0044 sigmap = asinh(zp);
0045 xsigma = sigma'*ones(1,length(sigma));
0046
0047 J1 = -3*gamma + sigma.*(3.0./z + 2*z);
0048 J2 = gamma - sigma./z -2*gamma.*z2/3;
0049 J3 = -3*gamma.*sigma./z2 + 3.0./z + z - 2*z2.*z/5;
0050 J4 = gamma.*sigma.*(15.0./z2 + 6) - 15.0./z - 11*z;
0051 xJ1 = -3*xgamma + xsigma.*(3.0./xz + 2*xz);
0052 xJ2 = xgamma - xsigma./xz - 2*xgamma.*xz2/3;
0053 xJ3 = -3*xgamma.*xsigma./xz2 + 3.0./xz + xz - 2*xz2.*xz/5;
0054 xJ4 = xgamma.*xsigma.*(15.0./xz2 + 6) - 15.0./xz - 11*xz;
0055
0056 v = gridDKE.pn./gamma;
0057 v2 = v.*v;
0058 vm = gridDKE.pnm./gammam;
0059 v2m = vm.*vm;
0060 vp = gridDKE.pnp./gammap;
0061 v2p = vp.*vp;
0062 xv = v'*ones(1,length(v));
0063 xv2 = xv.*xv;
0064 Xv = v'*ones(1,gridDKE.nmhu);
0065
0066
0067
0068 Zmomcoef.z = z;
0069 Zmomcoef.z2 = z2;
0070 Zmomcoef.z3 = z3;
0071 Zmomcoef.zm = zm;
0072 Zmomcoef.z2m = z2m;
0073 Zmomcoef.zp = zp;
0074 Zmomcoef.z2p = z2p;
0075 Zmomcoef.xz = xz;
0076 Zmomcoef.xz2 = xz2;
0077 Zmomcoef.xz3 = xz3;
0078
0079 Zmomcoef.gamma = gamma;
0080 Zmomcoef.gamma2 = gamma2;
0081 Zmomcoef.gammam = gammam;
0082 Zmomcoef.gamma2m = gamma2m;
0083 Zmomcoef.gammap = gammap;
0084 Zmomcoef.gamma2p = gamma2p;
0085 Zmomcoef.xgamma = xgamma;
0086 Zmomcoef.xgamma2 = xgamma2;
0087 Zmomcoef.Xgamma = Xgamma;
0088 Zmomcoef.XXgamma = XXgamma;
0089 Zmomcoef.Xgammam = Xgammam;
0090 Zmomcoef.XXgammam = XXgammam;
0091 Zmomcoef.Xgammap = Xgammap;
0092 Zmomcoef.XXgammap = XXgammap;
0093
0094 Zmomcoef.gammamm = gammamm;
0095 Zmomcoef.gammapp = gammapp;
0096 Zmomcoef.Xgammamm = Xgammamm;
0097 Zmomcoef.Xgammapp = Xgammapp;
0098 Zmomcoef.XXgammamm = XXgammamm;
0099 Zmomcoef.XXgammapp = XXgammapp;
0100
0101 Zmomcoef.sigma = sigma;
0102 Zmomcoef.sigmam = sigmam;
0103 Zmomcoef.sigmap = sigmap;
0104 Zmomcoef.xsigma = xsigma;
0105
0106 Zmomcoef.J1 = J1;
0107 Zmomcoef.J2 = J2;
0108 Zmomcoef.J3 = J3;
0109 Zmomcoef.J4 = J4;
0110 Zmomcoef.xJ1 = xJ1;
0111 Zmomcoef.xJ2 = xJ2;
0112 Zmomcoef.xJ3 = xJ3;
0113 Zmomcoef.xJ4 = xJ4;
0114
0115 Zmomcoef.v = v;
0116 Zmomcoef.v2 = v2;
0117 Zmomcoef.vm = vm;
0118 Zmomcoef.v2m = v2m;
0119 Zmomcoef.vp = vp;
0120 Zmomcoef.v2p = v2p;
0121 Zmomcoef.xv = xv;
0122 Zmomcoef.xv2 = xv2;
0123 Zmomcoef.Xv = Xv;
0124
0125 Zmomcoef.Xpnpar = gridDKE.Xpn.*gridDKE.Xmhu;
0126 Zmomcoef.Xpnperp2 = gridDKE.Xpn2 - Zmomcoef.Xpnpar.*Zmomcoef.Xpnpar;
0127 Zmomcoef.Xvpar = (v'*ones(1,gridDKE.nmhu)).*(ones(length(v),1)*gridDKE.mhu);
0128
0129 Zmomcoef.Ec_ref = mc2*(sqrt(1 + gridDKE.pn.*gridDKE.pn*mksa.betath_ref^2) - 1);
0130 Ec_ref_S = mc2*(sqrt(1 + gridDKE.pn_S.*gridDKE.pn_S*mksa.betath_ref^2) - 1);
0131 Zmomcoef.dEc_ref = diff(Ec_ref_S);
0132
0133