# 拉格朗日方程式

## 定義

${\displaystyle {\frac {d}{dt}}{\frac {\partial {\mathcal {L}}}{\partial {\dot {\mathbf {q} }}}}-{\frac {\partial {\mathcal {L}}}{\partial \mathbf {q} }}=\mathbf {0} \,\!}$

## 導引

${\displaystyle \mathbf {y} (x)=(y_{1}(x),\ y_{2}(x),\ \ldots ,y_{N}(x))\,\!}$
${\displaystyle {\dot {\mathbf {y} }}(x)=({\dot {y}}_{1}(x),\ {\dot {y}}_{2}(x),\ \ldots ,\ {\dot {y}}_{N}(x))\,\!}$
${\displaystyle f(\mathbf {y} ,\ {\dot {\mathbf {y} }},\ x)=f(y_{1}(x),\ y_{2}(x),\ \ldots ,\ y_{N}(x),\ {\dot {y}}_{1}(x),\ {\dot {y}}_{2}(x),\ \ldots ,\ {\dot {y}}_{N}(x),\ x)\,\!}$

${\displaystyle \mathbf {y} (x)\in (C^{1}[a,\ b])^{N}\,\!}$使泛函${\displaystyle J(\mathbf {y} )=\int _{a}^{b}f(\mathbf {y} ,\ {\dot {\mathbf {y} }},\ x)dx\,\!}$取得局部平穩值，則在區間${\displaystyle (a,\ b)\,\!}$內，歐拉-拉格朗日方程式成立：

${\displaystyle {\frac {d}{dx}}\left({\frac {\partial }{\partial {\dot {y}}_{i}}}f(\mathbf {y} ,\ {\dot {\mathbf {y} }},\ x)\right)-{\frac {\partial }{\partial y_{i}}}f(\mathbf {y} ,\ {\dot {\mathbf {y} }},\ x)=0\ ,\qquad \qquad \qquad \qquad i=1,\ 2,\ \ldots ,\ N\!}$

• 設定獨立變數${\displaystyle x\,\!}$為時間${\displaystyle t\,\!}$
• 設定函數${\displaystyle y_{i}\,\!}$為廣義坐標${\displaystyle q_{i}\,\!}$
• 設定泛函${\displaystyle f(\mathbf {y} ,\ {\dot {\mathbf {y} }},\ x)\,\!}$為拉格朗日量${\displaystyle {\mathcal {L}}(\mathbf {q} ,\ {\dot {\mathbf {q} }},\ t)\,\!}$

${\displaystyle {\frac {d}{dt}}{\frac {\partial {\mathcal {L}}}{\partial {\dot {\mathbf {q} }}}}-{\frac {\partial {\mathcal {L}}}{\partial \mathbf {q} }}=\mathbf {0} \,\!}$
• 為了滿足這轉換的正確性，廣義坐標必須互相獨立，所以，這系統必須是完整系統。
• 拉格朗日量是動能減去位勢，而位勢必須是廣義位勢。所以，這系統必須是單演系統。

## 半完整系統

${\displaystyle g_{i}(\mathbf {q} ,\ {\dot {\mathbf {q} }})=0\ ,\qquad \qquad \qquad i=1,\ 2,\ 3,\ \dots n\,\!}$

${\displaystyle \sum _{i=1}^{n}\ \lambda _{i}g_{i}=0\,\!}$

${\displaystyle {\frac {d}{dt}}{\frac {\partial {\mathcal {L}}}{\partial {\dot {\mathbf {q} }}}}-{\frac {\partial {\mathcal {L}}}{\partial \mathbf {q} }}={\boldsymbol {\mathcal {F}}}\,\!}$

${\displaystyle N\,\!}$個廣義力運動方程式加上${\displaystyle n\,\!}$個約束方程式，給出${\displaystyle N+n\,\!}$個方程式來解${\displaystyle N\,\!}$個未知廣義坐標與${\displaystyle n\,\!}$個拉格朗日乘子。

## 實例

### 自由落體

${\displaystyle {\ddot {x}}=g\,\!}$

${\displaystyle T={\frac {1}{2}}mv^{2}\,\!}$

${\displaystyle V=-mgx\,\!}$

${\displaystyle {\mathcal {L}}=T-V={\frac {1}{2}}m{\dot {x}}^{2}+mgx\,\!}$

${\displaystyle {\mathcal {L}}\,\!}$代入拉格朗日方程式，

${\displaystyle 0={\frac {d}{dt}}{\frac {\partial {\mathcal {L}}}{\partial {\dot {x}}}}-{\frac {\partial {\mathcal {L}}}{\partial x}}=m{\frac {d{\dot {x}}}{dt}}-mg\,\!}$

${\displaystyle {\ddot {x}}=g\,\!}$

### 具有質量的移動支撐點的簡單擺

${\displaystyle T={\frac {1}{2}}M{\dot {X}}^{2}+{\frac {1}{2}}m\left({\dot {x}}^{2}+{\dot {y}}^{2}\right)\,\!}$

${\displaystyle V=-mgy\,\!}$

${\displaystyle {\mathcal {L}}={\frac {1}{2}}M{\dot {X}}^{2}+{\frac {1}{2}}m\left({\dot {x}}^{2}+{\dot {y}}^{2}\right)+mgy\,\!}$

${\displaystyle x=X+l\sin \theta \,\!}$
${\displaystyle y=l\cos \theta \,\!}$

${\displaystyle {\mathcal {L}}={\frac {1}{2}}M{\dot {X}}^{2}+{\frac {1}{2}}m\left[\left({\dot {X}}+l{\dot {\theta }}\cos \theta \right)^{2}+\left(l{\dot {\theta }}\sin \theta \right)^{2}\right]+mgl\cos \theta \,\!}$

${\displaystyle {\frac {d}{dt}}\left[(M+m){\dot {X}}+ml{\dot {\theta }}\cos \theta \right]=0\,\!}$

${\displaystyle (M+m){\ddot {X}}+ml{\ddot {\theta }}\cos \theta -ml{\dot {\theta }}^{2}\sin \theta =0\,\!}$

${\displaystyle p_{X}=(M+m){\dot {X}}+ml{\dot {\theta }}\cos \theta =K_{1}\,\!}$

${\displaystyle {\frac {d}{dt}}\left[m(l^{2}{\dot {\theta }}+{\dot {X}}l\cos \theta )\right]+m({\dot {X}}l{\dot {\theta }}+gl)\sin \theta =0\,\!}$

${\displaystyle {\ddot {\theta }}+{\frac {\ddot {X}}{l}}\cos \theta +{\frac {g}{l}}\sin \theta =0\,\!}$

## 參考文獻

1. ^ Goldstein, Herbert. Classical Mechanics 3rd. United States of America: Addison Wesley. 1980: pp. 46–47. ISBN 0201657023 （英语）.