I took an introductory MATLAB course a couple of years ago (and since then have only taken a basic C++ course) and am presently stumped as to how to start with a project I am undertaking. As part of this, I need to simulate the formation of branching structures using a branching annihilating random walk (BARW).
I am starting off with the 2D case. As a base, I have written a functioning basic script for a random walk (I really am starting with the basics!) and am trying to conceptually figure out how I will approach my task. The current idea I have is:
- Create a large array which initially has null entries, except for the first entry which is the first 'growing tip'
- Write a 'for' loop which essentially increments the time steps
- For each time step, generate a random number. Divide the values consistently with the observed branching rate (the bifurcation rate vs elongation rate can be a variable parameter here) so that if the number is, say, less than 0.5, the tip continues to grow in its current direction. Otherwise, allow the tip to bifurcate with the branches going off in different (possibly random?) angles. The array will keep track of the tips (i.e. bifurcation will update the next zero row to a non-zero row)
- I feel like it will be necessary to keep track of tip velocities here, probably in the array, and update tip propagation based on this. In this case, it no longer seems like a 'random walk'...
- I also obviously have not yet accounted for the inability of tips to cross each other, but it already seems like the steps above have problems!
Again, I apologise I do not have a code to share. I am not yet proficient enough with programming to write code as I go, and have to have a conceptual plan of what I intend to do. Of course, this doesn't help if my steps are difficult/not possible to translate into code!