0001 function [XXf,xnorm] = f3tempmodel(equilDKE,momentumDKE,lambda,pmin,Tfor,Tperp,Tback,Ecut,mode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 if nargin < 7
0030 error('Wrong number of input arguments in f3tempmodel');
0031 end
0032
0033 if nargin == 7,
0034 xnorm = [];
0035 mode = 0;
0036 end
0037
0038 Xpn = momentumDKE.pn'*ones(1,length(momentumDKE.mhu));
0039 Xmhu = ones(length(momentumDKE.pn),1)*momentumDKE.mhu;
0040 Xpperp2 = Xpn.*Xpn.*(1 - Xmhu.*Xmhu);
0041 Xppar = Xpn.*Xmhu;
0042 Xppar2 = Xppar.*Xppar;
0043
0044 Xmask = Xppar >= 0;
0045
0046 [qe,me,mp,mn,e0,mu0,re,mc2,clum,alpha] = pc_dke_yp;
0047
0048
0049
0050 T_ref = max(equilDKE.xTe);
0051 beta_ref = sqrt(T_ref/mc2);
0052
0053
0054
0055 Ten = equilDKE.xTe/T_ref;
0056 Tforn = repmat(Tfor,length(equilDKE.xTe),1)/T_ref;
0057 Tperpn = repmat(Tperp,length(equilDKE.xTe),1)/T_ref;
0058 Tbackn = repmat(Tback,length(equilDKE.xTe),1)/T_ref;
0059 Ecutn = repmat(Ecut,length(equilDKE.xTe),1)/mc2;
0060
0061 pmax = 1/beta_ref*sqrt((Ecutn+1).^2-1);
0062
0063 ZTen = shiftdim(repmat(Ten',[1,size(Xppar,1),size(Xppar,2)]),1);
0064 ZTforn = shiftdim(repmat(Tforn,[1,size(Xppar,1),size(Xppar,2)]),1);
0065 ZTperpn = shiftdim(repmat(Tperpn,[1,size(Xppar,1),size(Xppar,2),1]),1);
0066 ZTbackn = shiftdim(repmat(Tbackn,[1,size(Xppar,1),size(Xppar,2),1]),1);
0067 ZEcutn = shiftdim(repmat(Ecutn,[1,size(Xppar,1),size(Xppar,2)]),1);
0068
0069 Zpn = repmat(Xpn,[1,1,length(equilDKE.xTe)]);
0070 Zpperp2 = repmat(Xpperp2,[1,1,length(equilDKE.xTe)]);
0071 Zppar2 = repmat(Xppar2,[1,1,length(equilDKE.xTe)]);
0072
0073 Zpmax = shiftdim(repmat(pmax,[1,size(Xppar,1),size(Xppar,2)]),1);
0074 Zpmin = shiftdim(repmat(pmin,[1,size(Xppar,1),size(Xppar,2)]),1);
0075
0076 fMmask = (Zpn - Zpmin < 0).*(Zpn >= 0);
0077 f3Tmask = (Zpn - Zpmax <= 0).*(Zpn - Zpmin >= 0);
0078 Zmask = repmat(Xmask,[1,1,length(equilDKE.xTe)]);
0079
0080 Zgamma = sqrt(Zpn.*Zpn*beta_ref^2 + 1);
0081
0082
0083
0084 Zm = exp(-Zpn.*Zpn./((Zgamma + 1).*ZTen));
0085
0086
0087
0088 Zf_for = Zmask.*exp(-Zppar2./ZTforn/2).*exp(-Zpperp2./ZTperpn/2);
0089 Zf_back = (1-Zmask).*exp(-Zppar2./ZTbackn/2).*exp(-Zpperp2./ZTperpn/2);
0090 Zf = Zf_for + Zf_back;
0091
0092
0093
0094 alphaM = beta_ref^3*(4*pi*exp((Ten*beta_ref^2).^(-1))*4/3*gamma(3/2+1)/sqrt(pi).*besselk(2,(Ten*beta_ref^2).^(-1)).*(Ten*beta_ref^2)).^(-1);
0095 alpha3T = (sqrt(2*pi^3)*Tperpn.*(sqrt(Tforn)+sqrt(Tbackn))).^(-1);
0096 ZalphaM = shiftdim(repmat(alphaM',[1,size(Xppar,1),size(Xppar,2)]),1);
0097 Zalpha3T = shiftdim(repmat(alpha3T,[1,size(Xppar,1),size(Xppar,2)]),1);
0098
0099
0100
0101 dx = repmat(momentumDKE.dpn',[1,length(equilDKE.xTe)]);
0102 dxmhu = momentumDKE.dmhu;
0103
0104
0105
0106 fMnorm = alphaM'.*fnorm(fMmask.*Zm);
0107 f3Tnorm = alpha3T.*fnorm(f3Tmask.*Zf);
0108
0109
0110
0111 lambdaM = (1 - lambda)*fMnorm.^(-1);
0112 lambda3T = lambda*f3Tnorm.^(-1);
0113 ZlambdaM = shiftdim(repmat(lambdaM,[1,size(Xppar,1),size(Xppar,2)]),1);
0114 Zlambda3T = shiftdim(repmat(lambda3T,[1,size(Xppar,1),size(Xppar,2)]),1);
0115
0116
0117
0118 XXf = ZlambdaM.*ZalphaM.*Zm.*fMmask + Zlambda3T.*Zalpha3T.*Zf.*f3Tmask;
0119 xnorm = fnorm(XXf);
0120
0121
0122
0123 function y = fnorm(x)
0124 y = 2*pi*integral_dke_jd(ones(size(Xppar,1),1),dx.*integral_dke_jd(dxmhu,Zpn.*Zpn.*x,2),1);
0125 end
0126 end