Suppose, a polymer has N monomers in its chain. I want to simulate its movement using the bead-spring model.
So, I wrote the following program in Python.
I am using 0.1 million steps. The energy is not fluctuating as expected. After several steps, the curve goes totally flat.
The X-axis is steps. Y-axis is total energy.
Can anyone check the source code and tell me what I should change?
N.B. I am especially concerned with the function that calculates the total energy of the polymer.