I have a system of $N$ ODEs of the form, $$ M(z,F(z)) \cdot F'(z) = \Phi(z,F(z)) $$ where the mass matrix is $M(z,F): R\times R^N \to R^{N\times N}$ and $\Phi(z,F):R\times R^N \to R^N$ is (potentially) nonlinear. The initial condition is $F(0) = 0_N$. I need to solve this for an arbitrarily large $z$, but it is stationary so I can choose some $z_{\max}$.
A few notes:
- $M(z,F)$ is diagonal but it is asymptotically singular (i.e., as $z\to\infty$, a few of the diagonals approach $0$). This is why I left it in the mass matrix form, but I could just as easily write it as a $F'(z) = \Phi(z,F)$ form by dividing by the diagonal.
- This comes from a stationary Kolmogorov Forward equation in CDFs $F(z)$ (where the $N$ equations are an additional discrete state in the distribution, but I don't think that really matters here). This leads to a few crucial requirements on the solution:
- $F(0) = 0_N$ since the minimum of support of the distribution is at $0$
- Weak Positivity: $F(z) \geq 0$ for all $z$ to be a valid CDF, where the only $0$ in practice will be at the initial condition.
- Weak Monotonicity: $F'(z) \geq 0$ for all $z$, since PDFs can't be negative.
- Convergence: $\lim_{z\to\infty}F(z) < \infty$ to ensure that this is a valid CDF. (In reality, $\lim_{z\to\infty}\sum_{n=1}^{N}F_n(z) = 1$, but I can deal with this through other means)
Is this an IVP or a BVP? Without explaining the details of the setup, the short answer is that I can choose whichever is more convenient and robust.
QUESTION: What is the best numerical algorithm (or transformation of the ODE) to solve this problem? In particular, I would love to maintain positivity and monotonicity, and I suspect that the convergence requirement is making the problem stiff as $z$ gets large (which could also be related to the singular mass matrix).
I am willing to sacrifice speed (and even accuracy) for robustness here, but would prefer to use an algorithm with off-the-shelf software.