# Constant
MM = 294 # Molar mass, K2Cr2O7
# Variables
v_eff = 25 # cm ^ 3, effluent
v = 8.3 # cm ^ 3, K2Cr2O7
M = 0.001 # M, K2Cr2O7
# Solution
w_O = v * 8 * 6 * M / 1000.
print "8.3 cm^3 of 0.006 N K2Cr2O7 =", "{:.3e}".format(w_O), "g of O2"
print "25 ml of the effluent requires", "{:.3e}".format(w_O), "g of O2"
cod = w_O * 10 ** 6 / 25.
print "1 l of the effluent requires", "{:.2f}".format(cod), "g of O2"
print "COD of the effluent sample is", "{:.2f}".format(cod), "ppm or mg / L"
# Variables
v0 = 30 # cm^3, effluent
v1 = 9.8 # cm^3, K2Cr2O7
M = 0.001 # M, K2Cr2O7
# Solution
O_30eff = 6 * 8 * v1 * M
print "So 30 cm^3 of effluent contains =", "{:.4f}".format(O_30eff), "mg of O2"
cod = O_30eff * 1000 / 30.
print "1 l of the effluent requires", cod, "mg of O2"
print "COD of the effluent sample =", cod, "ppm"
# Variables
v0 = 25 # ml, sewage
d0_O = 410 # ppm, dissolved oxygen
d1_O = 120 # ppm, dissolved oxygen
v1 = 50 # ml, sewage
# Solution
print "BOD = (DOb - DOi) * Dilution Factor"
print "BOD = (DOb - DOi) *",
print "(ml of sample after dilution) / (ml of sample before dilution)"
BOD = (d0_O - d1_O) * (v1 / v0)
print "BOD =", BOD, "ppm"