Inspiration

Over the summer I did condensed matter physics research for theorists and I had wanted to attempt creating another simulation like I had that would be doable in a short period of time. Following the recommendation of the professors, I had created a simulation on polymers.

What it does

The program simulates the structure of a polymer based on a max length N and a weighting probability p. Then the program histograms the radii of the polymers against N and p and creates two scatter plots of the average radii for each N and p.

The polymer is defined on a graph as such: If all or no sites have been visited on the graph then all directions have a probability of 1/4. If one site has been visited then that site has a probability of 1/4 - 3p while the rest have a probability 1/4 + p. If two sites have been visited then the probabilities are 1/4 - p and 1/4 + p. If three sites have been visited then those sites probabilities are 1/4 - p while the last one has a probability of 1/4 + 3p. If the polymer has moved N times terminate. If the polymer has reached the edge of the graph terminate if the graph is not periodic, else wrap around.

How I built it

I programmed the simulation in C while I programmed the computations in Python.

Challenges I ran into

Initially, I had wanted to create polymers parallelly. For instance, the polymer would attempt each direction with a random number and if it was accepted the program would fork and attempt each chosen direction. However, the number of processes created were too many for my computer to handle so I had to rewrite the algorithm to be sequential.

Accomplishments that I'm proud of

I was able to create a simulation in a short time.

What I learned

The polymer's radii tend linearly increase with N while fluctuating sinusoidally with p.

What's next for Toy Model of a Polymer

Further computations for potential research and to determine the structure of a polymer.

Built With

Share this project:

Updates