diff --git a/src/config.json b/src/config.json index 080de22..82f4daf 100644 --- a/src/config.json +++ b/src/config.json @@ -1,6 +1,6 @@ { "simulation": { - "num_walker": 20, + "num_walker": 20000, "seed": null }, "molecule": { @@ -10,7 +10,10 @@ "correlation_times": { "distribution": "DeltaDistribution", "tau": { - "list": [1e2, 1e0] + "start": 1e-3, + "stop": 1e0, + "steps": 1, + "is_log": true } }, "motion": { @@ -34,7 +37,7 @@ }, "stimulated_echo": { "t_evo": { - "start": 2e-6, + "start": 10e-6, "stop": 100e-6, "steps": 98 }, diff --git a/src/rwsims/sims.py b/src/rwsims/sims.py index c486872..75083db 100644 --- a/src/rwsims/sims.py +++ b/src/rwsims/sims.py @@ -68,16 +68,18 @@ def run_ste_sim(config_file: str): ax5.semilogx(t_mix, ss/ss[0, :], '.-') for k in range(num_variables): - p0 = [0.5, 0, p.dist.variables.get('tau', 1), 1] + p0 = [0.5, 0, dist_values.get('tau', 1), 1] p_final = [] p_final1 = [] for k, t_evo_k in enumerate(p.ste.t_evo): + try: res = curve_fit(ste, t_mix, cc[:, k], p0=p0, bounds=([0, 0, 0, 0], [np.inf, 1, np.inf, 1])) p_final.append(res[0].tolist()) except RuntimeError: p_final.append([np.nan, np.nan, np.nan, np.nan]) + try: res2 = curve_fit(ste, t_mix, ss[:, k], p0=p0, bounds=([0, 0, 0, 0], [np.inf, 1, np.inf, 1])) p_final1.append(res2[0].tolist())