compres_luke_jd

PURPOSE ^

SYNOPSIS ^

function compres_luke_jd(ids_equil,ids_wave,leg,si,opt_rho)

DESCRIPTION ^

 compares results from a list of runs

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function compres_luke_jd(ids_equil,ids_wave,leg,si,opt_rho)
0002 %
0003 % compares results from a list of runs
0004 %
0005 if nargin < 5,
0006     opt_rho = 0;
0007 end
0008 if nargin < 4,
0009     si = 1;
0010 end
0011 %
0012 color = {'r','b',[0,0.75,0]};
0013 %
0014 Nl = length(ids_wave);
0015 %
0016 filename = 'res_comp.log';
0017 delete(filename);
0018 diary(filename);
0019 %
0020 load(['DKE_RESULTS_',ids_equil{1},'_',ids_wave{1}],'dke_out')
0021 %
0022 disp(['Simulation id: ',dke_out.simul.id]);
0023 disp(['Simulation date: ',timeid_jd(dke_out.simul.timeid)]);
0024 disp(['User id: ',dke_out.simul.userid]);
0025 disp(['LUKE Version: ',dke_out.simul.LUKEversion]);
0026 disp(' ');
0027 %
0028 for il = 1:Nl,
0029     if length(ids_equil) == 1,
0030         load(['DKE_RESULTS_',ids_equil{1},'_',ids_wave{il}],'Zcurr','ZP0','mksa','equilDKE','Zbouncecoef');
0031         str = ['EQUIL ',ids_equil{1},'; WAVE ',ids_wave{il},': '];
0032     else
0033         load(['DKE_RESULTS_',ids_equil{il},'_',ids_wave{il}],'Zcurr','ZP0','mksa','equilDKE','Zbouncecoef');
0034         str = ['EQUIL ',ids_equil{il},'; WAVE ',ids_wave{il},': '];
0035     end   
0036     %
0037     if opt_rho == 0,
0038         xrho{il} = equilDKE.xrho;
0039     elseif opt_rho == 1,
0040         xrho{il} = sqrt(equilDKE.xpsin);  
0041     elseif opt_rho == 2,
0042         xq_h = (Zbouncecoef.xq(1:end-1) + Zbouncecoef.xq(2:end))/2;
0043         xdpsin = diff(equilDKE.xpsin);
0044         xpsinT = [0,cumsum(xq_h.*xdpsin)]/sum(xq_h.*xdpsin);
0045         xrho{il} = sqrt(xpsinT);  
0046     end
0047     %
0048     xJ{il} = Zcurr.x_0_fsav*mksa.j_ref;
0049     xP{il} = ZP0.x_rf_fsav.'*mksa.P_ref;
0050     xdA{il} = equilDKE.xdA_dke;
0051     if isfield(equilDKE,'xdV_dke'),
0052         xdV{il} = equilDKE.xdV_dke;
0053     else
0054         xdV{il} = equilDKE.xdV_2piRp_dke*2*pi*equilDKE.Rp;
0055     end
0056     %
0057     Itot(il) = sum(xJ{il}.*xdA{il});
0058     Ptot(il) = sum(xP{il}.*xdV{il});
0059     %
0060     Itotstr = num2str(si*Itot(il));
0061     %
0062     leg_I(il,:) = ['I_{RF} = ',Itotstr(1:min(4,length(Itotstr))),' MA'];
0063     %
0064     disp([str,'I = ',num2str(Itot(il)),' MA;  P = ',num2str(Ptot(il)),' MW'])
0065     %
0066 end  
0067 %
0068 diary off
0069 %
0070 clear Zcurr ZP0 mksa equilDKE
0071 %
0072 xlab = '';
0073 ylab = '';
0074 tit = '';
0075 xlim = get(gca,'xlim');
0076 ylim = get(gca,'ylim');
0077 style = '-';
0078 width = 0.5;
0079 width2 = 2;
0080 marker = 'none';
0081 siz = 20;
0082 red = 0.9;
0083 lspace = 0.7;
0084 bspace = 0.7;
0085 %
0086 color1 = 'r';
0087 color2 = 'b';
0088 %
0089 figure('Name','RF power');clf
0090 %
0091 xlab = '\rho';
0092 ylab = 'S_{RF} (MW/m^3)';
0093 xlim = [0,1];
0094 ylim = NaN;
0095 %
0096 for il = 1:Nl-1,
0097     graph1D_jd(xrho{il},xP{il},0,0,'','','',NaN,xlim,ylim,style,marker,color{il},width2,siz);
0098 end
0099 graph1D_jd(xrho{Nl},xP{Nl},0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color{Nl},width2,siz,gca,red,lspace,bspace);
0100 %grid off
0101 set(gca,'xtick',[0:0.2:1])
0102 %
0103 figure('Name','RF current');clf
0104 %
0105 xlab = '\rho';
0106 ylab = 'J_{RF} (MA/m^2)';
0107 xlim = [0,1];
0108 ylim = NaN;
0109 %
0110 for il = 1:Nl-1,
0111     graph1D_jd(xrho{il},si*xJ{il},0,0,'','','',NaN,xlim,ylim,style,marker,color{il},width2,siz);
0112 end
0113 graph1D_jd(xrho{Nl},si*xJ{Nl},0,0,xlab,ylab,tit,leg_I,xlim,ylim,style,marker,color{Nl},width2,siz,gca,red,lspace,bspace);
0114 %grid off
0115 set(gca,'xtick',[0:0.2:1])

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