move data save to beginning to avoid confusion

This commit is contained in:
Pim Nelissen
2025-10-27 17:48:02 +01:00
parent 8dad23931c
commit e58c9cbd87

8
I.py
View File

@ -18,7 +18,9 @@ else:
for i in range(NUM_BANDS): for i in range(NUM_BANDS):
band = RubberBand(N, a=1) band = RubberBand(N, a=1)
lengths[i] = band.length/band.a lengths[i] = band.length/band.a
np.save("data/lengths.npy", lengths)
# histogram # histogram
bin_edges = np.arange(-N-1, N+1, 2) bin_edges = np.arange(-N-1, N+1, 2)
values, _ = np.histogram(lengths, bins=bin_edges) values, _ = np.histogram(lengths, bins=bin_edges)
@ -63,6 +65,4 @@ plt.hlines(1, *xlim, color='r', linestyle='--')
plt.xlim(xlim) plt.xlim(xlim)
plt.xlabel("$L/a$") plt.xlabel("$L/a$")
plt.ylabel("$\hat{P}(L)/P(L)$") plt.ylabel("$\hat{P}(L)/P(L)$")
plt.show() plt.show()
np.save("data/lengths.npy", lengths)