# (c - c0) / (c∞-c0) = erf(z/sqrt(4Dt))# where:# c = concentration of the diffusing substance, at a position within the slab# c0 = concentration of the diffusing substance, at the slab’s surface# c∞ = concentration of the diffusing substance, deep within the slab# z = depth within the slab at which ‘c’ is measured# D = diffusion coefficient of the substance within the slab# t = time since diffusion beganvar('c c0 cinf z D t')
c0=1# arbitrary units; saturationcinf=0# system is initially anaerobicD=0.00002# O2 in H2O; cm2/sa=plot([])foriinrange(1,20):t=i*86400/4# in seconds; 86400s/dayc=(cinf-c0)*erf(z/sqrt(4*D*t))+c0a+=plot(c,z,(0,10))show(a)
t=i*86400/4# in seconds; 86400s/dayc=(cinf-c0)*erf(z/sqrt(4*D*t))+c0int(integrate(c,z,0,10))