Implement the kinetics:
Suggested approach:
Write a function that computes the reaction rate for a provided concentration
Write this function in such a way that the reaction rate coefficients can be passed as function argument.
Concentration column vector of length 3 as input (for components , , )
Reaction rate vector of length 3 as output
Provide an analytical expression of the concentration as function of time. Verify your codes with the analytical solution for the case , and , with initial concentration , , .
Questions:
Solve using forward Euler discretization
Solve using backward Euler discretization
Implement backward Euler discretization, but allow for extension to non-linear kinetics. Express the discretized equations for a time-step as a root-seeking problem for the non-linear set of equations (and use Newton-Raphson).
Solve using
scipy.integrate.solve_ivp.