added flexibility

This commit is contained in:
Dominik Demuth 2024-11-28 19:40:07 +01:00
parent d844aac0e8
commit 1bf927329d
2 changed files with 56 additions and 32 deletions

View File

@ -15,9 +15,9 @@ techo_start=0e-6
techo_stop=40e-6 techo_stop=40e-6
techo_steps=5 techo_steps=5
# STE part # STE part
tevo_start=2e-6 tevo_start=5e-6
tevo_stop=120e-6 tevo_stop=60e-6
tevo_steps=121 tevo_steps=1
tmix_start=1e-5 tmix_start=1e-5
tmix_stop=1e1 tmix_stop=1e1
tmix_steps=61 tmix_steps=31

80
main.py
View File

@ -8,28 +8,35 @@ motion = 'IsotropicAngle'
distribution = 'Delta' distribution = 'Delta'
# parameter = {} # parameter = {}
parameter = { parameter = {
"angle": [10, 109.47], "angle": np.linspace(3, 150, num=148),
# "sigma": 0.1,
# "tau": np.logspace(-1, 1, num=3)
} }
parameter = prepare_rw_parameter(parameter) parameter = prepare_rw_parameter(parameter)
fig_tau_cc, ax_tau_cc = plt.subplots() # fig_tau_cc, ax_tau_cc = plt.subplots()
ax_tau_cc.set_title('tau_cc') # ax_tau_cc.set_title('tau_cc')
#
# fig_beta_cc, ax_beta_cc = plt.subplots()
# ax_beta_cc.set_title('beta_cc')
#
# fig_finfty_cc, ax_finfty_cc = plt.subplots()
# ax_finfty_cc.set_title('f_infty_cc')
#
# fig_tau_ss, ax_tau_ss = plt.subplots()
# ax_tau_ss.set_title('tau_ss')
#
# fig_beta_ss, ax_beta_ss = plt.subplots()
# ax_beta_ss.set_title('beta_ss')
#
# fig_finfty_ss, ax_finfty_ss = plt.subplots()
# ax_finfty_ss.set_title('f_infty_ss')
fig_beta_cc, ax_beta_cc = plt.subplots() tau_ss_angles = []
ax_beta_cc.set_title('beta_cc') tau_cc_angles = []
tau_2_angles = []
fig_finfty_cc, ax_finfty_cc = plt.subplots() angles = []
ax_finfty_cc.set_title('f_infty_cc')
fig_tau_ss, ax_tau_ss = plt.subplots()
ax_tau_ss.set_title('tau_ss')
fig_beta_ss, ax_beta_ss = plt.subplots()
ax_beta_ss.set_title('beta_ss')
fig_finfty_ss, ax_finfty_ss = plt.subplots()
ax_finfty_ss.set_title('f_infty_ss')
for variation in parameter: for variation in parameter:
print(f"\nRun RW for {motion}/{distribution} with arguments {variation}\n") print(f"\nRun RW for {motion}/{distribution} with arguments {variation}\n")
@ -39,17 +46,34 @@ for variation in parameter:
vary_string, tau_cc, beta_cc, finfty_cc = fit_and_save_ste(conf_file, 'coscos', plot_decays=False, verbose=False) vary_string, tau_cc, beta_cc, finfty_cc = fit_and_save_ste(conf_file, 'coscos', plot_decays=False, verbose=False)
_, tau_ss, beta_ss, finfty_ss = fit_and_save_ste(conf_file, 'sinsin', plot_decays=False, verbose=False) _, tau_ss, beta_ss, finfty_ss = fit_and_save_ste(conf_file, 'sinsin', plot_decays=False, verbose=False)
_, tau_2, beta_2, finfty_2 = fit_and_save_ste(conf_file, 'f2', plot_decays=True, verbose=True) _, tau_2, beta_2, finfty_2 = fit_and_save_ste(conf_file, 'f2', plot_decays=False, verbose=True)
ax_tau_cc.semilogy(tau_cc[:, 0], tau_cc[:, 1], label=vary_string) # ax_tau_cc.semilogy(tau_cc[:, 0], tau_cc[:, 1], label=vary_string)
ax_tau_cc.axhline(tau_2[:, 1], color='k', linestyle='--') # ax_tau_cc.axhline(tau_2[:, 1], color='k', linestyle='--')
ax_beta_cc.plot(*beta_cc.T, label=vary_string) # ax_beta_cc.plot(*beta_cc.T, label=vary_string)
ax_finfty_cc.plot(*finfty_cc.T, label=vary_string) # ax_finfty_cc.plot(*finfty_cc.T, label=vary_string)
ax_tau_ss.semilogy(tau_ss[:, 0], tau_ss[:, 1], label=vary_string) # ax_tau_ss.semilogy(tau_ss[:, 0], tau_ss[:, 1], label=vary_string)
ax_tau_ss.axhline(tau_2[:, 1], color='k', linestyle='--') # ax_tau_ss.axhline(tau_2[:, 1], color='k', linestyle='--')
ax_beta_ss.plot(*beta_ss.T, label=vary_string) # ax_beta_ss.plot(*beta_ss.T, label=vary_string)
ax_finfty_ss.plot(*finfty_ss.T, label=vary_string) # ax_finfty_ss.plot(*finfty_ss.T, label=vary_string)
for ax in [ax_tau_cc, ax_beta_cc, ax_finfty_cc, ax_tau_ss, ax_beta_ss, ax_finfty_ss]: angles.append(variation['angle'])
ax.legend() tau_ss_angles.append(tau_ss[0, 1])
tau_cc_angles.append(tau_cc[0, 1])
tau_2_angles.append(tau_2[0, 1])
fig, ax = plt.subplots()
ax.semilogy(angles, tau_ss_angles, 'o', label='SS (4.9mus)')
ax.plot(angles, tau_cc_angles, 'o', label='CC (4.9mus)')
ax.plot(angles, tau_2_angles, 'o', label='F2')
ax.legend()
np.savetxt('angle.dat', np.c_[angles, tau_cc_angles, tau_ss_angles, tau_2_angles], header='#x\tcc\tss\tf2')
fig2, ax2 = plt.subplots()
ax2.plot(angles, np.array(tau_cc_angles)/np.array(tau_2_angles), 'o')
# for ax in [ax_tau_cc, ax_beta_cc, ax_finfty_cc, ax_tau_ss, ax_beta_ss, ax_finfty_ss]:
# ax.legend()
plt.show() plt.show()