luke_disp_outputs_mt

PURPOSE ^

SYNOPSIS ^

function [outputs,nw] = luke_disp_outputs_mt(equils,outputs,style,axs)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [outputs,nw] = luke_disp_outputs_mt(equils,outputs,style,axs)
0002 %
0003 nt = length(equils);
0004 %
0005 waveids = {};
0006 %
0007 t = NaN(1,nt);
0008 Ip = NaN(1,nt);
0009 %
0010 I_tot = NaN(1,nt);
0011 P0_rf = NaN(1,nt);
0012 P_rf = NaN(1,nt);
0013 P_e = NaN(1,nt);
0014 %
0015 nw = 0;
0016 %
0017 for it = 1:nt,
0018     if isempty(outputs{it}),% times for which LUKE is not run
0019         if ~isempty(waveids),
0020             %
0021             wP0_rf(it,:) = NaN;
0022             wP_rf(it,:) = NaN;
0023             wrhoP_rf(it,:) = NaN;
0024             %
0025             wP_rf_lin(it,:) = NaN;
0026             wrhoP_rf_lin(it,:) = NaN;
0027             %
0028         end
0029         %
0030     else% times for which LUKE is run
0031         %
0032         if ~isfield(outputs{it},'data_proc'),% times for which LUKE is not processed
0033             outputs{it}.data_proc = proc_luke_jd(outputs{it},struct);
0034         end
0035         %
0036         t(it) = equils{it}.shotime;
0037         Ip(it) = equils{it}.ip/1e6;
0038         %
0039         scalar = outputs{it}.data_proc.scalar;
0040         wave = outputs{it}.data_proc.wave;
0041         id = [outputs{it}.data_proc.simul.id,'_'];
0042         %
0043         I_tot(it) = scalar.I_tot;
0044         P0_rf(it) = scalar.p0_rf_2piRp*(2*pi*scalar.Rp);
0045         P_rf(it) = scalar.p_rf_2piRp*(2*pi*scalar.Rp);
0046         P_e(it) = scalar.p_e_2piRp*(2*pi*scalar.Rp);
0047         %
0048         nw = length(wave.wp0_rf_2piRp);
0049         %
0050         iC3PO = strfind(id,'C3PO');
0051         %
0052         if length(iC3PO) ~= nw,
0053             disp(['Warning : wave identification failed for time : ',num2str(t(it))])
0054             continue
0055         elseif nw > 0,
0056             iiws = zeros(1,nw);
0057             for iw = 1:nw,
0058                 waveid = id(iC3PO(iw) + 4 + (1:min(strfind(id(iC3PO(iw)+5 : end),'_'))-1));
0059                 iiw = find(strcmp(waveids,waveid));
0060                 if isempty(iiw),
0061                     waveids = [waveids,waveid];
0062                     iiws(iw) = length(waveids);
0063                 else
0064                     iiws(iw) = iiw;
0065                 end
0066             end
0067             wP0_rf(it,iiws) = wave.wp0_rf_2piRp*(2*pi*scalar.Rp);
0068             wP_rf(it,iiws) = wave.wp_rf_2piRp*(2*pi*scalar.Rp);
0069             wrhoP_rf(it,iiws) = wave.wP_rf_rhoP;
0070             %
0071             wP_rf_lin(it,iiws) = wave.wp_rf_2piRp_lin*(2*pi*scalar.Rp);
0072             wrhoP_rf_lin(it,iiws) = wave.wP_rf_rhoP_lin;
0073         elseif ~isempty(waveids),
0074             %
0075             wP0_rf(it,:) = 0;
0076             wP_rf(it,:) = 0;
0077             wrhoP_rf(it,:) = 0;
0078             %
0079             wP_rf_lin(it,:) = NaN;
0080             wrhoP_rf_lin(it,:) = NaN;
0081             %
0082         end
0083         %
0084     end
0085     %
0086 end
0087 %
0088 nw = length(waveids);
0089 %
0090 colors = {'r','b',[0,0.5,0],'k'};
0091 markers = {'s','d','+','o'};
0092 %
0093 xlab = 't (s)';
0094 xlim = 0;
0095 %
0096 ylim = 0;
0097 %
0098 if nargin < 4,
0099     red = 0.9;
0100     lspace = 0.7;
0101     lspace2 = 0.5;
0102     bspace = 0.7;
0103     bspace2 = 0.5;
0104 else
0105     red = 1;
0106     lspace = NaN;
0107     lspace2 = NaN;
0108     bspace = NaN;
0109     bspace2 = NaN;
0110 end
0111 %
0112 % current
0113 %
0114 if nargin < 4,
0115     figure(1),clf,set(1,'Name','Current')
0116     ax = gca;
0117 else
0118     ax = axs(1);
0119 end
0120 %
0121 ylab = 'I (MA)';
0122 if any(P_e ~= 0) && any(P_rf ~= 0)
0123     leg = {'I_p','I_{RF+\Omega}'};
0124 elseif any(P_rf ~= 0)
0125     leg = {'I_p','I_{RF}'};
0126 elseif any(P_e ~= 0)
0127     leg = {'I_p','I_{\Omega}'};
0128 else
0129     leg = {'I_p','I_{luke}'};
0130 end
0131 %
0132 if min(Ip) + max(Ip) < 0,
0133     Ip = -Ip;
0134     leg{1} = ['-',leg{1}];
0135 end
0136 %
0137 [ax] = graph1D_jd(t,Ip,0,0,'','','',NaN,NaN,NaN,'-',markers{1},colors{1},2,style,ax);
0138 [ax] = graph1D_jd(t,I_tot,0,0,xlab,ylab,'',leg,xlim,ylim,'-',markers{2},colors{2},2,style,ax);
0139 %
0140 % power
0141 %
0142 if nargin < 4,
0143     figure(2),clf,set(1,'Name','Power')
0144     ax = gca;
0145 else
0146     ax = axs(2);
0147 end
0148 %
0149 ylab = 'P (MW)';
0150 leg = {'P_{RF0}','P_{RF}','P_{\Omega}'};
0151 %
0152 [ax] = graph1D_jd(t,P0_rf,0,0,'','','',NaN,NaN,NaN,'-',markers{1},colors{1},2,style,ax);
0153 [ax] = graph1D_jd(t,P_rf,0,0,'','','',NaN,NaN,NaN,'-',markers{2},colors{2},2,style,ax);
0154 [ax] = graph1D_jd(t,P_e,0,0,xlab,ylab,'',leg,xlim,ylim,'-',markers{3},colors{3},2,style,ax);
0155 %
0156 if nw == 0,
0157     return
0158 end
0159 %
0160 % wave absorption rate
0161 %
0162 if nargin < 4,
0163     figure(3),clf,set(1,'Name','Power')
0164     ax = gca;
0165 else
0166     ax = axs(3);
0167 end
0168 %
0169 wPfrac = wP_rf./wP0_rf;
0170 wPfrac_lin = wP_rf_lin./wP0_rf;
0171 %
0172 ylab = 'P_{RF}/P_{RF0}';
0173 %
0174 nw = length(waveids);
0175 for iw = 1:nw - 1,
0176     [ax] = graph1D_jd(t,wPfrac(:,iw),0,0,'','','',NaN,NaN,NaN,'--',markers{iw},colors{iw},2,style,ax);
0177 end
0178 [ax] = graph1D_jd(t,wPfrac(:,nw),0,0,'','','',waveids,NaN,NaN,'--',markers{nw},colors{nw},2,style,ax);
0179 %
0180 for iw = 1:nw - 1,
0181     [ax] = graph1D_jd(t,wPfrac_lin(:,iw),0,0,'','','',NaN,NaN,NaN,'-',markers{iw},colors{iw},0.5,style,ax);
0182 end
0183 [ax] = graph1D_jd(t,wPfrac_lin(:,nw),0,0,xlab,ylab,'',NaN,xlim,ylim,'-',markers{nw},colors{nw},0.5,style,ax);
0184 %
0185 % wave power deposition location
0186 %
0187 if nargin < 4,
0188     figure(4),clf,set(1,'Name','Power')
0189     ax = gca;
0190 else
0191     ax = axs(4);
0192 end
0193 %
0194 ylab = 'r/a';
0195 %
0196 for iw = 1:nw - 1,
0197     [ax] = graph1D_jd(t,wrhoP_rf(:,iw),0,0,'','','',NaN,NaN,NaN,'--',markers{iw},colors{iw},2,style,ax);
0198 end
0199 [ax] = graph1D_jd(t,wrhoP_rf(:,nw),0,0,'','','',waveids,NaN,NaN,'--',markers{nw},colors{nw},2,style,ax);
0200 %
0201 for iw = 1:nw - 1,
0202     [ax] = graph1D_jd(t,wrhoP_rf_lin(:,iw),0,0,'','','',NaN,NaN,NaN,'-',markers{iw},colors{iw},0.5,style,ax);
0203 end
0204 [ax] = graph1D_jd(t,wrhoP_rf_lin(:,nw),0,0,xlab,ylab,'',NaN,xlim,ylim,'-',markers{nw},colors{nw},0.5,style,ax);

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