Skip to content

Instantly share code, notes, and snippets.

@akira093
Created November 6, 2012 07:47
Show Gist options
  • Save akira093/4023292 to your computer and use it in GitHub Desktop.
Save akira093/4023292 to your computer and use it in GitHub Desktop.
import pylab
pH = pylab.linspace(0,14,100)
pK1 = 1.23
pK2 = 4.19
H = 10 ** -pH
K1 = 10 ** -pK1
K2 = 10 ** -pK2
f1 = H**2 / (H**2 + H*K1 + K1*K2)
f2 = H*K1/(H**2 +H*K1 + K1*K2)
f3 = K1*K2/(H**2 +H*K1 + K1*K2)
pylab.plot(pH,f1,"*-",label = "H2C2O4")
pylab.plot(pH,f2,"v-",label = "HC2O4^-")
pylab.plot(pH,f3,"o-",label = "C2O4^2-")
pylab.xlabel("pH")
pylab.ylabel("ratio")
pylab.legend()
pylab.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment