13import matplotlib.pyplot
as plt
19 "font.family":
"Serif",
20 "font.serif":
"Roman",
22 "axes.titlesize":
"large",
23 "axes.labelsize":
"large",
24 "xtick.labelsize":
"large",
25 "ytick.labelsize":
"large",
26 "legend.fontsize":
"medium"
28plt.rcParams.update(params)
31 V_0 = 25.*9.64852558 * 10**4
34 w_z = np.sqrt((2.*V_0)/(m*d*d))
35 return 20.*np.cos(w_z*t)
38 filename =
"output/simulate_single_particle/particle_0_r.txt"
40 with open(filename)
as f:
42 t = np.linspace(0, 50, len(lines))
43 r = np.array([list(map(float, line.strip().split(
",")))
for line
in lines])
45 fig, ax = plt.subplots()
46 ax.plot(t, r[:, 2], label=
"approximation", color=
"mediumseagreen")
47 ax.plot(t, z(t), label=
"analytical", color=
"black", linestyle=
"dotted")
48 ax.set_xlabel(
r"t $(\mu s)$")
50 ax.set_ylabel(
r"z $(\mu m)$")
51 ax.set_ylim((-25, 25))
53 ax.legend(loc=
"upper right")
54 fig.savefig(
"../latex/images/single_particle.pdf", bbox_inches=
"tight")
58if __name__ ==
"__main__":