Solution of a first- and second-order consecutive reaction scheme
Look for equation solvers in Numpy/ Scipy and load at the top of your script scipy.integrate import odeint and import numpy as np . There are examples of how to numerically solve differential equations in the examples and on line. The Master equation approach does not work for second order steps. There is also the Gillespie method which is a sort of Monte-Carlo method see this answer which has an example code Probability of the single molecule reaction to happen