0

I'm trying to find the persistence length of a polymer from a LAMMPS simulation using the polymer analysis module in MDAnalysis. However, the persistence length seems to only return 1.0 no matter which data set I give it, and the graph of the curve fitted to the data is very clearly not exactly fitted. I'm not sure if there's an issue in the data I'm feeding it, how I'm calling the function, or the way I've constructed the universe. But here's my code and a picture of the output.

Python

chain = u.atoms.fragments
chainSorted = [polymer.sort_backbone(c) for c in chain]
plen = polymer.PersistenceLength(chainSorted).run()

print("persistence length: " + str(plen.results.lp))
print("average bond length: " + str(plen.results.lb))
print("bond autocorrelation: " + str(plen.results.bond_autocorrelation))
plen.plot()

results here, both numerical and the graph of the results and 'fitted' curve

  • 1
    You can check the fit values with `self.results.fit`. See that it is simply a [scipy fit](https://github.com/MDAnalysis/mdanalysis/blob/682f5e867447b0df29e8d08fca8a16cea35bd71f/package/MDAnalysis/analysis/polymer.py#L351). If you post your x and autocorrelation values we can check if it is a poor fit. – mateuszb Jun 25 '22 at 09:12
  • This looks as if you should run your simulation for longer to get more data to fit to. By the way, you might get a more of a discussion by using one of the standard MDAnalysis discussion channels, namely the [user forum](https://groups.google.com/group/mdnalysis-discussion) or the Discord server (see [Participating in MDAnalysis](https://www.mdanalysis.org/#participating) for how to join). (We find that S/O is not particularly well suited to answer questions where we might have to ask for multiple pieces of information. Science is complicated...) – orbeckst Jun 28 '22 at 00:31

0 Answers0