fproc_fluctn_scan

PURPOSE ^

SYNOPSIS ^

function fproc_fluctn_scan(p_opt,id_equil,id_fluct,locid_simul,id_wave,sigmar_max,sigmar_hwhm,Nfluct,tn,dtn,Zfluct_ref)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fproc_fluctn_scan(p_opt,id_equil,id_fluct,locid_simul,id_wave,sigmar_max,sigmar_hwhm,Nfluct,tn,dtn,Zfluct_ref)
0002 %
0003 if length(Nfluct) > 1,
0004     scanlist = Nfluct;
0005     scanvar = 'Nfluct';
0006     xlab = 'N';
0007     logx = 1;
0008 elseif length(sigmar_max) > 1,
0009     scanlist = sigmar_max;
0010     scanvar = 'sigmar_max';
0011     xlab = 'sigma';
0012     logx = 0;
0013 end
0014 %
0015 id_simul0 = [id_equil,'_',id_wave,'_',id_fluct,locid_simul];
0016 %
0017 nscan = length(scanlist);
0018 %
0019 fwhm = 2*sqrt(2*log(2));% ratio of fwhm to STD
0020 %
0021 %Zfluct = cell(1,nscan);
0022 I_totm = NaN(1,nscan);
0023 %
0024 for iscan = 1:nscan,
0025     %
0026     eval([scanvar,' = ',num2str(scanlist(iscan)),';']);
0027     %
0028     id_simul = [id_simul0,'_sigma',num2str(sigmar_max),'_delta',num2str(sigmar_hwhm),'_dtn',num2str(dtn),'_tn',num2str(tn),'_Nfluct',num2str(Nfluct)];
0029     id_simul(id_simul == '.') = 'p';
0030     id_simul(id_simul == '+') = 'p';
0031     %
0032     filename = ['backup_',id_simul,'.mat'];
0033     %
0034     if exist(filename,'file'),
0035         %
0036         Zfluct = fproc_fluctn_jd(filename);%{iscan}
0037         %
0038         I_totm(iscan) = Zfluct.J.sI_totm(end);
0039         sI_tot(iscan) = Zfluct.J.ssI_tot(end);
0040         rI_totm(iscan) = Zfluct.J.srI_totm(end);
0041         %
0042         rhom(iscan) = Zfluct.J.srhom(end);
0043         srho(iscan) = Zfluct.J.ssrho(end);
0044         rrhom(iscan) = Zfluct.J.srrhom(end);
0045         %
0046         drhom(iscan) = Zfluct.J.sdrhom(end);
0047         sdrho(iscan) = Zfluct.J.ssdrho(end);
0048         rdrhom(iscan) = Zfluct.J.srdrhom(end);
0049         mdrho(iscan) = Zfluct.J.smdrho(end);
0050         %
0051         wavestime(iscan) = sum(Zfluct.calctime.waves);
0052         luketime(iscan) = sum(Zfluct.calctime.luke);
0053         %
0054     else
0055     end
0056 end
0057 %
0058 %
0059 % --------- current ---------
0060 %
0061 figure(1),clf
0062 %
0063 xlim = NaN;
0064 ylim = NaN;
0065 ylab = '<I> (MA)';
0066 tit = '';
0067 leg = {'With fluct.'};
0068 %
0069 %graph1D_jd(scanlist,I_totm,logx,0,xlab,ylab,tit,NaN,xlim,ylim,'-','+','r',2,20+14i,gca,0.9,0.7,0.7,I_totm.*rI_totm);
0070 graph1D_jd(scanlist,I_totm,logx,0,xlab,ylab,tit,NaN,xlim,ylim,'-','+','r',2,20+14i,gca,0.9,0.7,0.7,sI_tot);
0071 if ~isempty(Zfluct_ref),
0072     leg = [leg,'No fluct.'];
0073    graph1D_jd(get(gca,'xlim'),Zfluct_ref.J.sI_tot*[1,1],logx,0,'','','',leg,xlim,ylim,'-','none','k',0.5,20+14i);
0074 end
0075 %
0076 % --------- current radial location ---------
0077 %
0078 figure(2),clf
0079 %
0080 ylab = 'r/a';
0081 tit = 'current deposition';
0082 %
0083 graph1D_jd(scanlist,rhom,logx,0,xlab,ylab,tit,NaN,xlim,ylim,'-','+','r',2,20+14i,gca,0.9,0.7,0.7,srho);
0084 if ~isempty(Zfluct_ref),
0085     graph1D_jd(get(gca,'xlim'),Zfluct_ref.J.srho*[1,1],logx,0,'','','',leg,xlim,ylim,'-','none','k',0.5,20+14i);
0086 end
0087 %
0088 % --------- current radial width ---------
0089 %
0090 figure(3),clf
0091 %
0092 ylab = 'FWHM';
0093 leg_loc = [leg,'\sigma_{\rho}','(\sigma_{\rho}^2 + FWHM^2)^{(1/2)}','From av. profile']; 
0094 %
0095 graph1D_jd(scanlist,drhom,logx,0,xlab,ylab,tit,NaN,xlim,ylim,'-','+','r',2,20+14i,gca,0.9,0.7,0.7,sdrho);
0096 if ~isempty(Zfluct_ref),
0097     graph1D_jd(get(gca,'xlim'),Zfluct_ref.J.sdrho*[1,1],logx,0,'','','',NaN,xlim,ylim,'-','none','k',0.5,20+14i);
0098 end
0099 graph1D_jd(scanlist,fwhm*srho,logx,0,'','','',NaN,xlim,ylim,'--','+','m',2,20+14i);
0100 graph1D_jd(scanlist,sqrt((fwhm*srho).^2 + drhom.^2),logx,0,'','','',NaN,xlim,ylim,'--','o','c',2,20+14i);
0101 graph1D_jd(scanlist,mdrho,logx,0,'','','',leg_loc,xlim,ylim,'--','*','g',2,20+14i);
0102 %
0103 % --------- calculation time ---------
0104 %
0105 figure(4),clf
0106 %
0107 xlim = NaN;
0108 xlab = 'N';
0109 ylim = NaN;
0110 ylab = 't (s)';
0111 tit = '';
0112 leg = {'C3PO','LUKE','TOTAL'};
0113 %
0114 graph1D_jd(scanlist,wavestime,logx,0,xlab,ylab,tit,NaN,xlim,ylim,'-','+','r',2,20+14i,gca,0.9,0.7,0.7);
0115 graph1D_jd(scanlist,luketime,logx,0,'','','',NaN,xlim,ylim,'-','+','b',2,20+14i);
0116 graph1D_jd(scanlist,wavestime + luketime,logx,0,'','','',leg,xlim,ylim,'-','+','m',2,20+14i);
0117 
0118 
0119 %      stn: [1x97 double]
0120 %      rho: [30x1 double]
0121 %     drho: [30x1 double]
0122 %        J: [1x1 struct]
0123 %        P: [1x1 struct]
0124 %
0125 % K>> Zfluct{ifluct}.J
0126 %
0127 % ans =
0128 %
0129 %           sJ: [97x30 double]
0130 %          sJm: [97x30 double]
0131 %          ssJ: [97x30 double]
0132 %         srJm: [97x30 double]
0133 %       sI_tot: [97x1 double]
0134 %      sI_totm: [1x97 double]
0135 %      ssI_tot: [1x97 double]
0136 %     srI_totm: [1x97 double]
0137 %         srho: [97x1 double]
0138 %        sdrho: [97x1 double]
0139 %        srhom: [1x97 double]
0140 %        ssrho: [1x97 double]
0141 %       srrhom: [1x97 double]
0142 %       sdrhom: [1x97 double]
0143 %       ssdrho: [1x97 double]
0144 %      srdrhom: [1x97 double]
0145 %        smrho: [97x1 double]
0146 %       smdrho: [97x1 double]
0147 %
0148 % K>> Zfluct{ifluct}.P
0149 %
0150 % ans =
0151 %
0152 %          sP: [97x30 double]
0153 %         sPm: [97x30 double]
0154 %         ssP: [97x30 double]
0155 %        srPm: [97x30 double]
0156 %       sP_rf: [97x1 double]
0157 %      sP_rfm: [1x97 double]
0158 %      ssP_rf: [1x97 double]
0159 %     srP_rfm: [1x97 double]
0160 %        srho: [97x1 double]
0161 %       sdrho: [97x1 double]
0162 %       srhom: [1x97 double]
0163 %       ssrho: [1x97 double]
0164 %      srrhom: [1x97 double]
0165 %      sdrhom: [1x97 double]
0166 %      ssdrho: [1x97 double]
0167 %     srdrhom: [1x97 double]
0168 %       smrho: [97x1 double]
0169 %      smdrho: [97x1 double]
0170 %

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.