Solving ODEs with nonlinear constraints

I'm trying to solve an ODE problem. Let's say $$\mathbf{x}(t)$$ represents the position of a particle at time $$t$$, and $$\mathbf{u}(\mathbf{x},t)$$ is a velocity field defined in Cartesian coordinates on some manifold $$\mathbb{M} \subset \mathbb{R}^3$$ represented as a level set of the form $$F(\mathbf{x}) = 0$$. Then, the path taken by the particle can be given by: \begin{align} \frac{d \mathbf{x}}{d t} &= \mathbf{u}(\mathbf{x},t), \\ F(\mathbf{x}(t)) &= 0,\\ \mathbf{u}(\mathbf{x},0) &= u_0. \end{align} How do I go about solving this constrained IVP? Assume I can evaluate $$F$$ and $$\mathbf{u}$$ analytically. Are there Runge-Kutta or linear multistep methods designed for this sort of ODE with a nonlinear solution constraint?

• I'm not an expert on the field, but does that even have a solution? Without the constraint with $F$ that should already have a unique solution. If that solution does not satisfy $F(x) = 0$... Mar 22 '20 at 20:35
• I'm pretty sure that given the right constraint on $\mathbf{u}$, this should have a solution. After all, it's simply an ODE saying a particle is moving on a surface in some given velocity field. Mar 22 '20 at 20:45
• It's not an ODE I think, It's a PDE in fact, why? See here: $$\frac{d \mathbf{x}}{dt} = \mathbf{u} (\mathbf{x},t)$$ so: $$\frac{d \mathbf{u}}{dt} = \mathcal{F}(\mathbf{x},t)$$ where $\mathcal{F}(\mathbf{x},t)$ is the force field acting on your particle. You must know this force field, otherwise it's not possible to solve this problem. But you have: $$\frac{d \mathbf{u}}{d t} = \frac{\partial \mathbf{u}}{\partial t} + \mathbf{u} \cdot \nabla \mathbf{u}$$ , so finally: $$\frac{\partial \mathbf{u}}{\partial t} + \mathbf{u} \cdot \nabla \mathbf{u} = \mathcal{F}(\mathbf{x},t)$$ So it's a PDE... Mar 22 '20 at 21:14
• I already said I know $\mathbf{u}$ and $F$ analytically. However, the ODE system is in the Lagrangian frame, and there are numerical benefits to working in that frame. Mar 22 '20 at 22:33
• What you have is what's called a Differential-Algebraic equation (DAE). The form of $\mathbf u$ is then typically $\mathbf u(t)=\mathbf w(t) + \mathbf \lambda(t)$ where $\mathbf w$ is known, and $\lambda$ is a Lagrange multiplier corresponding to the constraint. The (time-dependent) Stokes equations are an example, as are many equations in mechanics. There are specialized solvers for DAEs -- which you should be able to find now that you know the correct term :-) Mar 23 '20 at 0:36