The dynamical equation for a ball bouncing on a plate (located at $x=0$) can be represented as $$ \ddot{x}(t) = -g - (k_1 x + k_2 \dot{x})H(-x), $$ where $H(x)$ is a heaviside step function and the collisions between the ball and the plate are represented with a spring-dashpot model. I would like to solve this equation for $x(0) = x_0$ and $\dot{x}(0) = v_0$. One can solve this by calculating the velocity and time of the first collision, evaluating the Newtonian dynamics during the collision, then repeating this process iteratively through collisions. Obviously the resulting piecewise trajectory would be something like the following:
This approach is somewhat unsatisfactory because I would ideally like to solve for the trajectory $x(t)$ at any arbitrary time, and this approach only yields a piecewise solution. A priori I do not know how many collisions have occurred up to a given time at which $x(t)$ is desired, so I would need to iterate an arbitrary number of times to find a solution.
I wonder if there are specialized approaches to solve such ordinary differential equations analytically. The above equation is nonlinear and defined only in the sense of a distribution (since $H(x)$ is not exactly a function). Clearly the solution exhibits discontinuities. Are there any approaches I might read about to better understand such equations or solve such equations with more powerful tools than piecewise integration?