For future reference. If you want constructive help from this forum, you have to play by the “rules” that the people that usually respond here have agreed upon. Just posting your script and stating that it does not do what you want and asking people to explain why is definitely not what you should do.
Please have a careful look at: Please Read This First: Guidelines and Suggestions for posting LAMMPS questions
It has “Please Read This First” in the title for a good reason.
You should particularly read (and follow!) the sections:
- Be concise and specific; do not make any assumptions about how easy it is to find a solution
- What you should not expect from this forum
- Be sure to research your problem before posting
- Your system just does what your force field, input settings, and equations of motion say
If you don’t, you are likely to get responses that are not helpful or no responses at all.
Please be mindful that people here volunteer their time and thus don’t act as if everybody was out here just to serve you every time something does not work as you expected it. This is first and foremost the job of your tutor and an online forum cannot be a replacement for that.