Question: Polymer simulation

Hi! I need help with my project I dont know where to even start!

Question:

Consider a simple polymer , which consist of long chains of simple molecules attached to each other, e.g:

....-CH2-CH2-CH2-...

If the interaction energy between consecutive sections ca be ignored or is low enough, the chain can be bend around at varios places to form varios configurations. One can start by  fixing the first section to a particular co-ordinate and then add additional components by use of random walk with the condition that it may not intersect itself.

General outline of the algorithm:

  • Initialize an array that would keep track of all the positions of the random walker
  • Start the random walk at a given coordinate
  • After each move, the array storing the visited positions needs to be updated
  • While it is still possible to add extra components to the polymer repeat the following

                a) (*) Select a new direction randomly

                b) Check whether the new move is allowed, by looking whether that coordinate has been visited                              before.

                             - If the new move is allowed, take it, and update the array

                             - Id the new move is not allowed, returen to (*) and select a new random number

                c) When no more additional components can be added, stop the loop.

1. Write a program to simulate the formation of the polymer as outlined, by use of a self avoiding random walk. Let it start at the origin, and let the walker have equal probability to move in any of the for directions: Up, Down, Left and Right. You need to keep track of all the coordinates visited, so that it can be checked whether a new move will not result in an intersection.

   Hint: Create a two dimentional array, which is similar to a matrix, to all the positions visited by the random walker.

Make a few plots of the resulting polymers that you have generated. Also calculate the total length of the polymer in your program

2.Repeat the above algorithm many times (without ploting the polymer structures), to obtain a histogram on the polymer lengths that result from this simple model. also calculate the average length of all the polymers.

Sorry for such a long question, but thoughted it was good to writte almost everything. Thanks!!!

 

Please Wait...