Chemical Reactions
Model a chemical process of two species, FLB and ZHU, which are continuously mixed with carbon dioxide.
Fin = klA (pCO2 / H - CO2[t]);r1 = k1 FLB[t]^2CO2[t]^0.5;
r2 = k2 FLBT[t] ZHU[t];
r3 = (k2 / KK)FLB[t] ZLA[t];
r4 = k3 FLB[t]ZHU[t]^2 CO2[t];
r5 = k4 FLBZHU[t]CO2[t]^0.5;The governing equations for the rate of change of concentrations of each chemical species depend on the rate equations and the reactions:
eqns = {FLB'[t] == -2 r1 + r2 - r3 - r4, CO2'[t] == -0.5 r1 - r4 - 0.5r5 + Fin, FLBT'[t] == r1 - r2 + r3, ZHU'[t] == -r2 + r3 - 2 r4, ZLA'[t] == r2 - r3 + r5};eqEqn = Ks FLB[t] ZHU[t] == FLBZHU[t];params = {k1 -> 18.7, k2 -> 0.58, k3 -> 0.09, k4 -> 0.42, KK -> 34.4, klA -> 3.3, Ks -> 115.83, pCO2 -> 0.9, H -> 737};ics = {FLB[0] == 0.444, CO2[0] == 0.00123, FLBT[0] == 0, ZHU[0] == 0.007, ZLA[0] == 0};sol = NDSolve[{eqns, eqEqn, ics} /. params, {FLB, ZHU, CO2, ZLA}, {t, 0, 200}];plots = Plot[Evaluate[#[t] /. sol], {t, 0, 200}, PlotRange -> All, PlotLabel -> #[t]]& /@ {FLB, ZHU, CO2, ZLA};GraphicsGrid[Partition[plots, 2]]