Skip to content

Commit

Permalink
Uncomment example code
Browse files Browse the repository at this point in the history
  • Loading branch information
vatai committed Mar 21, 2024
1 parent c3dfc94 commit 59093c5
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions examples/semiclassical_micelles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
)
from radicalpy.relaxation import SingletTripletDephasing
from radicalpy.simulation import Basis, SemiclassicalSimulation, State
from radicalpy.utils import autocorrelation, Bhalf_fit, is_fast_run, read_trajectory_files
from radicalpy.utils import (
Bhalf_fit,
autocorrelation,
is_fast_run,
read_trajectory_files,
)


def main(
Expand All @@ -31,24 +36,26 @@ def main(
trp = Molecule.all_nuclei("tryptophan_cation")
sim = SemiclassicalSimulation([flavin, trp], basis=Basis.ZEEMAN)

# trajectory_data = read_trajectory_files("./examples/data/md_fad_trp_aot", scale=1e-10)
# trajectory_ts = (
# np.linspace(0, len(trajectory_data), len(trajectory_data)) * 5e-12 * 1e9
# )
# j = exchange_interaction_in_solution_MC(trajectory_data[:, 1], J0=5)
#
# plot_exchange_interaction_in_solution(trajectory_ts, trajectory_data, j)
#
# acf_j = autocorrelation(j, factor=1)
# zero_point_crossing_j = np.where(np.diff(np.sign(acf_j)))[0][0]
# t_j_max = max(trajectory_ts[:zero_point_crossing_j]) * 1e-9
# t_j = np.linspace(5e-12, t_j_max, zero_point_crossing_j)
#
# acf_j_fit = autocorrelation_fit(t_j, j, 5e-12, t_j_max)
# plot_autocorrelation_fit(t_j, acf_j, acf_j_fit, zero_point_crossing_j)
#
# kstd = k_STD(-j, acf_j_fit["tau_c"])
kstd = 11681368.059456564
trajectory_data = read_trajectory_files(
"./examples/data/md_fad_trp_aot", scale=1e-10
)
trajectory_ts = (
np.linspace(0, len(trajectory_data), len(trajectory_data)) * 5e-12 * 1e9
)
j = exchange_interaction_in_solution_MC(trajectory_data[:, 1], J0=5)

plot_exchange_interaction_in_solution(trajectory_ts, trajectory_data, j)

acf_j = autocorrelation(j, factor=1)
zero_point_crossing_j = np.where(np.diff(np.sign(acf_j)))[0][0]
t_j_max = max(trajectory_ts[:zero_point_crossing_j]) * 1e-9
t_j = np.linspace(5e-12, t_j_max, zero_point_crossing_j)

acf_j_fit = autocorrelation_fit(t_j, j, 5e-12, t_j_max)
plot_autocorrelation_fit(t_j, acf_j, acf_j_fit, zero_point_crossing_j)

kstd = k_STD(-j, acf_j_fit["tau_c"])
# kstd = 11681368.059456564
triplet_excited_state_quenching_rate = 5e6
recombination_rate = 8e6
free_radical_escape_rate = 5e5
Expand Down

0 comments on commit 59093c5

Please sign in to comment.