0001 function [xpsin_out_ft,xMNperp_ft,xM3eps_pmz_ft,xpsin_out_ht,xMNperp_ht,xM3eps_pmz_ht,xM3Pflow_xyz_ht,xMPabs_at,xM3Pflow_pmz_ht] = ...
0002 disp_jd(xpsin,xB,xTe,xne,xNpar,omega,knr,nrt_nr,nrt_fr,kflag,GNperp,nn_nr,tol_ht,nd_ht);
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
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 if nargin < 14
0044 nd_ht = 11;
0045 end
0046 if nargin < 13
0047 tol_ht = 0.2;
0048 end
0049
0050 exename = 'R2D2f.exe';
0051
0052 pathname = getpath_jd(exename);
0053
0054 root1 = [];
0055 vect = [];
0056
0057 wd = cd;
0058 cd(pathname);
0059
0060 while (isempty(root1) | isempty (vect)) & tol_ht < 1
0061
0062
0063 [root_c,root_nr,root_r] = ...
0064 disp_new(xpsin,xB,xTe,xne,xNpar,omega,knr,nrt_nr,nrt_fr,kflag,GNperp,nn_nr,tol_ht,nd_ht);
0065
0066
0067
0068 if knr == 1
0069 pf = [];
0070 load pf.m -ascii
0071 root1 = root_nr;
0072
0073
0074
0075 vect = pf;
0076 else
0077 pfr = [];
0078 load pfr.m -ascii
0079 root1 = root_nr;
0080
0081
0082
0083 vect = pfr;
0084 end
0085 tol_ht = tol_ht*1.2;
0086 end
0087 if isempty(root1)
0088 error('The ft root was not found')
0089 elseif isempty(vect)
0090 error('The ht root was not found')
0091 end
0092
0093 [nr_ft,nn] = size(root1);
0094
0095 xpsin_out_ft = root1(:,1)';
0096
0097
0098
0099
0100
0101
0102
0103 xMNperp_ft = root1;
0104
0105 if knr == 0
0106 pr = [];
0107 load pr.m -ascii
0108 difu = pr;
0109 else
0110 pn = [];
0111 load pn.m -ascii
0112 difu = pn;
0113 end
0114
0115 nd_ft = size(difu,1);
0116
0117
0118 for in = 1:nn
0119 xMepsp_re_ft(:,in) = difu(in:nn:nd_ft,4);
0120 xMepsp_im_ft(:,in) = difu(in:nn:nd_ft,5);
0121 xMepsm_re_ft(:,in) = difu(in:nn:nd_ft,6);
0122 xMepsm_im_ft(:,in) = difu(in:nn:nd_ft,7);
0123 xMepsz_re_ft(:,in) = difu(in:nn:nd_ft,8);
0124 xMepsz_im_ft(:,in) = difu(in:nn:nd_ft,9);
0125 end
0126
0127 xMepsp_abs_ft = abs(xMepsp_re_ft + i*xMepsp_im_ft);
0128 xMepsm_abs_ft = abs(xMepsm_re_ft + i*xMepsm_im_ft);
0129 xMepsz_abs_ft = abs(xMepsz_re_ft + i*xMepsz_im_ft);
0130
0131 xMeps_norm_ft = sqrt(xMepsp_abs_ft.^2 + xMepsm_abs_ft.^2 + xMepsz_abs_ft.^2);
0132
0133 xMepsp_norm_ft = (xMepsp_re_ft + i*xMepsp_im_ft)./xMeps_norm_ft;
0134 xMepsm_norm_ft = (xMepsm_re_ft + i*xMepsm_im_ft)./xMeps_norm_ft;
0135 xMepsz_norm_ft = (xMepsz_re_ft + i*xMepsz_im_ft)./xMeps_norm_ft;
0136
0137 xM3eps_pmz_ft = zeros(nr_ft,nn,3);
0138
0139 xM3eps_pmz_ft(:,:,1) = xMepsp_norm_ft;
0140 xM3eps_pmz_ft(:,:,2) = xMepsm_norm_ft;
0141 xM3eps_pmz_ft(:,:,3) = xMepsz_norm_ft;
0142
0143 np_ht = size(vect,1);
0144
0145 xpsin_out_ht = vect(1:nn:np_ht,1)';
0146 nr_ht = length(xpsin_out_ht);
0147
0148 for in = 1:nn
0149 xMNperp_re_ht(:,in) = vect(in:nn:np_ht,2);
0150 xMNperp_im_ht(:,in) = vect(in:nn:np_ht,3);
0151 xMPflow_re_ht_x(:,in) = vect(in:nn:np_ht,4);
0152 xMPflow_im_ht_x(:,in) = vect(in:nn:np_ht,5);
0153 xMPflow_re_ht_y(:,in) = vect(in:nn:np_ht,6);
0154 xMPflow_im_ht_y(:,in) = vect(in:nn:np_ht,7);
0155 xMPflow_re_ht_z(:,in) = vect(in:nn:np_ht,8);
0156 xMPflow_im_ht_z(:,in) = vect(in:nn:np_ht,9);
0157 xMPabs_re_at_x(:,in) = vect(in:nn:np_ht,10);
0158 xMPabs_im_at_x(:,in) = vect(in:nn:np_ht,11);
0159 xMepsx_re_ht(:,in) = vect(in:nn:np_ht,12);
0160 xMepsx_im_ht(:,in) = vect(in:nn:np_ht,13);
0161 xMepsy_re_ht(:,in) = vect(in:nn:np_ht,14);
0162 xMepsy_im_ht(:,in) = vect(in:nn:np_ht,15);
0163 xMepsz_re_ht(:,in) = vect(in:nn:np_ht,16);
0164 xMepsz_im_ht(:,in) = vect(in:nn:np_ht,17);
0165 end
0166
0167 xMNperp_ht = xMNperp_re_ht + i*xMNperp_im_ht;
0168
0169 xMPflow_ht_x = xMPflow_re_ht_x + i*xMPflow_im_ht_x;
0170 xMPflow_ht_y = xMPflow_re_ht_y + i*xMPflow_im_ht_y;
0171 xMPflow_ht_z = xMPflow_re_ht_z + i*xMPflow_im_ht_z;
0172 xMPabs_at_x = xMPabs_re_at_x + i*xMPabs_im_at_x;
0173
0174 xMepsx_abs_ht = abs(xMepsx_re_ht + i*xMepsx_im_ht);
0175 xMepsy_abs_ht = abs(xMepsy_re_ht + i*xMepsy_im_ht);
0176 xMepsz_abs_ht = abs(xMepsz_re_ht + i*xMepsz_im_ht);
0177
0178 xMeps_norm_ht = sqrt(xMepsx_abs_ht.^2 + xMepsy_abs_ht.^2 + xMepsz_abs_ht.^2);
0179
0180 xMepsx_norm_ht = (xMepsx_re_ht + i*xMepsx_im_ht)./xMeps_norm_ht;
0181 xMepsy_norm_ht = (xMepsy_re_ht + i*xMepsy_im_ht)./xMeps_norm_ht;
0182 xMepsz_norm_ht = (xMepsz_re_ht + i*xMepsz_im_ht)./xMeps_norm_ht;
0183
0184 xMepsp_norm_ht = (xMepsx_norm_ht + i*xMepsy_norm_ht)/sqrt(2);
0185 xMepsm_norm_ht = (xMepsx_norm_ht - i*xMepsy_norm_ht)/sqrt(2);
0186
0187 xM3eps_pmz_ht = zeros(nr_ht,nn,3);
0188
0189 xM3eps_pmz_ht(:,:,1) = xMepsp_norm_ht;
0190 xM3eps_pmz_ht(:,:,2) = xMepsm_norm_ht;
0191 xM3eps_pmz_ht(:,:,3) = xMepsz_norm_ht;
0192
0193 xM3Pflow_xyz_ht(:,:,1) = xMPflow_ht_x.*abs(xMepsx_norm_ht).^2;
0194 xM3Pflow_xyz_ht(:,:,2) = xMPflow_ht_y.*abs(xMepsx_norm_ht).^2;
0195 xM3Pflow_xyz_ht(:,:,3) = xMPflow_ht_z.*abs(xMepsx_norm_ht).^2;
0196
0197 xM3Pflow_pmz_ht = zeros(nr_ht,nn,3);
0198
0199 xM3Pflow_pmz_ht(:,:,1) = (xM3Pflow_xyz_ht(:,:,1) + i*xM3Pflow_xyz_ht(:,:,2))/sqrt(2);
0200 xM3Pflow_pmz_ht(:,:,2) = (xM3Pflow_xyz_ht(:,:,1) - i*xM3Pflow_xyz_ht(:,:,2))/sqrt(2);
0201 xM3Pflow_pmz_ht(:,:,3) = xM3Pflow_xyz_ht(:,:,3);
0202
0203 xMPabs_at = xMPabs_at_x.*abs(xMepsx_norm_ht).^2;
0204
0205 cd(wd);