Created
June 24, 2013 16:48
-
-
Save RyanHope/5851550 to your computer and use it in GitHub Desktop.
Slow Force Carbonation Functions for R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bars <- function(temp, psi) { | |
(psi+14.695)*(0.01821+0.090115*exp(-(temp-32)/43.11))-0.003342 | |
} | |
psi <- function(bars, temp) { | |
((bars+0.003342)/(0.01821+0.090115*exp(-(temp-32)/43.11)))-14.695 | |
} | |
temp <- function(bars, psi) { | |
-log(((bars+0.003342)/(psi+14.695)-0.01821)/0.090115)*43.11+32 | |
} | |
# > bars(49, 12) | |
# [1] 2.104462 | |
# > psi(2.104462, 49) | |
# [1] 12 | |
# > temp(2.104462, 12) | |
# [1] 49 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment