oxysat = function(S, t){
#Variables from Garcia & Gordon (1992) Table 1
Ts <- log((298.15 - t)*(273.15 + t)**(-1))
A0 <- 5.80818
A1 <- 3.20684
A2 <- 4.11890
A3 <- 4.93845
A4 <- 1.01567
A5 <- 1.41575
B0 <- -7.01211 * 10**(-3)
B1 <- -7.25958 * 10**(-3)
B2 <- -7.93334 * 10**(-3)
B3 <- -5.54491 * 10**(-3)
C0 <- -1.32412 * 10**(-7)
#Equation 8 from Garcia & Gordon (1992) with typo fixes
lnCOs <- A0 + A1*Ts + A2*Ts**2 + A3*Ts**3 + A4*Ts**4 + A5*Ts**5 + S*(B0+B1*Ts + B2*Ts**2 +
B3*Ts**3) + C0*S**2
#Turn CO from log form to absolute value
COs <- exp(lnCOs)
#Return both log form and absolute value
rets <- list("lnCO" = lnCOs, "CO" = COs)
return(rets)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.