moles_HI(t) = moles_HI(t - dt) + (I2_to_HI + H2_to_HI - HI_to_H2 - HI_to_I2) * dt INIT moles_HI = initial_mol_HI I2_to_HI = reverse_change_of_moles H2_to_HI = reverse_change_of_moles HI_to_H2 = forward_change_of_moles HI_to_I2 = forward_change_of_moles moles_hydrogen(t) = moles_hydrogen(t - dt) + (HI_to_H2 - H2_to_HI) * dt INIT moles_hydrogen = initial_mol_H2 HI_to_H2 = forward_change_of_moles H2_to_HI = reverse_change_of_moles moles_iodine(t) = moles_iodine(t - dt) + (HI_to_I2 - I2_to_HI) * dt INIT moles_iodine = initial_mol_I2 HI_to_I2 = forward_change_of_moles I2_to_HI = reverse_change_of_moles conc_H = moles_hydrogen/total_volume conc_HI = moles_HI/total_volume conc_I = moles_iodine/total_volume forward_change_of_moles = rate_forwd*total_volume initial_mol_H2 = 0.1 initial_mol_HI = 0.1 initial_mol_I2 = 0.1 Kconst = k_forward/k_rev Keq = conc_H*conc_I/conc_HI^2 k_forward = 0.550 k_rev = 30.2 rate_forwd = k_forward*conc_HI^2 rate_reverse = k_rev*conc_I*conc_H reverse_change_of_moles = rate_reverse*total_volume total_moles = moles_HI+moles_hydrogen+moles_iodine total_volume = 1