# ODE with inequality constraint

I have the Lagrangian $$L(u,u';z)$$ where $$D$$ is the spacetime dimension, $$m_0$$ is some initial mass (constant), and $$C$$ is another constant.

$$L = \frac{1}{z^{D-1}}\sqrt{-u'(z) \left( f(u,z) u'(z) + 2\right)}$$

where

$$f(u,z) = 1 - m(u) z^{D}, \qquad m(u) = \left(\frac{D}{C u(z) + D\;m_0^{-1/D} }\right)^D, \qquad \frac{du}{dz} = u'$$

The Euler-Lagrange equation leads to a 2nd-order ODE (most likely nonlinear),

$$\frac{d}{dz} \frac{\partial L}{\partial u'} = \frac{\partial L}{\partial u} \quad \rightarrow \quad \mathbb{2nd -order \: ODE}$$

with boundary conditions $$u(0) = a$$ and $$u'(z_s) = \infty$$, where $$a$$ is some fixed number while $$z_s$$ is a parameter that I want to vary in the end to see how $$u(z)$$ changes. Typically, the boundary points of u(z) are specified at some known boundary $$z$$ points. Here, I only know for sure that one endpoint is at $$z=0$$ but the other is at $$z=z_s$$ for which $$z_s$$ can be varied to study how $$u(z)$$ changes, specifically I want to find which $$z_s$$ will give a minimum solution for $$u(z)$$, i.e. you could say that the minimum out of the set of minimum solutions that came from the E-L equation for a set of specified $$z_s$$.

In addition to the 2nd-order ODE, there is also an inequality constraint,

$$\frac{D}{C} \left( z_s - m_0^{-1/D}\right) > u(z)$$

I have scanned the web for some information about this including adding a slack and converting an inequality to an equality constraint. However, material is quite scarce when it comes to ODEs, or maybe I'm just ignorant of some things. When thinking about constraints, the Lagrange multiplier immediately comes to mind, however, for the E-L equation the multiplier method does not work for inequality constraints.

My questions are,

• Suppose I choose a particular $$z_s$$ to completely fix the bc condition, how can I solve an ODE with inequality constraint?
• Is there a more general method that incorporates the variability of $$z_s$$?

*I can work with Mathematica and have some basic understanding of say, the shooting method.

1. If one defines the momentum $$p:=\frac{\partial L}{\partial u^{\prime}}$$ then OP's final boundary condition (BC) $$u^{\prime}(z_s)=\infty$$ for $$z_s$$ fixed does generically not become a natural BC $$p(z_s)=0$$. Together with the initial BC $$u(0)=a$$, which is an essential/Dirichlet BC, this is not a well-posed variational problem.
2. Concerning OP's second part with the same ODE and 2 BCs but keeping the position $$z_s$$ of the final endpoint free, one would generically have to impose another final BC to have a well-posed variational problem, typically involving a conjugate variable to $$z_s$$.