%example 1 equations function dYdt = ex1_equations(t,Y,params) %this function defines the ODEs describing the bimolecular %reaction from exercise 1 L = Y(1); R = Y(2); Rstar = Y(3); C = Y(4); k1on = params(1); k1off = params(2); k2on = params(3); k2off = params(4); k3off = params(5); dLdt = -k2on*L*R + k2off*C; dRdt = -k2on*L*R + k2off*C - k1off*R + k1on*Rstar; dRstardt = -k1on*Rstar + k1off*R; dCdt = k2on*L*R - k2off*C - k3off*C; dYdt = [dLdt; dRdt; dRstardt; dCdt];