diffcoeff(S = 15, t = 15)/(1e4*3600*24) # cm2/day
diffcoeff(t = 10, species = "O2") # m2/s
difftemp <- diffcoeff(t = 0:30)[,1:13]
matplot(0:30, difftemp, xlab = "temperature", ylab = "m2/s",
main = "Molecular/ionic diffusion", type = "l")
legend("topleft", ncol = 2, cex = 0.8, title = "mean", col = 1:13, lty = 1:13,
legend = cbind(names(difftemp),
format(colMeans(difftemp), digits = 4)))
select <- c("O2", "CO2", "NH3", "NH4", "NO3")
diffsal <- diffcoeff(S = 0:35, species = select)
matplot(0:35, diffsal,xlab = "salinity", ylab = "m2/s",
main = "Molecular/ionic diffusion", type = "l")
legend("topleft", ncol = 2, cex = 0.8, title = "mean",
col = 1:length(select), lty = 1:length(select),
legend = cbind(select, format(colMeans(diffsal), digits = 4)))
Run the code above in your browser using DataLab