RUBRIC: Complete the coding task outlined below. You may use any materials available on the WWW before the examination begins, and any material in your CPlab home directory. You may not communicate with any other person by any means whatsoever (including email, webmail etc.).
Duration: 3 hours
Explanation of your work should be written in the green examination script. At the end of the examination you should also email your code and and electronic pictures to graeme@ph.ed.ac.uk
A 2D semiconductor comprises a plane of atoms 50 wide located on a square lattice in the xy plane. Electrons are emitted from the y=0 plane and diffuse at random from site to adjacent site through the lattice. Holes are produced at the y=49 plane and similarly diffuse at random through the lattice. Periodic boundary conditions exist in the x-direction. Electrons are forbidden from moving to a site already occupied by an electron, and a similar exclusion holds for holes. If an electron moves onto a site occupied by a hole, both are destroyed, if either electron or hole reaches the y-boundary, it is absorbed. Write a code to simulate the motion of electrons and holes in this system. Your code should include changeable parameters to describe:
N the number of electrons added per timestep at y=0
P the number of holes added per timestep at y=49,
D_n the rate of diffusion of the electrons (probability that the electron attempts to move to an adjacent site)
D_p the rate of diffusion of the holes. You should include a graphical representation of the motion of holes and electrons, and write a full description of how a user could use the code (you do not need a line-by-line commentary of your code to show how it works). Half of the marks will be awarded to the working and usable code. Describe the design criteria which you have chosen (updating method, graphics, analysis code etc.) Investigate the conduction of charge in the following cases. 1) N=P=1 D_n=1: how does conduction vary with D_p ?
2) N=1 D_n=1 D_p=1: how does conduction vary with P ?
3) N=1 P=1 D_n=1 D_p=1: how do the concentrations of electrons and holes vary as a function of y? (Make or sketch a graph)
4) How does the graph in part (3) vary as N goes from 0 to 50, and P=N.
Half of the marks will be awarded for the answers to these questions, you should describe what you calculated to obtain your results.