Consider a simple polymer, which consists of long chains of simple molecules attached to each other, for example: ..CH-CH-CH-... If the interaction energy between consecutive sections can beignored or is low enough, the chains can be bend around at various places to form various configurations. let us make model of a simple polymer which is restricted to lie within a two-dimensional plane. one can start by fixing the first section to a particular coordinate and then add additional components by use of random walk with the condition that it may not intersect itself. it should be clear that when forming a polymer in this way, it can happen that you end up in a cul-de-sac, i.e. you can not add an additional component to lengthen it further, without intersecting with itself. when this happens the polymer is terminated. a general outline of the algorithm would be as follow: initialize an array that would be 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 "(*)" select a new direction randomly check whether the new move is allowed, by looking wether that coordinate has been visited before. if the new move is allowed, take it, and update the array. if the new move is not allowed, return to "(*)"and select a new random number when no more additional components can be added, stop the loop. 1. write a program to simulate the formulation of polymers as outlined above, by use of self-avoiding random walk. let it start at the origin, and let the walker have equal propability to movein any of the four directions: up, down, left or right. 2. repeat the move above lgorithm many times (without ploting ), to obtain a histogram on the polymer lengths that result from this simple model. also calculate the average length of all the polymers.
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.