mirror of
https://gitlab.com/pimnelissen/entropic-spring.git
synced 2025-11-30 19:33:07 +01:00
move data save to beginning to avoid confusion
This commit is contained in:
8
I.py
8
I.py
@ -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)
|
|
||||||
Reference in New Issue
Block a user