I have recently been learning Lagrangian Mechanics and wanted to apply it to a case I came up with in my head. Say you have a function f(x) that is always > 0. If a box or some solid particle was moving through space along that function, how would you describe the motion? I designed the model so that the particle originated at a $y_o$ with an initial velocity in x of $\dot {x}$ and in y of $\dot y$. With this system, the Lagrangian would be
$L = U-T = (y_o + y)mg - \frac{1}{2}m(\dot{x}^2 + \dot{y}^2) $$$L = U-T = (y_o + y)mg - \frac{1}{2}m(\dot{x}^2 + \dot{y}^2) $$ *assuming that $y=0$ is $U=0$.
This yields the results of $m\ddot{x}=0$ and $\ddot{y} = -g$. This would describe a projectile, but doesn't make sense for my model, am I missing something about Lagrangian Mechanics as a whole, or have I made a mathematical mistake?