Learn R Programming

BacArena (version 1.0.1)

diffusePDE: Function for diffusion of the Substance matrix

Description

The generic function diffusePDE implements the diffusion by the solving diffusion equation.

Usage

diffusePDE(object, init_mat, gridgeometry, lrw = NULL, tstep)
"diffusePDE"(object, init_mat, gridgeometry, lrw = NULL, tstep)

Arguments

object
An object of class Substance.
init_mat
A matrix with values to be used by the diffusion.
gridgeometry
A list specifying the geometry of the Arena
lrw
A numeric value needed by solver to estimate array size (by default lwr is estimated in simEnv() by the function estimate_lrw())
tstep
A numeric value giving the time step of integration

Details

Partial differential equation is solved to model 2d diffusion process in the arena.

See Also

Substance-class and diffuseR

Examples

Run this code
arena <- Arena(n=100, m=100, stir=FALSE, Lx=0.025, Ly=0.025)
sub <- Substance(n=100,m=100,smax=0,name='test', difspeed=0.1, 
                 gridgeometry=arena@gridgeometry) #initialize test substance
sub@diffmat[ceiling(100/2),ceiling(100/2)] <- 40
diffusePDE(sub, init_mat=as.matrix(sub@diffmat),
           gridgeometry=arena@gridgeometry, tstep=arena@tstep)

Run the code above in your browser using DataLab