PH3110 BSc projects / PTD


This TWiki topic collects some information that is relevant to the numerical simulation projects for PH3110 that are supervised by PTD.

Program structure / Flowchart

When developing a new computer program, it is essential to plan the main structure of the program before starting to actually write any code. Good code is modular and well documented. One key tool to help plan the structure of a computer program is to prepare a flowchart for the whole program, highlighting the main tasks/algorithms that the code will perform and the order they will be performed in. Separate additional flowcharts can also be used to provide further detail on certain parts of the code (eg if they are quite complex, and need a flowchart in their own right).

The following web pages introduce the basic ideas and conventions behind computer program flowcharts, with examples:

Random walks

One of the projects offered involves particles doing a random walk in two dimensions. More information about random walks (and an animation of a 2D random walk) can be found in the following:

One of the initial goals of the project could be to establish that the random walk used in the project does conform to the expected statistical properties of a truly random walk: eg that the expectation value of the distance travelled by particles after n steps is zero, and that the expectation value of the distance squared is n (or, equivalently, that the rms distance is √n). Students could compare the standard 2D random walk (where particles can only move up/down/left/right) vs a random walk where, in addition, 4 diagonal movements are also allowed (NW, NE, SW, SE). The latter is preferred for the nuclear fission project because it means that in the finest chessboard configuration (where the four nearest-neighbours of an M (F) cell are all F (M) cells) a neutron can move to either a F or M cell. The former means that in this same pile configuration the neutron will always move from to a cell of different type from the type of the cell in its initial position with 100% probability: i.e., always from M to F, or from F to M.

A random walk is an example of a Markov chain process.


-- Pedro Teixeira Dias - 18 May 2021


Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r6 - 15 Dec 2021 - PedroTeixeiraDias

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback