I am dealing with a code to solve a system of ODE (in most cases with 60-100 states) that a former colleague developed. The ODE try to model some metabolic pathways with many states representing intra- and extracellular concentrations. The problem I am facing (among others) is that some of those states can take values of very different order of magnitude (say from 1e-8 to 1). Their actual value is difficult to predict a priori. My colleague's solution was to use ode113 with quite stringent relative and absolute tolerances. I was wondering if it was possible to use any kind of variable transformation to make the states absolute value more comparable (even though losing some relative accuracy). Or if this kind of solution would make the problem worse.The ode system can be in general written as:$$ \frac{dC_i}{dt}=D(C_i^{IN} - C_i)+r_i \quad i=1,2,...n $$ where $r_i$ is generally very nonlinear and depends on many of the states and $D$ is the dilution factor1st IdeaI thought of making a variable transformation such as:$$ Y_i=log(C_i) \text{ and } \frac{1}{C_i}\frac{dC_i}{dt}=\frac{dY_i}{dt} $$that would transform the system of ODE into: $$ \frac{dY_i}{dt}=\frac{1}{C_i}D(C_i^{IN} - C_i)+\frac{r_i}{C_i}$$ but knowing that $C_i$ can be very small I don't think it is a good idea to divide by such a small number. 2nd IdeaI also considered just using a normalisation factor that would bring all the states close to one, but as I said, it is difficult to predict the actual value of the states.Any advice, idea?
Variable transformation for ode system with states of different magnitude order
matlab;ode;accuracy