From f0a63981fed17a114105e7b232862308e4013434 Mon Sep 17 00:00:00 2001 From: Lin Yang <132409718+lin-yang-ly@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:45:21 -0600 Subject: [PATCH] Update figures in documentation --- .../verification_and_validation/val-2a.md | 74 +----- test/tests/val-2a/comparison_val-2a.py | 223 +++--------------- 2 files changed, 45 insertions(+), 252 deletions(-) diff --git a/doc/content/verification_and_validation/val-2a.md b/doc/content/verification_and_validation/val-2a.md index a893e485..41df87c7 100644 --- a/doc/content/verification_and_validation/val-2a.md +++ b/doc/content/verification_and_validation/val-2a.md @@ -63,80 +63,30 @@ Due to the parameters from TMAP4 and TMAP7 are different, the case considers bot ### Comparison based on data from TMAP7 !media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_left.png + image_name=val-2a_comparison_TMAP4.png style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_left - caption=Comparison of TMAP8 calculation with the experimental data on left side with unit of atom/m$^2$/s + id=val-2a_comparison_TMAP4 + caption=Comparison of TMAP8 calculation with the experimental data on left, right, and both sides with unit of atom/m$^2$/s !media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_right.png + image_name=val-2a_comparison_TMAP4_area.png style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_right - caption=Comparison of TMAP8 calculation with the experimental data on right side with unit of atom/m$^2$/s - -!media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_both.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_both - caption=Comparison of TMAP8 calculation with the experimental data on both side with unit of atom/m$^2$/s - -!media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_left_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_left_area - caption=Comparison of TMAP8 calculation with the experimental data on left side with unit of atom/s - -!media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_right_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_right_area - caption=Comparison of TMAP8 calculation with the experimental data on right side with unit of atom/s - -!media comparison_val-2a.py - image_name=TMAP7_val-2a_comparison_both_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP7_val-2a_comparison_both_area - caption=Comparison of TMAP8 calculation with the experimental data on both side with unit of atom/s + id=val-2a_comparison_TMAP4_area + caption=Comparison of TMAP8 calculation with the experimental data on left, right, and both sides with unit of atom/s ### Comparison based on data from TMAP7 !media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_left.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_left - caption=Comparison of TMAP8 calculation with the experimental data on left side with unit of atom/m$^2$/s - -!media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_right.png + image_name=val-2a_comparison_TMAP4.png style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_right - caption=Comparison of TMAP8 calculation with the experimental data on right side with unit of atom/m$^2$/s + id=val-2a_comparison_TMAP4 + caption=Comparison of TMAP8 calculation with the experimental data on left, right, and both sides with unit of atom/m$^2$/s !media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_both.png + image_name=val-2a_comparison_TMAP4_area.png style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_both - caption=Comparison of TMAP8 calculation with the experimental data on both side with unit of atom/m$^2$/s - -!media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_left_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_left_area - caption=Comparison of TMAP8 calculation with the experimental data on left side with unit of atom/s - -!media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_right_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_right_area - caption=Comparison of TMAP8 calculation with the experimental data on right side with unit of atom/s - -!media comparison_val-2a.py - image_name=TMAP4_val-2a_comparison_both_area.png - style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto - id=TMAP4_val-2a_comparison_both_area - caption=Comparison of TMAP8 calculation with the experimental data on both side with unit of atom/s - - + id=val-2a_comparison_TMAP4_area + caption=Comparison of TMAP8 calculation with the experimental data on left, right, and both sides with unit of atom/s ## Input files diff --git a/test/tests/val-2a/comparison_val-2a.py b/test/tests/val-2a/comparison_val-2a.py index 08f4a1f4..0648d071 100644 --- a/test/tests/val-2a/comparison_val-2a.py +++ b/test/tests/val-2a/comparison_val-2a.py @@ -83,249 +83,92 @@ def numerical_solution_on_experiment_input(experiment_input, tmap_input, tmap_ou experiment_flux_TMAP4 = experiment_TMAP4_data[' y'] -TMAP7_file_base = 'TMAP7_val-2a_comparison' -TMAP4_file_base = 'TMAP4_val-2a_comparison' -############################ TMAP7 left side atom/m$^2$/s ############################ +TMAP7_file_base = 'val-2a_comparison_TMAP7' +TMAP4_file_base = 'val-2a_comparison_TMAP4' +############################ TMAP7 atom/m$^2$/s ############################ fig = plt.figure(figsize=[6.5, 5.5]) gs = gridspec.GridSpec(1, 1) ax = fig.add_subplot(gs[0]) -ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7, linestyle='-', label=r"TMAP8", c='tab:blue') +ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7, linestyle='-', label=r"left", c='tab:blue') +ax.plot(simulation_time_TMAP7/1000, simulation_flux_right_TMAP7, linestyle='-', label=r"right", c='tab:brown') +ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7 + simulation_flux_right_TMAP7, linestyle='-', label=r"both", c='tab:orange') ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') ax.set_xlabel(u'time (1000s)') ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") +# ax.set_ylim(bottom=0) +ax.set_yscale("log") ax.set_xlim(left=-0.1,right=2e1) plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_left.png', bbox_inches='tight') +# ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) +plt.savefig(f'{TMAP7_file_base}.png', bbox_inches='tight') plt.close(fig) -############################ TMAP7 right side atom/m$^2$/s ############################ +############################ TMAP7 atom/s ############################ fig = plt.figure(figsize=[6.5, 5.5]) gs = gridspec.GridSpec(1, 1) ax = fig.add_subplot(gs[0]) -ax.plot(simulation_time_TMAP7/1000, simulation_flux_right_TMAP7, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_right.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP7 both sides atom/m$^2$/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7 + simulation_flux_right_TMAP7, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_both.png', bbox_inches='tight') -plt.close(fig) - - - - -############################ TMAP7 left side atom/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7 * area, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_left_area.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP7 right side atom/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP7/1000, simulation_flux_right_TMAP7 * area, linestyle='-', label=r"TMAP8", c='tab:blue') +ax.plot(simulation_time_TMAP7/1000, simulation_flux_left_TMAP7 * area, linestyle='-', label=r"left", c='tab:blue') +ax.plot(simulation_time_TMAP7/1000, simulation_flux_right_TMAP7 * area, linestyle='-', label=r"right", c='tab:brown') +ax.plot(simulation_time_TMAP7/1000, (simulation_flux_left_TMAP7 + simulation_flux_right_TMAP7) * area, linestyle='-', label=r"both", c='tab:orange') ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') ax.set_xlabel(u'time (1000s)') ax.set_ylabel(u"Deuterium flux (atom/s)") ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") +# ax.set_ylim(bottom=0) +ax.set_yscale("log") ax.set_xlim(left=-0.1,right=2e1) plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_right_area.png', bbox_inches='tight') +# ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) +plt.savefig(f'{TMAP7_file_base}_area.png', bbox_inches='tight') plt.close(fig) -############################ TMP7 both sides atom/s ############################ +############################ TMAP4 atom/m$^2$/s ############################ fig = plt.figure(figsize=[6.5, 5.5]) gs = gridspec.GridSpec(1, 1) ax = fig.add_subplot(gs[0]) -ax.plot(simulation_time_TMAP7/1000, (simulation_flux_left_TMAP7 + simulation_flux_right_TMAP7) * area, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP7/1000, experiment_flux_TMAP7, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP7_file_base}_both_area.png', bbox_inches='tight') -plt.close(fig) - - -############################ TMAP4 left side atom/m$^2$/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_left.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP4 right side atom/m$^2$/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP4/1000, simulation_flux_right_TMAP4, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_right.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP4 both sides atom/m$^2$/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4 + simulation_flux_right_TMAP4, linestyle='-', label=r"TMAP8", c='tab:blue') +ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4, linestyle='-', label=r"left", c='tab:blue') +ax.plot(simulation_time_TMAP4/1000, simulation_flux_right_TMAP4, linestyle='-', label=r"right", c='tab:brown') +ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4 + simulation_flux_right_TMAP4, linestyle='-', label=r"both", c='tab:orange') ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') ax.set_xlabel(u'time (1000s)') ax.set_ylabel(u"Deuterium flux (atom/m$^2$/s)") ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") +# ax.set_ylim(bottom=0) +ax.set_yscale("log") ax.set_xlim(left=-0.1,right=2e1) plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_both.png', bbox_inches='tight') +# ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) +plt.savefig(f'{TMAP4_file_base}.png', bbox_inches='tight') plt.close(fig) - ############################ TMAP4 left side atom/s ############################ fig = plt.figure(figsize=[6.5, 5.5]) gs = gridspec.GridSpec(1, 1) ax = fig.add_subplot(gs[0]) -ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4 * area, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_left_area.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP4 right side atom/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP4/1000, simulation_flux_right_TMAP4 * area, linestyle='-', label=r"TMAP8", c='tab:blue') -ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') - -ax.set_xlabel(u'time (1000s)') -ax.set_ylabel(u"Deuterium flux (atom/s)") -ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") -ax.set_xlim(left=-0.1,right=2e1) -plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) -ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_right_area.png', bbox_inches='tight') -plt.close(fig) - -############################ TMAP4 both sides atom/s ############################ -fig = plt.figure(figsize=[6.5, 5.5]) -gs = gridspec.GridSpec(1, 1) -ax = fig.add_subplot(gs[0]) - -ax.plot(simulation_time_TMAP4/1000, (simulation_flux_left_TMAP4 + simulation_flux_right_TMAP4) * area, linestyle='-', label=r"TMAP8", c='tab:blue') +ax.plot(simulation_time_TMAP4/1000, simulation_flux_left_TMAP4 * area, linestyle='-', label=r"left", c='tab:blue') +ax.plot(simulation_time_TMAP4/1000, simulation_flux_right_TMAP4 * area, linestyle='-', label=r"right", c='tab:brown') +ax.plot(simulation_time_TMAP4/1000, (simulation_flux_left_TMAP4 + simulation_flux_right_TMAP4) * area, linestyle='-', label=r"both", c='tab:orange') ax.plot(experiment_time_TMAP4/1000, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k') ax.set_xlabel(u'time (1000s)') ax.set_ylabel(u"Deuterium flux (atom/s)") ax.legend(loc="best") -ax.set_ylim(bottom=0) -# ax.set_yscale("log") +# ax.set_ylim(bottom=0) +ax.set_yscale("log") ax.set_xlim(left=-0.1,right=2e1) plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3) ax.minorticks_on() -ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) -plt.savefig(f'{TMAP4_file_base}_both_area.png', bbox_inches='tight') +# ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15)) +plt.savefig(f'{TMAP4_file_base}_area.png', bbox_inches='tight') plt.close(fig)