You can discretize these equations by several methods, such as Euler forward, backward, or implicit Euler schemes, Runge-Kutta or Heun. You can find a description, for example, in the attached article.
Technical Report Modern Nonlinear Optimization Techniques for an Optimal Cont...