物理學 - 經典力學
上一頁 上一級 下一頁
在牛頓力學中,機械系統總是由質點或剛體組成,它們受到已知力的作用。因此,必須指定系統的組成以及作用在各個物體上的力的性質。然後,為系統編寫運動方程。以下是一些關於如何在牛頓力學中描述機械系統的示例(這些示例您在學校物理課上肯定都學過)。
這是所有機械系統中最簡單的一個:一個不與任何其他物體相互作用且不受任何力的質點。引入座標 x , y , z {\displaystyle x,y,z} 來描述質點的位置。由於力始終等於零,因此運動方程為 x ¨ = 0 , y ¨ = 0 , z ¨ = 0 {\displaystyle {\ddot {x}}=0,{\ddot {y}}=0,{\ddot {z}}=0} 。這些方程的通解描述了勻速直線運動: x = x 0 + v x t {\displaystyle x=x_{0}+v_{x}t} ,等等。
物理彈簧示例
兩個物體可以沿一條線( x {\displaystyle x} 軸)無摩擦地移動。質量 m 1 {\displaystyle m_{1}} 透過彈簧連線到牆上,質量 m 2 {\displaystyle m_{2}} 透過彈簧連線到質量 m 1 {\displaystyle m_{1}} 。兩個彈簧的彈簧常數均為 k {\displaystyle k} ,未拉伸長度為 L {\displaystyle L} 。
為了寫出運動方程,我們首先引入兩個座標 x 1 , x 2 {\displaystyle x_{1},x_{2}} ,然後考慮作用在兩個質量上的力。作用在質量 m 1 {\displaystyle m_{1}} 上的力是左側彈簧向左的力 F 1 {\displaystyle F_{1}} 和右側彈簧向右的力 F 2 {\displaystyle F_{2}} 的和。作用在 m 2 {\displaystyle m_{2}} 上的力是向左的 F 2 {\displaystyle F_{2}} 。根據“彈簧”的定義,我們有 F 1 = k ( x 1 − L ) {\displaystyle F_{1}=k(x_{1}-L)} 和 F 2 = k ( x 2 − x 1 − L ) {\displaystyle F_{2}=k(x_{2}-x_{1}-L)} 。因此,我們寫出兩個質量的加速度 a 1 , a 2 {\displaystyle a_{1},a_{2}} 的方程。
a 1 = x 1 ¨ = F 2 − F 1 m 1 = k m 1 ( x 2 − x 1 − L ) − k m 1 ( x 1 − L ) , {\displaystyle a_{1}={\ddot {x_{1}}}={\frac {F_{2}-F_{1}}{m_{1}}}={\frac {k}{m_{1}}}(x_{2}-x_{1}-L)-{\frac {k}{m_{1}}}(x_{1}-L),}
a 2 = x 2 ¨ = − F 2 m 2 = − k m 2 ( x 2 − x 1 − L ) . {\displaystyle a_{2}={\ddot {x_{2}}}=-{\frac {F_{2}}{m_{2}}}=-{\frac {k}{m_{2}}}(x_{2}-x_{1}-L).}
至此,我們完成了對系統的描述;現在我們需要針對特定的初始條件求解這些方程,並確定該系統的實際運動。
機械系統的拉格朗日描述 則有所不同:首先,我們不尋求給定初始條件下系統的演化,而是假設系統在兩個不同時刻 t 1 {\displaystyle t_{1}} 和 t 2 {\displaystyle t_{2}} 的位置是已知且固定的。為方便起見,我們將所有座標(例如 x , y , z {\displaystyle x,y,z} 或 x 1 , x 2 {\displaystyle x_{1},x_{2}} )收集到一個“廣義座標”陣列中,並用 q i {\displaystyle q_{i}} 表示。因此,我們對系統施加的“邊界條件”為 q i ( t 1 ) = A i {\displaystyle q_{i}(t_{1})=A_{i}} 和 q i ( t 2 ) = B i {\displaystyle q_{i}(t_{2})=B_{i}} ,其中 A i , B i {\displaystyle A_{i},B_{i}} 是固定的數字。我們現在要問:系統在 t 1 {\displaystyle t_{1}} 和 t 2 {\displaystyle t_{2}} 這兩個時刻之間 是如何運動的?拉格朗日描述的答案是:在這段時間內,系統必須以這樣一種方式運動 ,使得積分 ∫ t 1 t 2 L ( q i , q ˙ i ) d t {\displaystyle \int _{t_{1}}^{t_{2}}L(q_{i},{\dot {q}}_{i})dt} 的值最小,其中 L ( q i , q ˙ i ) {\displaystyle L(q_{i},{\dot {q}}_{i})} 是一個已知的函式,稱為拉格朗日函式 或拉格朗日量 。例如,自由質點的拉格朗日量為
L ( x , y , z , x ˙ , y ˙ , z ˙ ) = m 2 [ x ˙ 2 + y ˙ 2 + z ˙ 2 ] . {\displaystyle L(x,y,z,{\dot {x}},{\dot {y}},{\dot {z}})={\frac {m}{2}}[{\dot {x}}^{2}+{\dot {y}}^{2}+{\dot {z}}^{2}].}
上面兩個質量連線到牆上的例子,其拉格朗日量為
L ( x 1 , x 2 , x ˙ 1 , x ˙ 2 ) = m 2 [ x ˙ 1 2 + x ˙ 2 2 ] − k 2 ( x 1 − L ) 2 − k 2 ( x 2 − x 1 − L ) 2 . {\displaystyle L(x_{1},x_{2},{\dot {x}}_{1},{\dot {x}}_{2})={\frac {m}{2}}[{\dot {x}}_{1}^{2}+{\dot {x}}_{2}^{2}]-{\frac {k}{2}}(x_{1}-L)^{2}-{\frac {k}{2}}(x_{2}-x_{1}-L)^{2}.}
例如,根據拉格朗日描述,自由質點以這樣的方式運動,使得函式 x ( t ) , y ( t ) , z ( t ) {\displaystyle x(t),y(t),z(t)} 使積分 ∫ t 1 t 2 m 2 [ x ˙ 2 + y ˙ 2 + z ˙ 2 ] d t {\displaystyle \int _{t_{1}}^{t_{2}}{\frac {m}{2}}[{\dot {x}}^{2}+{\dot {y}}^{2}+{\dot {z}}^{2}]dt} 的值最小,其中 x ( t ) , y ( t ) , z ( t ) {\displaystyle x(t),y(t),z(t)} 在時間 t 1 , 2 {\displaystyle t_{1,2}} 處的取值是固定的。
原則上,要找到積分 ∫ t 1 t 2 L ( q i , q ˙ i ) d t {\displaystyle \int _{t_{1}}^{t_{2}}L(q_{i},{\dot {q}}_{i})dt} 的最小值,需要對每條可能的軌跡 q i ( t ) {\displaystyle q_{i}(t)} 計算該積分,然後選擇使該積分值最小的“最優”軌跡 q i ∗ ( t ) {\displaystyle q_{i}^{*}(t)} 。(當然,我們將學習並使用一種更有效的數學方法來確定這種“最優”軌跡,而不是嘗試每組可能的函式 q i ( t ) {\displaystyle q_{i}(t)} 。)上述積分的值稱為對應於特定軌跡 q i ( t ) {\displaystyle q_{i}(t)} 的作用量 。因此,要求積分應具有最小值通常被稱為“最小作用量原理”或簡稱作用量原理 。
在這一點上,我們需要回答一個緊迫的問題
為什麼正確的軌跡 q i ∗ ( t ) {\displaystyle q_{i}^{*}(t)} 不是透過考慮力來找到的,而是透過要求某個積分具有最小值來找到的?每個質點在運動時是如何“知道”它需要最小化某個積分的?
簡短的答案是,如果拉格朗日量 L {\displaystyle L} 選擇正確,那麼最小作用量原理在數學上等價於 力的考慮。某個積分具有最小值(當積分選擇正確時)的條件在數學上與牛頓的加速度方程相同。點質量可能“不知道”關於這個積分的任何資訊。僅僅是在數學上方便地用一句話而不是很多句話來表述力學定律。(我們將在下面 看到另一種更直觀的解釋。)
假設我們理解了如何將某個積分具有最小值的條件轉化為加速度的方程。顯然,由於運動方程不同,每個力學系統的積分形式都需要不同。然後第二個問題出現了
我們如何找到對應於每個力學系統的拉格朗日函式 L ( q i , q ˙ i ) {\displaystyle L(q_{i},{\dot {q}}_{i})} ?
這是一個更復雜的問題,需要研究許多例子才能掌握這種方法。(簡而言之:拉格朗日函式是動能減去勢能。)
在考慮拉格朗日函式之前,我們將看看“最小作用量”的數學要求如何等價於上述例子中給出的運動方程。
函式是從數到數的對映;泛函 是從函式到數的對映。泛函作用於函式通常用方括號表示,例如 S [ f ( x ) ] {\displaystyle S[f(x)]} 。
泛函的隨機例子,僅用於說明概念
S [ f ( x ) ] = ∫ 0 ∞ f ( 3 x ) d x {\displaystyle S[f(x)]=\int _{0}^{\infty }{\sqrt {f(3x)}}dx}
S [ f ( x ) ] = ∫ − 1 1 f ( x ) 1 − x 2 d x {\displaystyle S[f(x)]=\int _{-1}^{1}{\frac {f(x)}{1-x^{2}}}dx}
S [ f ( x ) ] = f ( 15 ) − 8 f ′ ( 3 ) − ∫ 0 1 sin [ ( f ( x − 2 ) + x e − x ) 3 ] d x {\displaystyle S[f(x)]=f(15)-8f'(3)-\int _{0}^{1}\sin \left[(f(x-2)+{\sqrt {x}}e^{-x})^{3}\right]dx}
原則上,泛函可以是任何將數字分配給任何函式的東西。在實踐中,只有某些泛函是有趣的並且在物理學中得到應用。
由於作用積分將軌跡對映到數字,因此我們可以將其稱為作用泛函 。作用量原理表述如下:軌跡 q i ( t ) {\displaystyle q_{i}(t)} 必須使得作用泛函作用於該軌跡的值在所有軌跡中最小。
這可能看起來類似於我們熟悉的機械平衡條件:座標 x , y , z {\displaystyle x,y,z} 使得勢能具有最小值。但是,存在一個關鍵的區別:當我們最小化勢能時,我們改變三個數字 x , y , z {\displaystyle x,y,z} 直到找到最小值;但是當我們最小化一個泛函 時,我們必須改變整個函式 q i ( t ) {\displaystyle q_{i}(t)} 直到找到泛函的最小值。
稱為變分法 的數學分支研究最小化(最大化,極值化)泛函的問題。此時需要學習一些變分學知識。讓我們從解決一些涉及多個變數函式的簡單最小化問題開始;這將為我們處理可以被認為是無限多個變數的函式的泛函做好準備。在檢視解答之前,您應該自己嘗試這些例子。
例1 :關於 x , y {\displaystyle x,y} 最小化函式 f ( x , y ) = x 2 + x y + y 2 {\displaystyle f(x,y)=x^{2}+xy+y^{2}} 。
示例 2 :針對所有 x j {\displaystyle x_{j}} ,最小化函式 f ( x 1 , . . . , x n ) = x 1 2 + x 1 x 2 + x 2 2 + x 2 x 3 + . . . + x n 2 {\displaystyle f(x_{1},...,x_{n})=x_{1}^{2}+x_{1}x_{2}+x_{2}^{2}+x_{2}x_{3}+...+x_{n}^{2}} 。
示例 3 :針對所有 x j {\displaystyle x_{j}} ,在約束條件 x 0 = 0 , x n = A {\displaystyle x_{0}=0,x_{n}=A} 下,最小化函式 f ( x 0 , . . . , x n ) = ( x 1 − x 0 ) 2 + ( x 2 − x 1 ) 2 + . . . + ( x n − x n − 1 ) 2 {\displaystyle f(x_{0},...,x_{n})=(x_{1}-x_{0})^{2}+(x_{2}-x_{1})^{2}+...+(x_{n}-x_{n-1})^{2}} 。
解法 1: 計算 f {\displaystyle f} 對 x , y {\displaystyle x,y} 的偏導數。這兩個導數都必須等於零。這隻有在 x = 0 , y = 0 {\displaystyle x=0,y=0} 時才能發生。
解法 2: 計算 f {\displaystyle f} 對所有 x j {\displaystyle x_{j}} 的偏導數,其中 j = 1 , . . . , n {\displaystyle j=1,...,n} 。這些導數都必須等於零。這隻有在所有 x j = 0 {\displaystyle x_{j}=0} 時才能發生。
方案 3: 計算 f {\displaystyle f} 關於 x j {\displaystyle x_{j}} 的偏導數,其中 j = 2 , . . . , n − 1 {\displaystyle j=2,...,n-1} 。這些導數必須都等於零。只有當 x j − x j − 1 = x j + 1 − x j {\displaystyle x_{j}-x_{j-1}=x_{j+1}-x_{j}} 對於 j = 1 , 2 , . . . , n − 1 {\displaystyle j=1,2,...,n-1} 時才會發生。已知值 x 0 , x n {\displaystyle x_{0},x_{n}} ,因此我們發現 x j = j A / n {\displaystyle x_{j}=jA/n} 。
現在讓我們考慮最小化泛函 S [ x ] = ∫ 0 1 x ˙ ( t ) 2 d t {\displaystyle S[x]=\int _{0}^{1}{{\dot {x}}(t)}^{2}dt} 關於所有函式 x ( t ) {\displaystyle x(t)} 的問題,前提是受限於 x ( 0 ) = 0 , x ( 1 ) = L {\displaystyle x(0)=0,x(1)=L} 。我們將首先以一種更直觀但近似的方式進行最小化,然後我們將看到變分法如何更優雅地處理同樣的任務。
Let us imagine that we are trying to minimize the integral L [ x ] {\displaystyle L[x]} with respect to all functions x ( t ) {\displaystyle x(t)} using a digital computer. The first problem is that we cannot represent "all functions" x ( t ) {\displaystyle x(t)} on a computer because we can only store finitely many values x ( t 0 ) , x ( t 1 ) , . . . , x ( t N ) {\displaystyle x(t_{0}),x(t_{1}),...,x(t_{N})} in an array within the computer memory. So we split the time interval [ 0 , 1 ] {\displaystyle [0,1]} into a large number N {\displaystyle N} of discrete steps [ 0 , t 1 ] , [ t 1 , t 2 ] , . . . , [ t N − 1 , 1 ] {\displaystyle [0,t_{1}],[t_{1},t_{2}],...,[t_{N-1},1]} , where the step size t j − t j − 1 ≡ Δ t = 1 / N {\displaystyle t_{j}-t_{j-1}\equiv \Delta t=1/N} is small; in other words, t j = j / N , j = 1 , . . . , N − 1 {\displaystyle t_{j}=j/N,j=1,...,N-1} . We can describe the function x ( t ) {\displaystyle x(t)} by its values x j {\displaystyle x_{j}} at the points t j {\displaystyle t_{j}} , assuming that the function x ( t ) {\displaystyle x(t)} is a straight line between these points. The time moments t 1 , . . . , t N − 1 {\displaystyle t_{1},...,t_{N-1}} will be kept fixed, and then the various values x j {\displaystyle x_{j}} will correspond to various possible functions x ( t ) {\displaystyle x(t)} . (In this way we definitely will not describe all possible functions x ( t ) {\displaystyle x(t)} , but the class of functions we do describe is broad enough so that we get the correct results in the limit N → ∞ {\displaystyle N\to \infty } . Basically, any function x ( t ) {\displaystyle x(t)} can be sufficiently well approximated by one of these "piecewise-linear" functions when the step size Δ t {\displaystyle \Delta t} is small enough.)
由於我們已經離散化了時間並減少了對分段線性函式的關注,所以我們有
x ˙ = x j − x j − 1 Δ t {\displaystyle {\dot {x}}={\frac {x_{j}-x_{j-1}}{\Delta t}}}
在每個區間 t ∈ [ t j − 1 , t j ] {\displaystyle t\in [t_{j-1},t_{j}]} 內。因此,我們可以將積分 S [ x ] {\displaystyle S[x]} 表示為有限和,
S [ x ] = ∫ 0 1 x ˙ ( t ) 2 d t = ∑ j = 1 N ( x j − x j − 1 ) 2 Δ t 2 Δ t , {\displaystyle S[x]=\int _{0}^{1}{{\dot {x}}(t)}^{2}dt=\sum _{j=1}^{N}{\frac {{(x_{j}-x_{j-1})}^{2}}{\Delta t^{2}}}\Delta t,}
其中,為方便起見,我們定義了 t 0 = 0 , t N = 1 {\displaystyle t_{0}=0,t_{N}=1} 。
At this point we can perform the minimization of S [ x ] {\displaystyle S[x]} quite easily. The functional S [ x ] {\displaystyle S[x]} is now a function of N − 1 {\displaystyle N-1} variables x 1 , . . . , x N − 1 {\displaystyle x_{1},...,x_{N-1}} , i.e. S [ x ] = S ( x 1 , . . . , x N − 1 ) {\displaystyle S[x]=S(x_{1},...,x_{N-1})} , so the minimum is achieved at the values x j {\displaystyle x_{j}} where the derivatives of S ( x 1 , . . . , x N − 1 ) {\displaystyle S(x_{1},...,x_{N-1})} with respect to each x j {\displaystyle x_{j}} are zero. This problem is now quite similar to the Example 3 above, so the solution is x j = j L / N , j = 0 , . . . , N {\displaystyle x_{j}=jL/N,j=0,...,N} . Now we recall that x j {\displaystyle x_{j}} is the value of the unknown function x ( t ) {\displaystyle x(t)} at the point t j = j / N {\displaystyle t_{j}=j/N} . Therefore the minimum of the functional S [ x ] {\displaystyle S[x]} is found at the values x j {\displaystyle x_{j}} such that would correspond to the function x ( t ) = L t {\displaystyle x(t)=Lt} . As we increase the number N {\displaystyle N} of intervals, we still obtain the same function x ( t ) = L t {\displaystyle x(t)=Lt} , therefore the same function is obtained in the limit N → ∞ {\displaystyle N\to \infty } . We conclude that the function x ( t ) = L t {\displaystyle x(t)=Lt} minimizes the functional L [ x ] {\displaystyle L[x]} with the restrictions x ( 0 ) = 0 , x ( 1 ) = L {\displaystyle x(0)=0,x(1)=L} .
上述計算的優點在於更直觀和視覺化:它清楚地表明,泛函 S [ x ( t ) ] {\displaystyle S[x(t)]} 關於函式 x ( t ) {\displaystyle x(t)} 的最小化,與函式 S ( x 1 , . . . , x N ) {\displaystyle S(x_{1},...,x_{N})} 關於大量變數 x j {\displaystyle x_{j}} 的最小化非常相似,當變數數量無限增加時。然而,變分法的形式主義提供了一種更高效的計算程式。下面是如何計算使 S [ x ] {\displaystyle S[x]} 最小化的函式 x ( t ) {\displaystyle x(t)} 的方法。
讓我們考慮函式 x ( t ) {\displaystyle x(t)} 的一個非常小的變化 ϵ ( t ) {\displaystyle \epsilon (t)} ,並觀察泛函 S [ x ] {\displaystyle S[x]} 如何變化。
δ S [ x ( t ) , ϵ ( t ) ] ≡ S [ x ( t ) + ϵ ( t ) ] − S [ x ( t ) ] . {\displaystyle \delta S[x(t),\epsilon (t)]\equiv S[x(t)+\epsilon (t)]-S[x(t)].}
(在許多教科書中, x ( t ) {\displaystyle x(t)} 的變化用 δ x ( t ) {\displaystyle \delta x(t)} 表示,通常任何量 Q {\displaystyle Q} 的變化用 δ Q {\displaystyle \delta Q} 表示。為了清晰起見,我們選擇用 ϵ ( t ) {\displaystyle \epsilon (t)} 而不是 δ x ( t ) {\displaystyle \delta x(t)} 來表示。)
泛函 S [ x ] {\displaystyle S[x]} 關於函式 x ( t ) {\displaystyle x(t)} 的變化 ϵ ( t ) {\displaystyle \epsilon (t)} 的**變分**稱為 δ S [ x , ϵ ] {\displaystyle \delta S[x,\epsilon ]} 。變分本身是一個泛函,它依賴於兩個函式: x ( t ) {\displaystyle x(t)} 和 ϵ ( t ) {\displaystyle \epsilon (t)} 。當 ϵ ( t ) {\displaystyle \epsilon (t)} 非常小時,我們期望變分在 ϵ ( t ) {\displaystyle \epsilon (t)} 中是**線性**的,就像普通函式的值的變化在其自變數的變化量中是線性的,例如,對於小的 α {\displaystyle \alpha } , f ( t + α ) − f ( t ) = f ′ ( t ) α {\displaystyle f(t+\alpha )-f(t)=f'(t)\alpha } 。因此,我們期望泛函 S [ x ] {\displaystyle S[x]} 的變分 δ S [ x , ϵ ] {\displaystyle \delta S[x,\epsilon ]} 將是 ϵ ( t ) {\displaystyle \epsilon (t)} 的**線性泛函**。為了理解線性泛函是什麼樣的,考慮一個依賴於幾個變數 α j {\displaystyle \alpha _{j}} , j = 1 , 2 , . . . {\displaystyle j=1,2,...} 的線性函式 f ( ϵ j ) {\displaystyle f(\epsilon _{j})} 。這個函式總是可以寫成
f ( ϵ j ) = ∑ j A j ϵ j {\displaystyle f(\epsilon _{j})=\sum _{j}^{}A_{j}\epsilon _{j}}
其中 A j {\displaystyle A_{j}} 是合適的常數。由於泛函類似於無限多個變數的函式,索引 j {\displaystyle j} 變成了連續變數 t {\displaystyle t} ,變數 ϵ j {\displaystyle \epsilon _{j}} 和常數 A j {\displaystyle A_{j}} 變成了函式 ϵ ( t ) , A ( t ) {\displaystyle \epsilon (t),A(t)} ,而對 j {\displaystyle j} 的求和變成了對 t {\displaystyle t} 的積分。因此, ϵ ( t ) {\displaystyle \epsilon (t)} 的線性泛函可以寫成一個積分形式,
δ S [ x , ϵ ] = ∫ 0 1 A ( t ) ϵ ( t ) d t , {\displaystyle \delta S[x,\epsilon ]=\int _{0}^{1}A(t)\epsilon (t)dt,}
其中 A ( t ) {\displaystyle A(t)} 是一個合適的函式。在通常函式 f ( t ) {\displaystyle f(t)} 的情況下,“合適的常數 A {\displaystyle A} ” 是導數 A = d f ( t ) / d t {\displaystyle A=df(t)/dt} 。根據類比,我們稱上面的 A ( t ) {\displaystyle A(t)} 為泛函的變分導數 ,並用 δ S [ x ] / δ x ( t ) {\displaystyle \delta S[x]/\delta x(t)} 表示。
如果一個函式在某一點的導數為零,則該點為函式的極小值(或極大值,或極值點)。因此,泛函 S [ x ( t ) ] {\displaystyle S[x(t)]} 在函式 x ( t ) {\displaystyle x(t)} 處具有極小值(或極大值,或極值點),其中泛函導數為零。我們將在下面證明這個陳述,現在讓我們計算泛函 S [ x ( t ) ] = ∫ 0 1 x ˙ 2 d t {\displaystyle S[x(t)]=\int _{0}^{1}{\dot {x}}^{2}dt} 的泛函導數。
將 x ( t ) + ϵ ( t ) {\displaystyle x(t)+\epsilon (t)} 代入 x ( t ) {\displaystyle x(t)} 到泛函中,我們得到
δ S [ x , ϵ ] = ∫ 0 1 [ ( x ˙ + ϵ ˙ ) 2 − x ˙ 2 ] d t = 2 ∫ 0 1 x ˙ ϵ ˙ d t + O ( ϵ 2 ) , {\displaystyle \delta S[x,\epsilon ]=\int _{0}^{1}[({\dot {x}}+{\dot {\epsilon }})^{2}-{\dot {x}}^{2}]dt=2\int _{0}^{1}{\dot {x}}{\dot {\epsilon }}dt+O(\epsilon ^{2}),}
其中我們將忽略 ϵ ( t ) {\displaystyle \epsilon (t)} 的二次項,因此我們沒有寫出來。現在我們需要重寫這個積分,使其不包含 ϵ ( t ) {\displaystyle \epsilon (t)} 的導數;因此,我們進行分部積分,得到
δ S [ x ( t ) , ϵ ( t ) ] = ϵ ( t ) x ˙ ( t ) | 0 1 − 2 ∫ 0 1 x ¨ ( t ) ϵ ( t ) d t . {\displaystyle \delta S[x(t),\epsilon (t)]=\left.\epsilon (t){\dot {x}}(t)\right|_{0}^{1}-2\int _{0}^{1}{\ddot {x}}(t)\epsilon (t)dt.}
由於在我們的例子中,值 x ( 0 ) , x ( 1 ) {\displaystyle x(0),x(1)} 是固定的,函式 ϵ ( t ) {\displaystyle \epsilon (t)} 必須滿足 ϵ ( 0 ) = ϵ ( 1 ) = 0 {\displaystyle \epsilon (0)=\epsilon (1)=0} ,因此邊界項消失。因此,變分導數為
δ S / δ x ( t ) = − 2 x ¨ ( t ) . {\displaystyle \delta S/\delta x(t)=-2{\ddot {x}}(t).}
泛函 S [ x ] {\displaystyle S[x]} 在其在任意變化 ϵ ( t ) {\displaystyle \epsilon (t)} 下的變化為 ϵ ( t ) {\displaystyle \epsilon (t)} 的二階量時,取得極值。然而,我們在上面已經得到該變化是一個一階量,關於 ϵ ( t ) {\displaystyle \epsilon (t)} 線性;因此,對於 x ( t ) {\displaystyle x(t)} 而言,該一階量必須消失,其中泛函具有極值。諸如 ∫ 0 1 A ( t ) ϵ ( t ) {\displaystyle \int _{0}^{1}A(t)\epsilon (t)} 這樣的積分只有當函式 A ( t ) {\displaystyle A(t)} 對所有 t {\displaystyle t} 都消失時,才能對任意的 ϵ ( t ) {\displaystyle \epsilon (t)} 為零。在我們的例子中,“函式 A ( t ) {\displaystyle A(t)} ”,即變分導數 δ S / δ x ( t ) {\displaystyle \delta S/\delta x(t)} ,等於 − 2 x ¨ ( t ) {\displaystyle -2{\ddot {x}}(t)} 。因此,泛函 S [ x ] {\displaystyle S[x]} 取得極值的函式 x ( t ) {\displaystyle x(t)} 必須滿足 − 2 x ¨ ( t ) = 0 {\displaystyle -2{\ddot {x}}(t)=0} ,或者更簡單地說 x ¨ = 0 {\displaystyle {\ddot {x}}=0} 。該微分方程的一般解為 x ( t ) = a + b t {\displaystyle x(t)=a+bt} ,並且在附加限制 x ( 0 ) = 0 , x ( 1 ) = L {\displaystyle x(0)=0,x(1)=L} 的情況下,我們立即得到解 x ( t ) = L t {\displaystyle x(t)=Lt} 。
概括來說:要求泛函 S [ x ( t ) ] {\displaystyle S[x(t)]} 在函式 x ( t ) {\displaystyle x(t)} 處取極值,會導致一個關於未知函式 x ( t ) {\displaystyle x(t)} 的微分方程。這個微分方程可以表示為
δ S [ x ] / δ x ( t ) = 0. {\displaystyle \delta S[x]/\delta x(t)=0.}
這個過程與尋找函式 f ( t ) {\displaystyle f(t)} 的極值非常相似,其中極值點 t {\displaystyle t} 由方程 d f ( t ) / d t = 0 {\displaystyle df(t)/dt=0} 確定。
假設現在要求我們最小化泛函 S [ x ( t ) ] = ∫ 0 1 ( x 2 + x ˙ 2 − x 4 sin t ) d t {\displaystyle S[x(t)]=\int _{0}^{1}(x^{2}+{\dot {x}}^{2}-x^{4}\sin t)dt} ,並且滿足約束條件 x ( 0 ) = 0 , x ( 1 ) = 1 {\displaystyle x(0)=0,x(1)=1} ;在力學中,我們通常會處理這種型別的泛函。我們可以嘗試像上面一樣對函式 x ( t ) {\displaystyle x(t)} 進行離散化,但這很困難。此外,對於不同的泛函 S [ x ] {\displaystyle S[x]} ,一切都必須重新計算。與其一遍遍重複上述過程,不如現在推匯出所有此類泛函的泛函導數公式,即
S [ x i ( t ) ] = ∫ a b L ( x i , x ˙ i , t ) d t , {\displaystyle S[x_{i}(t)]=\int _{a}^{b}L(x_{i},{\dot {x}}_{i},t)dt,}
其中 L ( x i , v i , t ) d t {\displaystyle L(x_{i},v_{i},t)dt} 是座標 x i {\displaystyle x_{i}} 和速度 v i ≡ x ˙ i {\displaystyle v_{i}\equiv {\dot {x}}_{i}} (假設有 n {\displaystyle n} 個座標,因此 i = 1 , . . . , n {\displaystyle i=1,...,n} )的給定函式。該函式 L ( x i , v i , t ) d t {\displaystyle L(x_{i},v_{i},t)dt} 稱為拉格朗日函式 或簡稱拉格朗日量 。
我們將無窮小變化 ϵ i ( t ) {\displaystyle \epsilon _{i}(t)} 引入函式 x i ( t ) {\displaystyle x_{i}(t)} 中,並首先透過 ϵ i ( t ) {\displaystyle \epsilon _{i}(t)} 和 ϵ ˙ i ( t ) {\displaystyle {\dot {\epsilon }}_{i}(t)} 表示泛函的變化。
δ S [ x i ( t ) , ϵ i ( t ) ] = ∫ a b ∑ i = 1 n [ ∂ L ∂ x i ϵ i ( t ) + ∂ L ∂ v i ϵ ˙ i ( t ) ] d t . {\displaystyle \delta S[x_{i}(t),\epsilon _{i}(t)]=\int _{a}^{b}\sum _{i=1}^{n}\left[{\frac {\partial L}{\partial x_{i}}}\epsilon _{i}(t)+{\frac {\partial L}{\partial v_{i}}}{\dot {\epsilon }}_{i}(t)\right]dt.}
然後我們進行分部積分,捨棄邊界項,得到
δ S [ x i ( t ) , ϵ i ( t ) ] = ∫ a b ∑ i = 1 n [ ∂ L ∂ x i − d d t ∂ L ∂ v i ] ϵ i ( t ) d t . {\displaystyle \delta S[x_{i}(t),\epsilon _{i}(t)]=\int _{a}^{b}\sum _{i=1}^{n}\left[{\frac {\partial L}{\partial x_{i}}}-{\frac {d}{dt}}{\frac {\partial L}{\partial v_{i}}}\right]\epsilon _{i}(t)dt.}
因此,變分導數可以寫成
δ S [ x ] δ x i ( t ) = ∂ L ∂ x i − d d t ∂ L ∂ v i . {\displaystyle {\frac {\delta S[x]}{\delta x_{i}(t)}}={\frac {\partial L}{\partial x_{i}}}-{\frac {d}{dt}}{\frac {\partial L}{\partial v_{i}}}.}
再次考慮泛函在 x i ( t ) {\displaystyle x_{i}(t)} 處取得極值的條件:一階變分必須為零。我們已經推匯出了上述變分 δ S [ x i , ϵ i ] {\displaystyle \delta S[x_{i},\epsilon _{i}]} 的公式。由於所有 ϵ i ( t ) {\displaystyle \epsilon _{i}(t)} 都是完全任意的(僅受邊界條件 ϵ i ( a ) = ϵ i ( b ) = 0 {\displaystyle \epsilon _{i}(a)=\epsilon _{i}(b)=0} 的限制),一階變分僅當方括號內的函式在所有 t {\displaystyle t} 處都為零時才為零。因此,我們得到**尤拉-拉格朗日方程**
∂ L ∂ x i − d d t ∂ L ∂ v i = 0. {\displaystyle {\frac {\partial L}{\partial x_{i}}}-{\frac {d}{dt}}{\frac {\partial L}{\partial v_{i}}}=0.}
這些是表達以下數學要求的微分方程:泛函 S [ x i ( t ) , x ˙ i ( t ) , t ] {\displaystyle S[x_{i}(t),{\dot {x}}_{i}(t),t]} 在函式集 x i ( t ) {\displaystyle x_{i}(t)} 處取得極值。方程的數量與未知函式 x i ( t ) {\displaystyle x_{i}(t)} 的數量相同,每個 i = 1 , . . . , n {\displaystyle i=1,...,n} 對應一個方程。
注意,尤拉-拉格朗日方程涉及拉格朗日量關於座標和速度的偏導數。關於速度 v = x ˙ {\displaystyle v={\dot {x}}} 的導數有時寫成 ∂ L / ∂ x ˙ {\displaystyle \partial L/\partial {\dot {x}}} ,乍一看可能令人困惑。然而,這種記法的含義只是函式 L ( x , v , t ) {\displaystyle L(x,v,t)} 對其第二個引數的導數。
尤拉-拉格朗日方程還涉及關於時間的導數 d / d t {\displaystyle d/dt} 。這不是 關於 t {\displaystyle t} 的偏導數,而是全導數 。換句話說,要計算 d d t ∂ L ∂ x ˙ i {\displaystyle {\frac {d}{dt}}{\frac {\partial L}{\partial {\dot {x}}_{i}}}} ,我們需要將函式 x i ( t ) {\displaystyle x_{i}(t)} 和 x ˙ i ( t ) {\displaystyle {\dot {x}}_{i}(t)} 代入表示式 ∂ L ∂ x ˙ i {\displaystyle {\frac {\partial L}{\partial {\dot {x}}_{i}}}} ,從而得到一個僅關於時間的函式,然後取該函式關於時間的導數。
註記: 如果拉格朗日量包含高階導數(例如二階導數),則尤拉-拉格朗日公式會有所不同。例如,如果拉格朗日量為 L = L ( x , x ˙ , x ¨ ) {\displaystyle L=L(x,{\dot {x}},{\ddot {x}})} ,則尤拉-拉格朗日方程為
∂ L ∂ x − d d t ∂ L ∂ x ˙ + d 2 d t 2 ∂ L ∂ x ¨ = 0. {\displaystyle {\frac {\partial L}{\partial x}}-{\frac {d}{dt}}{\frac {\partial L}{\partial {\dot {x}}}}+{\frac {d^{2}}{dt^{2}}}{\frac {\partial L}{\partial {\ddot {x}}}}=0.}
請注意,該方程的時間導數最高可達四階!通常,在經典力學的學習中不會遇到這種拉格朗日量,因為普通系統是由僅包含一階導數的拉格朗日量來描述的。
總結: 在力學中,人們透過編寫拉格朗日量並指出其中的未知函式來指定一個系統。由此,人們使用尤拉-拉格朗日公式推匯出運動方程。你需要非常瞭解這個公式,並理解如何應用它。這隻有透過實踐才能掌握。
基本規則是拉格朗日量等於動能減去勢能。(兩者都應該在慣性參考系中測量!在非慣性系中,此規則可能會失效。)
可以證明,對於由點質量、彈簧、繩索、無摩擦導軌等組成的任意機械系統,無論如何引入廣義座標,此規則都適用。我們不會研究該陳述的證明,而是直接轉向各種系統的拉格朗日量的示例。
沿直線運動的自由質點,其座標為 x {\displaystyle x} 的拉格朗日量為
L = 1 2 m x ˙ 2 . {\displaystyle L={\frac {1}{2}}m{\dot {x}}^{2}.}
解
∂ L ∂ x − d d t ∂ L ∂ x ˙ = 0 {\displaystyle {\frac {\partial L}{\partial x}}-{\frac {d}{dt}}{\frac {\partial L}{\partial {\dot {x}}}}=0}
∂ ∂ x ( 1 2 m x ˙ 2 ) = 0 {\displaystyle {\frac {\partial }{\partial x}}\left({\frac {1}{2}}m{\dot {x}}^{2}\right)=0}
∂ ∂ x ˙ ( 1 2 m x ˙ 2 ) = m x ˙ {\displaystyle {\frac {\partial }{\partial {\dot {x}}}}\left({\frac {1}{2}}m{\dot {x}}^{2}\right)=m{\dot {x}}}
d d t ∂ ∂ x ˙ ( 1 2 m x ˙ 2 ) = m x ¨ {\displaystyle {\frac {d}{dt}}{\frac {\partial }{\partial {\dot {x}}}}\left({\frac {1}{2}}m{\dot {x}}^{2}\right)=m{\ddot {x}}}
尤拉-拉格朗日方程簡化為 0 − m x ¨ = 0 {\displaystyle 0-m{\ddot {x}}=0} 或 x ¨ = 0 {\displaystyle {\ddot {x}}=0} ,這表明一個不受力的粒子將沒有加速度。
一個沿直線運動的質點,其座標為 x {\displaystyle x} ,在一個勢能為 V ( x ) {\displaystyle V(x)} 的力場中。
L = 1 2 m x ˙ 2 − V ( x ) . {\displaystyle L={\frac {1}{2}}m{\dot {x}}^{2}-V(x).}
一個在三維空間中運動的質點,其座標為 x i ≡ ( x , y , z ) {\displaystyle x_{i}\equiv (x,y,z)} ,處於勢能為 V ( x , y , z ) {\displaystyle V(x,y,z)} 的力場中。
L = 1 2 ∑ i = 1 3 ( m x ˙ i 2 ) − V ( x , y , z ) = m 2 | x → ˙ | 2 − V ( x → ) . {\displaystyle L={\frac {1}{2}}\sum _{i=1}^{3}\left(m{{\dot {x}}_{i}}^{2}\right)-V(x,y,z)={\frac {m}{2}}|{\dot {\vec {x}}}|^{2}-V({\vec {x}}).}
一個點質量約束在圓上運動,該圓的方程為 x 2 + z 2 = R 2 {\displaystyle x^{2}+z^{2}=R^{2}} ,在地球附近的引力場中( z {\displaystyle z} 軸為豎直方向)。引入角度 θ {\displaystyle \theta } 作為座標較為方便,其中 z = R cos θ , x = R sin θ {\displaystyle z=R\cos \theta ,x=R\sin \theta } 。則勢能為 U = m g z = m g R cos θ {\displaystyle U=mgz=mgR\cos \theta } ,而動能為 K = m v 2 / 2 = m R 2 ω 2 / 2 = m R 2 θ ˙ 2 / 2 {\displaystyle K=mv^{2}/2=mR^{2}\omega ^{2}/2=mR^{2}{\dot {\theta }}^{2}/2} 。因此拉格朗日量為
L = K − U = m 2 R 2 θ ˙ 2 − m g R cos θ . {\displaystyle L=K-U={\frac {m}{2}}R^{2}{\dot {\theta }}^{2}-mgR\cos \theta .}
需要注意的是,我們在不知道維持質量沿圓周運動所需的力的前提下,寫出了拉格朗日量(因此我們也可以推匯出運動方程)。這展示了拉格朗日方法巨大的概念優勢;在傳統的牛頓方法中,第一步將是確定這個最初未知的力,這需要透過包含點質量未知加速度的方程組來求解。
兩個(相等)的點質量透過長度為 l {\displaystyle l} 的彈簧連線。
L = m 2 ( x ˙ 1 2 + x ˙ 2 2 ) − k 2 ( x 1 − x 2 − l ) 2 . {\displaystyle L={\frac {m}{2}}({\dot {x}}_{1}^{2}+{\dot {x}}_{2}^{2})-{\frac {k}{2}}(x_{1}-x_{2}-l)^{2}.}
一個數學擺 ,即一個無質量的剛性杆,長度為 l {\displaystyle l} ,其末端連線一個點質量,該擺只能在地球附近的引力場中(豎直 z {\displaystyle z} 軸)的 x − z {\displaystyle x-z} 平面上運動。我們選擇杆與 z {\displaystyle z} 軸之間的角度 θ {\displaystyle \theta } 作為座標。拉格朗日量為
L = m 2 l 2 θ ˙ 2 + m g l cos θ . {\displaystyle L={\frac {m}{2}}l^{2}{\dot {\theta }}^{2}+mgl\cos \theta .}
一個質量為 m {\displaystyle m} 的質點,在沒有摩擦力的斜面上滑動,斜面與水平面成 α {\displaystyle \alpha } 角,處於地球的引力場中。我們選擇 x , y {\displaystyle x,y} 作為座標,其中 y {\displaystyle y} 平行於斜面。那麼高度 z {\displaystyle z} 為 z = x tan α {\displaystyle z=x\tan \alpha } ,因此勢能為 U = m g z = m g x tan α {\displaystyle U=mgz=mgx\tan \alpha } 。動能計算如下:
K = m 2 ( x ˙ 2 + y ˙ 2 + z ˙ 2 ) = m 2 ( x ˙ 2 / cos 2 α + y ˙ 2 ) . {\displaystyle K={\frac {m}{2}}({\dot {x}}^{2}+{\dot {y}}^{2}+{\dot {z}}^{2})={\frac {m}{2}}({\dot {x}}^{2}/\cos ^{2}\alpha +{\dot {y}}^{2}).}
因此,拉格朗日量為:
L = K − U = m 2 ( x ˙ 2 / cos 2 α + y ˙ 2 ) − m g x tan α . {\displaystyle L=K-U={\frac {m}{2}}({\dot {x}}^{2}/\cos ^{2}\alpha +{\dot {y}}^{2})-mgx\tan \alpha .}
練習: 你現在應該確定從上述每個拉格朗日量推匯出的尤拉-拉格朗日方程,並驗證這些方程是否與從中學水平的牛頓力學考慮中獲得的相應物理系統的方程相同。這最多應該佔用你一兩個小時的時間。只有這樣,你才能開始理解拉格朗日方法的強大之處。
這裡有一些關於拉格朗日的更多練習。
有關為機械系統建立拉格朗日量和推導尤拉-拉格朗日方程的更多示例,請諮詢你的物理老師或查閱任何理論力學問題書籍。很多時候,某個複雜系統的尤拉-拉格朗日方程(例如,連線到另一個擺的端點上的擺)將難以求解,但關鍵是要獲得推導它們的經驗。在使用力的舊牛頓方法中,它們的推導將不那麼直接。
有關微分方程的簡要入門知識,請參見此處。
如果你第一次接觸拉格朗日量,你可能仍然會問自己:為什麼可以透過說某個積分具有最小值來描述系統的運動?這僅僅是一個純粹的形式數學技巧嗎?如果不是,如何才能獲得更直觀的理解?部分答案在這裡 。