From 52e22443ce292bbe1515647f8bb400853a9e60b6 Mon Sep 17 00:00:00 2001 From: Antoine Hoffmann <antoine.hoffmann@epfl.ch> Date: Fri, 28 Jul 2023 16:01:24 +0200 Subject: [PATCH] save scripts --- matlab/plot/plot_cosol_mat.m | 28 +++++++++------- wk/analysis_heat_flux_paper2.m | 22 +++++++++++++ wk/load_metadata_scan.m | 6 +++- .../nonlin_kT_scan_analysis.m | 4 ++- .../nonlin_nu_scan_analysis.m | 32 +++++++++++-------- 5 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 wk/analysis_heat_flux_paper2.m diff --git a/matlab/plot/plot_cosol_mat.m b/matlab/plot/plot_cosol_mat.m index 10852981..ff31e4d2 100644 --- a/matlab/plot/plot_cosol_mat.m +++ b/matlab/plot/plot_cosol_mat.m @@ -103,6 +103,7 @@ mfns = {... '/home/ahoffman/gyacomo/iCa/gk_coulomb_NFLR_12_P_4_J_2_N_50_kpm_4.0.h5';... '/home/ahoffman/gyacomo/iCa/gk_landau_P10_J5_dk_5e-2_km_2.0_NFLR_12.h5';... '/home/ahoffman/gyacomo/iCa/gk_landau_P11_J7_dk_5e-2_km_2.0_NFLR_16.h5';... + '/home/ahoffman/gyacomo/iCa/gk_landau_P12_J6_dk_5e-2_km_1.0_NFLR_16.h5';... '/home/ahoffman/gyacomo/iCa/gk_landauii_P16_J9_dk_5e-2_km_2.0_NFLR_8.h5';... '/home/ahoffman/gyacomo/iCa/gk_landau_P16_J9_dk_5e-2_km_2.0_NFLR_8.h5';... % '/home/ahoffman/gyacomo/iCa/gk.hacked_sugama_P_10_J_5_N_150_kpm_8.0.h5';... @@ -115,6 +116,7 @@ CONAME_A = {... 'FC 4 2 NFLR 12'; ... 'LD 10 5 NFLR 12'; ... 'LD 11 7 NFLR 16'; ... + 'LD 12 6 NFLR 16'; ... 'LDii 16 9 NFLR 8'; ... 'LD 16 9 NFLR 8'; ... % 'Hacked SG A';... @@ -131,7 +133,7 @@ for j_ = 1:numel(mfns) matidx = sprintf('%5.5i',idx_); MAT = h5read(mat_file_name,['/',matidx,'/Caapj/Ciipj']); gmax(idx_+1) = max((real(eig(MAT)))); - wmax(idx_+1) = max(abs(imag(eig(MAT)))); + wmax(idx_+1) = max((imag(eig(MAT)))); end subplot(121) plot(kp_a,gmax,'DisplayName',CONAME_A{j_}); hold on; @@ -140,11 +142,13 @@ for j_ = 1:numel(mfns) end subplot(121) legend('show'); grid on; -ylim([0,100]); +ylim([-10,10]); xlabel('$k_\perp$'); ylabel('$\gamma_{max}$ from Eig(iCa)') subplot(122) legend('show'); grid on; xlabel('$k_\perp$'); ylabel('$\omega_{max}$ from Eig(iCa)') +ylim([-10,10]); + end %% Van Kampen plot @@ -157,20 +161,22 @@ mfns = {... '/home/ahoffman/gyacomo/iCa/gk_coulomb_NFLR_6_P_4_J_2_N_50_kpm_4.0.h5';... '/home/ahoffman/gyacomo/iCa/gk_coulomb_NFLR_12_P_4_J_2_N_50_kpm_4.0.h5';... '/home/ahoffman/gyacomo/iCa/gk_landau_P10_J5_dk_5e-2_km_2.0_NFLR_12.h5';... + '/home/ahoffman/gyacomo/iCa/gk_landau_P12_J6_dk_5e-2_km_1.0_NFLR_16.h5';... '/home/ahoffman/gyacomo/iCa/gk_landauii_P16_J9_dk_5e-2_km_2.0_NFLR_8.h5';... - '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-3_P11_J7_dk_5e-2_km_5.0_NFLR_12.h5';... - '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-3_P4_J2_dk_5e-2_km_5.0_NFLR_5.h5';... - '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-2_P4_J2_dk_5e-2_km_5.0_NFLR_5.h5';... + % '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-3_P11_J7_dk_5e-2_km_5.0_NFLR_12.h5';... + % '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-3_P4_J2_dk_5e-2_km_5.0_NFLR_5.h5';... + % '/home/ahoffman/gyacomo/iCa/gk_sugama_tau1e-2_P4_J2_dk_5e-2_km_5.0_NFLR_5.h5';... }; CONAME_A = {'SG 20 10';... 'PA 20 10';... 'FC 4 2 NFLR 6';... 'FC 4 2 NFLR 12';... 'LD 10 5 NFLR 12';... + 'LD 12 6 NFLR 12';... 'LD 16 9 NFLR 16';... - 'SG 11 7 NFLR 12, tau 1e-3'; ... - 'SG 4 2 NFLR 5, tau 1e-3'; ... - 'SG 4 2 NFLR 5, tau 1e-2'; ... + % 'SG 11 7 NFLR 12, tau 1e-3'; ... + % 'SG 4 2 NFLR 5, tau 1e-3'; ... + % 'SG 4 2 NFLR 5, tau 1e-2'; ... }; TAU_A = [1;... 1;... @@ -178,9 +184,9 @@ TAU_A = [1;... 1;... 1;... 1;... - 1e-3;... - 1e-3;... - 1e-2;... + % 1e-3;... + % 1e-3;... + % 1e-2;... ]; grow = {}; puls = {}; diff --git a/wk/analysis_heat_flux_paper2.m b/wk/analysis_heat_flux_paper2.m new file mode 100644 index 00000000..c1c17c46 --- /dev/null +++ b/wk/analysis_heat_flux_paper2.m @@ -0,0 +1,22 @@ +figure + +PJ = '5x3'; +% PJ = '9x5'; +% PJ = '11x6'; +% PJ = '17x9'; + +% RES = '128x64x24'; +RES = '192x96x24'; + +NU = '0.005'; + +PJxRES = [PJ,'x',RES]; +for CO = {'DGGK','SGGK','LDGK'} +folder = ['/misc/gyacomo23_outputs/paper_2_GYAC23/collision_study/nu',CO{1},'_scan_kT_5.3/',PJxRES,'/nu_',NU]; +[t, ~, Qxi] = read_flux_out_XX(folder); +plot(t,Qxi,'.','DisplayName',CO{1}); hold on + +end +legend('show'); +title([PJ,'x',RES,' nu=',NU]); +ylim([0 25]) \ No newline at end of file diff --git a/wk/load_metadata_scan.m b/wk/load_metadata_scan.m index eaec3e66..600797d1 100644 --- a/wk/load_metadata_scan.m +++ b/wk/load_metadata_scan.m @@ -10,7 +10,11 @@ addpath(genpath([gyacomodir,'matlab/load'])) % ... add% EXECNAME = 'gyacomo_1.0' % datafname = 'lin_KBM/12x24_ky_0.05_0.75_P_2_16_DGGK_0.01_be_0.03.mat'; % datafname = 'lin_AUG_scan/12x24_ky_0.05_0.75_P_2_16_DGGK_0.01_be_0.000152.mat'; % datafname = 'lin_Entropy_scan/2x1_ky_0.05_0.75_P_2_8_DGDK_0_be_0.mat'; -datafname = 'lin_DTT_AB_rho85_PT_scan/16x24_ky_0.1_1.5_P_2_8_DGGK_0.05_be_0.0034.mat'; +% datafname = 'lin_DTT_AB_rho85_PT_scan/16x24_ky_0.1_0.5_P_2_8_DGGK_0.05_be_0.0034.mat'; +% datafname = 'lin_DTT_AB_rho85_PT_scan/16x24_ky_0.1_0.5_P_2_8_DGGK_0.05_be_0.0039.mat'; +% datafname = 'lin_DTT_AB_rho85_PT_scan/16x24_ky_0.1_1_P_2_8_DGGK_0.05_be_0.0039.mat'; +datafname = 'lin_DTT_AB_rho85_PT_scan/16x24_ky_0.1_0.9_P_2_8_kN_1.33_DGGK_0.56901_be_0.0039.mat'; +% datafname = 'lin_DTT_AB_rho85_PT_scan/8x24_ky_0.05_1.5_P_2_8_kN_1.33_DGGK_0.1_be_0.0039.mat'; %% Chose if we filter gamma>0.05 FILTERGAMMA = 0; diff --git a/wk/paper_2_scripts_and_results/nonlin_kT_scan_analysis.m b/wk/paper_2_scripts_and_results/nonlin_kT_scan_analysis.m index 9248201a..26e704e6 100644 --- a/wk/paper_2_scripts_and_results/nonlin_kT_scan_analysis.m +++ b/wk/paper_2_scripts_and_results/nonlin_kT_scan_analysis.m @@ -12,6 +12,8 @@ else rootdir = '/misc/gene_results/kT_scan_nu0'; mrkstyl='d'; end +nustr = '5e-3'; mrkstyl='o'; +rootdir = '/misc/gyacomo23_outputs/paper_2_GYAC23/kT_scan_LDGK_nu_5e-3'; Mmax = 6; msz = 10; lwt = 2.0; xname = '$\kappa_T (\kappa_N=2.22)$'; @@ -182,7 +184,7 @@ end ylabel('$\chi L_N/\rho_s^2 c_s$'); xlabel('$R/L_T$'); -title(['$\nu_{DGDK}=$',nustr]) +title(['$\nu_{',data.inputs.CONAME,'}=$',nustr]) legend('show'); legend('Location','northwest') xlim([3.5 10]); diff --git a/wk/paper_2_scripts_and_results/nonlin_nu_scan_analysis.m b/wk/paper_2_scripts_and_results/nonlin_nu_scan_analysis.m index fd1555a9..d88482ec 100644 --- a/wk/paper_2_scripts_and_results/nonlin_nu_scan_analysis.m +++ b/wk/paper_2_scripts_and_results/nonlin_nu_scan_analysis.m @@ -2,20 +2,20 @@ kN=2.22; figure ERRBAR = 1; LOGSCALE = 0; AU = 0; resstr={}; +kN = 2.22; msz = 10; lwt = 2.0; % CO = 'DGGK'; mrkstyl='d'; -% CO = 'SGGK'; mrkstyl='s'; -CO = 'LDGK'; mrkstyl='o'; +CO = 'SGGK'; mrkstyl='s'; +% CO = 'LDGK'; mrkstyl='o'; % GRAD = 'kT_7.0'; kT = 6.96; GRAD = 'kT_5.3'; kT = 5.3; % GRAD = 'kT_4.5'; kT = 4.5; xname = ['$\nu_{',CO,'}$ ']; -titlename = [CO,', ',GRAD]; scanvarname = 'nu'; rootdir = ['/misc/gyacomo23_outputs/paper_2_GYAC23/collision_study/nu',CO,'_scan_',GRAD]; scanval = {'0.005' '0.01' '0.02' '0.05' '0.1' '0.2' '0.5'}; naming = @(s) num2str(s); - +J0 = 00; J1 = 20; % Get all directories system(['ls -d ',rootdir,'/*/ > list.txt']); fid = fopen('list.txt'); @@ -39,6 +39,7 @@ clrs_ = lines(numel(directories)); for j = 1:numel(directories) % Get all subdirectories + disp(directories{j}); system(['ls -d ',directories{j},'*/ > list.txt']); fid = fopen('list.txt'); tline = fgetl(fid); i_ = 1; nus=[]; subdirectories={}; @@ -56,7 +57,7 @@ for j = 1:numel(directories) subdirectories = subdirectories(ids); nus = nus(ids); naming = @(s) sprintf('%1.1f',s); clr_ = clrs_(j,:); - titlename = [CO,', ',GRAD,', ',resstr{j}]; + titlename = [CO,', kT=',num2str(kT)]; N = numel(subdirectories); x = 1:N; Qx_avg = 1:N; @@ -65,9 +66,12 @@ for j = 1:numel(directories) Chi_std = 1:N; data = {}; for i = 1:N - subdir = subdirectories{i}; - data = compile_results_low_mem(data,subdir,00,20); + subdir = subdirectories{i}; + % data = compile_results_low_mem(data,subdir,J0,J1); try + [t, ~, Q] = read_flux_out_XX(subdir); + data.Ts0D = t; + data.HFLUX_X = Q; Trange = data.Ts0D(end)*[0.5 0.75]; catch % if data does not exist put 0 everywhere data.Ts0D = 0; @@ -80,16 +84,16 @@ for j = 1:numel(directories) data.inputs.NU = nus(i); end Trange = data.Ts0D(end)*[0.25 0.75]; - % Trange = [200 400]; + % Trange = [100 400]; % [~,it0] = min(abs(Trange(1) -data.Ts0D)); [~,it1] = min(abs(Trange(end)-data.Ts0D)); % Qx_avg(i) = mean(data.HFLUX_X(it0:it1)); Qx_std(i) = std(data.HFLUX_X(it0:it1)); - Chi_avg(i) = Qx_avg(i)./data.inputs.K_T/data.inputs.K_N; - Chi_std(i) = Qx_std(i)./data.inputs.K_T/data.inputs.K_N; - x(i) = data.inputs.NU; + Chi_avg(i) = Qx_avg(i)./kT/kN; + Chi_std(i) = Qx_std(i)./kT/kN; + x(i) = nus(i); subplot(N,2,2*i-1) hold on; Qx = data.HFLUX_X; @@ -102,19 +106,21 @@ for j = 1:numel(directories) 'Color',clr_); hold on % plot([T(it0) T(end)],Qx_avg(i)*[1 1],'--k','DisplayName',... % ['$Q_{avg}=',sprintf('%2.2f',Qx_avg(i)),'\pm',sprintf('%2.2f',Qx_std(i)),'$']); + ylim([0 40]); end % plot chi vs nu subplot(122) hold on; if ERRBAR errorbar(x,Chi_avg,Chi_std,'DisplayName',... - ['(',num2str(data.inputs.PMAX),',',num2str(data.inputs.JMAX),')'],... + ['(',num2str(Ps(j)-1),',',num2str(Js(j)-1),') ',resstr{j}],... 'color',clr_,'MarkerFaceColor','k','MarkerSize',7,'LineWidth',2); hold on; else plot(x,Chi_avg,'DisplayName',... - ['(',num2str(data.inputs.PMAX),',',num2str(data.inputs.JMAX),')'],... + ['(',num2str(Ps(j)-1),',',num2str(Js(j)-1),') ',resstr{j}],... 'color',clr_,'Marker',mrkstyl); end + ylim([0 8]) end % Formatting -- GitLab