梯度(gradient)係向量微積分嘅一個概念,適用喺多變量純量場函數。一個多變量純量函數嘅梯度係一個多變量向量函數。梯度嘅意思係,對於投射喺一個座標平面嘅多變量純量函數,由佢喺每一個點嘅梯度可以知道當喺嗰一點嘅時候向邊一個方向行個函數值嘅上升率(可以講係斜率)最大,而梯度嘅數值就係講向嗰一個方向行嘅斜率。梯度通常寫做 ∇ f {\displaystyle \nabla f} 。
梯度嘅定義要用到Nabla 算子嚟表示。對於一個多變量純量函數 f ( x 1 , . . . , x n ) {\displaystyle f(x_{1},...,x_{n})} ,佢嘅梯度係:
∇ f = ∑ i = 1 n e → i ∂ f ∂ x i = ( ∂ f ∂ x 1 , . . . , ∂ f ∂ x n ) {\displaystyle \nabla f=\sum _{i=1}^{n}{\vec {e}}_{i}{\partial f \over \partial x_{i}}=({\frac {\partial f}{\partial x_{1}}},...,{\frac {\partial f}{\partial x_{n}}})}
譬如喺 R 3 {\displaystyle \mathbb {R} ^{3}} 平面上,梯度係:
∇ f = i ∂ f ∂ x + j ∂ f ∂ y + k ∂ f ∂ z = ( ∂ f ∂ x , ∂ f ∂ y , ∂ f ∂ z ) {\displaystyle \nabla f=\mathbf {i} {\frac {\partial f}{\partial x}}+\mathbf {j} {\frac {\partial f}{\partial y}}+\mathbf {k} {\frac {\partial f}{\partial z}}=({\frac {\partial f}{\partial x}},{\frac {\partial f}{\partial y}},{\frac {\partial f}{\partial z}})}
想搞清楚梯度嘅概念,去 https://www.youtube.com/watch?v=ThxMvNPMitE&t=226s 睇下。