Hello guys, i would like to submit a "physical modelling problem" which i'm facing.

Suppose you have the following configuration space:

$$C = \left\{ q \in \mathbb{R} | -\frac{l}{2} \leq q \leq \frac{l}{2} \right\}$$

These DOG (Degree Of Freedom) describe the position of a material point inside a rod of length $$l$$.

My problem is to make a newtonian model which describes immediate cancelletation of the velocity when the material point reaches the extremal point of the set.

Namely from a maths point of view, because then i want to derive a differential equation to solve, for obtain the trajectory of the material point.

From a side have the idea of use the distribution theory, but from the other side i think is a complicated way to model such situation.

Can you help me in model such system?