How to set up an equation to solve a rate law computationally?
It should be set up as a series of first order ordinary differential equations like so: $$\frac{d[A]}{dt}=-k_f[A][B]^2+k_r[C]$$$$\frac{d[B]}{dt}=-2k_f[A][B]^2+2k_r[C]$$
$$\frac{d[C]}{dt}=k_f[A][B]^2-k_r[C]$$
If we substitute $[C]=[C]_0+x$, $[A]=[A]_0-x$, and $[B]=[B]_0-2x$ into these equations, they all reduce to the single equation:$$\frac{dx}{dt}=k_f([A]_0-x)([B]_0-2x)^2-k_r([C]_0+x)$$