randomflowfield.Rd
Generate a matrix meant to be used as one direction of a random flow field.
randomflowfield(n, m, std_dev)
Zonal (x) extent of the flow field.
Meridional (y) extent of the flow field.
Standard deviation used for the random walk, see details.
A matrix meant to be used as one direction of a random flow field.
This function proceeds in the following way: A starting value, either 1 or
-1, is drawn at random. This is assigned to the element in the top-left
corner of the matrix. The other values are then calculated as the sum of a
normal random variable with standard deviaton std\_dev
and their left
neighbour (top row) or the mean of their left and their upper neighbour
(rest).
U = randomflowfield(30,30,0.3)
V = randomflowfield(30,30,0.3)
quiver(U,V)