Hi all,

I need to solve the following system of chemical reaction equations:

psi_A = c_A + c_C
psi_B = c_B + c_C
c_C = k1*c_A*c_B

where psi_A, psi_B, and k1 are known. c_A, c_B, and c_C are the unknowns I need to solve.

k1 is a scalar and psi_A, psi_B, c_A, c_B, and c_C are vectors of size N.

psi_A and psi_B have been obtained through advection-diffusion equations. I need to "post-process" these solutions such that I get c_A, c_B, and c_C. The above system of equations are on a node-to-node basis (i.e., the reactions of node i are independent of node i+1).

I could use scipy's fsolve to solve the above equations but I was wondering if there's an easy way to express and solve the above using the features of firedrake and/or its dependencies (e.g., petsc, petsc4py, etc).

Thanks,
Justin