fluctanalysis_yp

PURPOSE ^

SYNOPSIS ^

function [tn,tn_all,fluctres] = fluctanalysis_yp(tn,txJ,txP,tI,tP,racc,itnmin)

DESCRIPTION ^

 This function makes the statistical analysis of the power and rf current when fluctuations are present 

   INPUT :

       - equilDKE: 
       - ZP0:
       - Zcurr:
       - mksa:
       - racc: minimum relative accuracy of the mean value [1,1]
           (default = 0.05)
       -itnmin: minimum index of the time evolution [1,1]
           (default = 1)

   OUTPUT :

       - tn: processed time index [1,m]
       - tn_all: all time index [1,ntn]
       - fluctres: output structure

 by Y. Peysson DRFC-CEA <yves.peysson@cea.fr> and J. Decker DRFC-CEA <joan.decker@cea.fr>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [tn,tn_all,fluctres] = fluctanalysis_yp(tn,txJ,txP,tI,tP,racc,itnmin)
0002 %
0003 % This function makes the statistical analysis of the power and rf current when fluctuations are present
0004 %
0005 %   INPUT :
0006 %
0007 %       - equilDKE:
0008 %       - ZP0:
0009 %       - Zcurr:
0010 %       - mksa:
0011 %       - racc: minimum relative accuracy of the mean value [1,1]
0012 %           (default = 0.05)
0013 %       -itnmin: minimum index of the time evolution [1,1]
0014 %           (default = 1)
0015 %
0016 %   OUTPUT :
0017 %
0018 %       - tn: processed time index [1,m]
0019 %       - tn_all: all time index [1,ntn]
0020 %       - fluctres: output structure
0021 %
0022 % by Y. Peysson DRFC-CEA <yves.peysson@cea.fr> and J. Decker DRFC-CEA <joan.decker@cea.fr>
0023 %
0024 if nargin < 6,
0025     racc = NaN;
0026 end
0027 if nargin < 7,
0028     itnmin = 1;
0029 end
0030 %
0031 if ~isstruct(racc),
0032     raccval = racc;
0033     racc = struct;
0034     racc.P = raccval;
0035     racc.I = raccval;
0036 end
0037 %
0038 % fluctres.I.scocurr = sign(equilDKE.psia_apRp)*sign(equilDKE.XBphi(1,1));%cocurrent factor
0039 %
0040 txP_all = txP;
0041 txP = txP(itnmin:end,:);
0042 if isvector(txP_all),
0043     txP = txP(:).';
0044 end
0045 %
0046 tn_all = tn;
0047 tn = tn(itnmin:end);
0048 %
0049 fluctres.P.tP_all = tP;
0050 fluctres.P.tnP_all = tn_all;
0051 fluctres.P.tP = tP(itnmin:end);
0052 [fluctres.P.iPtot,fluctres.P.Ptot,fluctres.P.Ptotm,fluctres.P.Ptots,fluctres.P.Ptotr,fluctres.P.iPtotr] = statanalysis_yp(fluctres.P.tP,racc.P);
0053 %
0054 fluctres.P.xP = txP(fluctres.P.iPtot,:);
0055 fluctres.P.xPm = mean(fluctres.P.xP,1);
0056 fluctres.P.xPs = std(fluctres.P.xP);
0057 %
0058 txJ_all = txJ;
0059 txJ = txJ(itnmin:end,:);
0060 if isvector(txJ_all),
0061     txJ = txJ(:).';
0062 end
0063 %
0064 fluctres.I.tI_all = tI;
0065 fluctres.I.tnI_all = tn_all;
0066 fluctres.I.tI = tI(itnmin:end);
0067 fluctres.I.tnI = tn(fluctres.P.iPtot);%new base time correponding to points where the absorbed RF power is consistent with input RF power
0068 fluctres.I.tI = fluctres.I.tI(fluctres.P.iPtot);%keep only points where the absorbed RF power is consistent with input RF power
0069 txJ = txJ(fluctres.P.iPtot,:);%keep only points where the absorbed RF power is consistent with input RF power
0070 [fluctres.I.iItot,fluctres.I.Itot,fluctres.I.Itotm,fluctres.I.Itots,fluctres.I.Itotr,fluctres.I.iItotr] = statanalysis_yp(fluctres.I.tI,racc.I);
0071 %
0072 fluctres.I.xJ = txJ(fluctres.I.iItot,:);
0073 fluctres.I.xJm = mean(fluctres.I.xJ,1);
0074 fluctres.I.xJs = std(fluctres.I.xJ);

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