# I Confusion with Lagrangian function in a calculation example

1. Nov 6, 2016

### zhouhao

There is waterpipe with smooth interior wall as shown in the figure.The curve of waterpipe could be describe as function $q_y=f(q_x)$.
A ball going through this pipe was put at $O$ point with zero initial speed.At the point $(q_x,q_y)$,the speed of the ball could be decomposed as $(\dot{q_x},\dot{q_y})$.What's more,$${\dot{q}_y}=\tan{\theta}{\dot{q}_x}=f'(q_x)\dot{q}_x \text{ } {(1)}$$.Motion energy function is $$T=\frac{1}{2}m{{\dot{q}}_x}^2+{\frac{1}{2}}m{{\dot{q}}_y}^2$$Potential function is $$V=-mg{q_x}$$ Lagrange function $$L=T-V={\frac{1}{2}}m{{\dot{q}}_x}^2+{\frac{1}{2}}m{\dot{q_y}}^2+mg{q_x} \text{ } {(2)}$$ Substituting equation (1) into equation (2),we get$$L=\frac{1}{2}m\{1+[f'(q_x)]^2\}{{\dot{q}}_x}^2+mg{q_x}$$Now,we calculate lagrange equation$$\frac{d}{dt}(\frac{{\partial}L}{{\partial}q_x})-\frac{{\partial}L}{{\partial}{q_x}}=0$$It could be get $$m\{1+[f'(q_x)]^2\}{\ddot{q}}_x+m{\dot{q}_x}^2{f'(q_x)}{f''(q_x)}-mg=0 {(3)}$$As shown in right part of figure,at point$(q_x,q_y)$ of curve,the force taking effect is $mg\cos{\theta}$,then decomposing this force at $q_x$ direction,we get$$m{\ddot{q}_x}=mg{{\cos}^2{\theta}}=mg(1+{\tan}^2{\theta})=\frac{mg}{1+[f'(q_x)]^2} \text{ }{(4)}$$Substitubing equation (4) into equation (3),we get $$m{\dot{q}_x}^2{f'(q_x)}{f''(q_x)}=0$$
This is not reasonable.
I have no idea how to explain the last equation.Is there something wrong with my force analysis?

2. Nov 7, 2016

### vanhees71

I've no clue, how you come to Eq. (4). The Lagrangian contains everything you need to derive the equation of motion. Also note that energy is conserved, because the Lagrangian is no explicitly time dependent. That should be sufficient to solve the equation of motion up to integrations.

3. Nov 7, 2016

### zhouhao

Thank you.I get equation (4) in this way(equation (4) is not right,which I just find):

Decomposing Gravity into two directions parallel and perpendicular with the curve,perpendicular force would be eliminated and only force parallel to the curve left.The parallel force is the total force,if decomposing the total force into $q_x$ direction,I got equation (4).-------------This is not correct,I have mistaken the total force.
I guess Lagrangian equation should be modified as $$\frac{d}{dt}(\frac{{\partial}L}{{\partial}{\dot{q}_x}})-\frac{{\partial}L}{\partial{q}}=Q_{q_x}$$$$Q_{q_x}\text{is the constrain force decomposed into }q_x \text{ direction}$$

However,how to make the Hamilton's principle take effect here,if we modified the Lagrangian equation?
My aim is not just solve an example,but to find how to through Hamilton's principle{$L(q,\dot{q},t)$} and Fermat's principle{$t(q,\frac{dq}{dq'},q')$} to describe a electron's action or nuclear action.
Thank you.

Last edited: Nov 7, 2016
4. Nov 7, 2016

### vanhees71

You have a holonomous constraint, $q_y=f(q_x)$, and thus you can write down the Lagrangian you did. Then there's one equation of motion
$$\frac{\mathrm{d}}{\mathrm{d}t} \frac{\partial L}{\partial \dot{q}_x}-\frac{\partial L}{\partial q_x}=0.$$
Alternatively you could use the Lagrangian (2) together with the constraint and use the method of Lagrange multipliers (in this case of course there's only one Lagrange multiplier since there's only one constraint). Then you also get the constrain forces.