Learn R Programming

BacArena (version 1.0.1)

diffuseR: Function for naive diffusion (neighbourhood) of the Substance matrix

Description

The generic function diffuseR implements the diffusion in the Moore neighbourhood in R.

Usage

diffuseR(object)
"diffuseR"(object)

Arguments

object
An object of class Substance.

Details

The diffusion is implemented by iterating through each cell in the grid and taking the cell with the lowest concentration in the Moore neighbourhood to update the concentration of both by their mean.

See Also

Substance-class and diffusePDE

Examples

Run this code
arena <- Arena(n=100, m=100, stir=FALSE, Lx=0.025, Ly=0.025)
sub <- Substance(n=20,m=20,smax=40,name='test',difunc='r', 
                 gridgeometry=arena@gridgeometry) #initialize test substance
diffuseR(sub)

Run the code above in your browser using DataLab