Skip to content

Instantly share code, notes, and snippets.

@padpadpadpad
Last active November 8, 2018 10:53
Show Gist options
  • Select an option

  • Save padpadpadpad/e3b1942becb909aa75b3c3f60a71428d to your computer and use it in GitHub Desktop.

Select an option

Save padpadpadpad/e3b1942becb909aa75b3c3f60a71428d to your computer and use it in GitHub Desktop.
function for working out dilutions for stock solutions
# stock sol vol 2
# stock_sol_conc is the concentration of the stock solution - current OD
# new_sol_conc is the concentration of the new solution - the desired OD
# diluent vol is the volume of the diluent you want to use (i.e. the amount of water/M9)
stock_sol_vol2 <- function (stock_sol_conc, new_sol_conc, diluent_vol)
{
return((new_sol_conc * diluent_vol)/(stock_sol_conc - new_sol_conc))
}
stock_sol_vol2(0.2, 0.1, 200)
stock_sol_vol2(0.5, 0.1, 200)
stock_sol_vol2(1.2, 0.1, 200)
stock_sol_vol2(c(1.2, 0.8, 0.5), 0.1, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment