极坐标和直角坐标的雅克比矩阵推导

我们经常需要在一些问题中研究坐标系的关系,这里讲讲最常见的极坐标和直角坐标的雅克比矩阵的推导。以二维坐标为例,三维坐标也是同理。

1. 直角坐标和极坐标

直角坐标表示为 ( x , y ) (x,y) (x,y),极坐标表示为 ( ρ , φ ) (\rho,\varphi) (ρ,φ),它们之间有如下的关系:
ρ 2 = x 2 + y 2 , φ = arctan ⁡ y x ; x = ρ cos ⁡ φ , y = ρ sin ⁡ φ \begin{aligned} \rho^2=x^2+y^2,\quad &\varphi=\arctan\frac{y}{x};\\ x=\rho\cos\varphi,\quad&y=\rho\sin\varphi \end{aligned} ρ2=x2+y2,x=ρcosφ,φ=arctanxy;y=ρsinφ

2. 向量之间的雅克比矩阵

向量X和向量Y的微分映射由雅克比矩阵来刻画,给定两个向量 x = ( x 1 , x 2 , ⋯   , x n ) T \mathbf{x}=(x_1,x_2,\cdots,x_n)^T x=(x1,x2,,xn)T y = ( y 1 , y 2 , ⋯   , y m ) T \mathbf{y}=(y_1,y_2,\cdots,y_m)^T y=(y1,y2,,ym)T

{ d x 1 = ∂ x 1 ∂ y 1 d y 1 + ∂ x 1 ∂ y 2 d y 2 + ⋯ + ∂ x 1 ∂ y m d y m d x 2 = ∂ x 2 ∂ y 1 d y 1 + ∂ x 2 ∂ y 2 d y 2 + ⋯ + ∂ x 2 ∂ y m d y m ⋮ d x n = ∂ x n ∂ y 1 d y 1 + ∂ x n ∂ y 2 d y 2 + ⋯ + ∂ x n ∂ y m d y m \begin{aligned} \begin{cases} \mathrm{d}x_1=\dfrac{\partial x_1}{\partial y_1}\mathrm{d}y_1+\dfrac{\partial x_1}{\partial y_2}\mathrm{d}y_2+\cdots+\dfrac{\partial x_1}{\partial y_m}\mathrm{d}y_m\\ \mathrm{d}x_2=\dfrac{\partial x_2}{\partial y_1}\mathrm{d}y_1+\dfrac{\partial x_2}{\partial y_2}\mathrm{d}y_2+\cdots+\dfrac{\partial x_2}{\partial y_m}\mathrm{d}y_m\\ \vdots\\ \mathrm{d}x_n=\dfrac{\partial x_n}{\partial y_1}\mathrm{d}y_1+\dfrac{\partial x_n}{\partial y_2}\mathrm{d}y_2+\cdots+\dfrac{\partial x_n}{\partial y_m}\mathrm{d}y_m\\ \end{cases} \end{aligned} dx1=y1x1dy1+y2x1dy2++ymx1dymdx2=y1x2dy1+y2x2dy2++ymx2dymdxn=y1xndy1+y2xndy2++ymxndym

写成矩阵的形式就是:

( d x 1 d x 2 ⋮ d x n ) = [ ∂ x 1 ∂ y 1 ∂ x 1 ∂ y 2 ⋯ ∂ x 1 ∂ y m ∂ x 2 ∂ y 1 ∂ x 2 ∂ y 2 ⋯ ∂ x 2 ∂ y m ⋮ ⋮ ⋮ ∂ x n ∂ y 1 ∂ x n ∂ y 2 ⋯ ∂ x n ∂ y m ] ( d y 1 d y 2 ⋮ d y m ) \begin{pmatrix} \mathrm{d}x_1\\ \mathrm{d}x_2\\ \vdots\\ \mathrm{d}x_n \end{pmatrix} =\begin{bmatrix} \dfrac{\partial x_1}{\partial y_1} & \dfrac{\partial x_1}{\partial y_2} & \cdots & \dfrac{\partial x_1}{\partial y_m}\\ \dfrac{\partial x_2}{\partial y_1} & \dfrac{\partial x_2}{\partial y_2} & \cdots &\dfrac{\partial x_2}{\partial y_m} \\ \vdots & \vdots & & \vdots\\ \dfrac{\partial x_n}{\partial y_1} & \dfrac{\partial x_n}{\partial y_2} & \cdots &\dfrac{\partial x_n}{\partial y_m} \end{bmatrix}\begin{pmatrix} \mathrm{d}y_1\\ \mathrm{d}y_2\\ \vdots\\ \mathrm{d}y_m \end{pmatrix} dx1dx2dxn = y1x1y1x2y1xny2x1y2x2y2xnymx1ymx2ymxn dy1dy2dym

其中的矩阵

∂ ( x 1 , x 2 , ⋯   , x n ) ∂ ( y 1 , y 2 , ⋯   , y m ) = [ ∂ x 1 ∂ y 1 ∂ x 1 ∂ y 2 ⋯ ∂ x 1 ∂ y m ∂ x 2 ∂ y 1 ∂ x 2 ∂ y 2 ⋯ ∂ x 2 ∂ y m ⋮ ⋮ ⋮ ∂ x n ∂ y 1 ∂ x n ∂ y 2 ⋯ ∂ x n ∂ y m ] \frac{\partial(x_1,x_2,\cdots,x_n)}{\partial(y_1,y_2,\cdots,y_m)}=\begin{bmatrix} \dfrac{\partial x_1}{\partial y_1} & \dfrac{\partial x_1}{\partial y_2} & \cdots & \dfrac{\partial x_1}{\partial y_m}\\ \dfrac{\partial x_2}{\partial y_1} & \dfrac{\partial x_2}{\partial y_2} & \cdots &\dfrac{\partial x_2}{\partial y_m} \\ \vdots & \vdots & & \vdots\\ \dfrac{\partial x_n}{\partial y_1} & \dfrac{\partial x_n}{\partial y_2} & \cdots &\dfrac{\partial x_n}{\partial y_m} \end{bmatrix} (y1,y2,,ym)(x1,x2,,xn)= y1x1y1x2y1xny2x1y2x2y2xnymx1ymx2ymxn

就是雅克比矩阵。我们称从坐标 y \mathbf{y} y(分母)到 x \mathbf{x} x(分子)的雅克比矩阵。

3. 极坐标到直角坐标的雅克比矩阵

这个比较简单,利用关系 x = ρ cos ⁡ φ , y = ρ sin ⁡ φ x=\rho\cos\varphi,y=\rho\sin\varphi x=ρcosφ,y=ρsinφ

∂ x ∂ ρ = cos ⁡ φ , ∂ x ∂ φ = − ρ sin ⁡ φ ∂ y ∂ ρ = sin ⁡ φ , ∂ y ∂ φ = ρ cos ⁡ φ \begin{aligned} \dfrac{\partial x}{\partial \rho}=\cos\varphi, & \dfrac{\partial x}{\partial \varphi}=-\rho\sin\varphi\\ \dfrac{\partial y}{\partial \rho}=\sin\varphi, &\dfrac{\partial y}{\partial \varphi}=\rho\cos\varphi \end{aligned} ρx=cosφ,ρy=sinφ,φx=ρsinφφy=ρcosφ

我们可以写出雅克比矩阵
∂ ( x , y ) ∂ ( ρ , φ ) = [ ∂ x ∂ ρ ∂ x ∂ φ ∂ y ∂ ρ ∂ y ∂ φ ] = [ cos ⁡ φ − ρ sin ⁡ φ sin ⁡ φ ρ cos ⁡ φ ] \dfrac{\partial(x,y)}{\partial(\rho,\varphi)}=\begin{bmatrix} \dfrac{\partial x}{\partial \rho} & \dfrac{\partial x}{\partial \varphi}\\ \dfrac{\partial y}{\partial \rho} &\dfrac{\partial y}{\partial \varphi} \end{bmatrix}=\begin{bmatrix} \cos\varphi &-\rho\sin\varphi\\ \sin\varphi &\rho\cos\varphi \end{bmatrix} (ρ,φ)(x,y)= ρxρyφxφy =[cosφsinφρsinφρcosφ]

4. 直角坐标到极坐标的雅克比矩阵

这里有两种方法。

4.1 直接求解

利用关系 ρ 2 = x 2 + y 2 , φ = arctan ⁡ y x \rho^2=x^2+y^2,\quad \varphi=\arctan\frac{y}{x} ρ2=x2+y2,φ=arctanxy,我们可以对上式直接应用求导

对于第一个式子: ρ = x 2 + y 2 \rho=\sqrt{x^2+y^2} ρ=x2+y2

直接求导有:

∂ ρ ∂ x = 2 x 2 x 2 + y 2 = x ρ = cos ⁡ φ ∂ ρ ∂ y = 2 y 2 x 2 + y 2 = y ρ = sin ⁡ φ \frac{\partial\rho}{\partial x}=\frac{2x}{2\sqrt{x^2+y^2}}=\frac{x}{\rho}=\cos\varphi\\ \frac{\partial\rho}{\partial y}=\frac{2y}{2\sqrt{x^2+y^2}}=\frac{y}{\rho}=\sin\varphi xρ=2x2+y2 2x=ρx=cosφyρ=2x2+y2 2y=ρy=sinφ

对于第二个式子直接求导有:

∂ φ ∂ x = − y x 2 1 + y 2 x 2 = − y x 2 + y 2 = − y ρ 2 = − sin ⁡ φ ρ ∂ φ ∂ y = 1 x 1 + y 2 x 2 = x x 2 + y 2 = x ρ 2 = cos ⁡ φ ρ \frac{\partial \varphi}{\partial x}=\frac{-\dfrac{y}{x^{2}}}{1+\dfrac{y^{2}}{x^{2}}}=\frac{-y}{x^{2}+y^{2}}=\frac{-y}{\rho^2}=\frac{-\sin\varphi}{\rho}\\ \frac{\partial \varphi}{\partial y}=\frac{\dfrac{1}{x}}{1+\dfrac{y^{2}}{x^{2}}}=\frac{x}{x^{2}+y^{2}}=\frac{x}{\rho^2}=\frac{\cos\varphi}{\rho} xφ=1+x2y2x2y=x2+y2y=ρ2y=ρsinφyφ=1+x2y2x1=x2+y2x=ρ2x=ρcosφ

当然也可以用全微分的方法来求解,我们对第一个式子全微分:

2 ρ d ρ = 2 x d x + 2 y d y 2\rho\mathrm{d}\rho=2x\mathrm{d}x+2y\mathrm{d}y 2ρdρ=2xdx+2ydy

于是得到

d ρ = x ρ d x + y ρ d y \mathrm{d}\rho=\frac{x}{\rho}\mathrm{d}x+\frac{y}{\rho}\mathrm{d}y dρ=ρxdx+ρydy

于是有:
∂ ρ ∂ x = x ρ = cos ⁡ φ , ∂ y ∂ ρ = y ρ = sin ⁡ φ \dfrac{\partial \rho}{\partial x}=\frac{x}{\rho}=\cos\varphi, \dfrac{\partial y}{\partial \rho}=\frac{y}{\rho}=\sin\varphi xρ=ρx=cosφ,ρy=ρy=sinφ

对第二个式子变换一下:

tan ⁡ φ = y x \tan\varphi=\frac{y}{x} tanφ=xy

然后我们再求全微分:

1 cos ⁡ 2 φ d φ = − y x 2 d x + 1 x d y \frac{1}{\cos^2\varphi}\mathrm{d}\varphi=-\frac{y}{x^2}\mathrm{d}x+\frac{1}{x}\mathrm{d}y cos2φ1dφ=x2ydx+x1dy

于是得到

d φ = − y cos ⁡ 2 φ x 2 d x + cos ⁡ 2 φ x d y = − y ρ 2 d x + x ρ 2 d y = − sin ⁡ φ ρ d x + cos ⁡ φ ρ d y \mathrm{d}\varphi=-\frac{y\cos^2\varphi}{x^2}\mathrm{d}x+\frac{\cos^2\varphi}{x}\mathrm{d}y=-\frac{y}{\rho^2}\mathrm{d}x+\frac{x}{\rho^2}\mathrm{d}y=-\frac{\sin\varphi}{\rho}\mathrm{d}x+\frac{\cos\varphi}{\rho}\mathrm{d}y dφ=x2ycos2φdx+xcos2φdy=ρ2ydx+ρ2xdy=ρsinφdx+ρcosφdy

于是有:
∂ φ ∂ x = − sin ⁡ φ ρ , ∂ φ ∂ y = cos ⁡ φ ρ \frac{\partial \varphi}{\partial x}=\frac{-\sin\varphi}{\rho}, \frac{\partial \varphi}{\partial y}=\frac{\cos\varphi}{\rho} xφ=ρsinφ,yφ=ρcosφ

∂ ( ρ , φ ) ∂ ( x , y ) = [ ∂ ρ ∂ x ∂ ρ ∂ y ∂ φ ∂ x ∂ φ ∂ y ] = [ cos ⁡ φ sin ⁡ φ − sin ⁡ φ ρ cos ⁡ φ ρ ] \dfrac{\partial(\rho,\varphi)}{\partial(x,y)}=\begin{bmatrix} \dfrac{\partial \rho}{\partial x} & \dfrac{\partial \rho}{\partial y}\\ \dfrac{\partial \varphi}{\partial x}&\dfrac{\partial \varphi}{\partial y} \end{bmatrix}=\begin{bmatrix} \cos\varphi &\sin\varphi\\ \dfrac{-\sin\varphi}{\rho}&\dfrac{\cos\varphi}{\rho} \end{bmatrix} (x,y)(ρ,φ)= xρxφyρyφ = cosφρsinφsinφρcosφ

4.2 求逆

这里刚好是一个二阶方阵,所以可以直接对3中的雅克比矩阵求逆:

∂ ( ρ , φ ) ∂ ( x , y ) = ( ∂ ( x , y ) ∂ ( ρ , φ ) ) − 1 = [ cos ⁡ φ − ρ sin ⁡ φ sin ⁡ φ ρ cos ⁡ φ ] − 1 = [ cos ⁡ φ sin ⁡ φ − sin ⁡ φ ρ cos ⁡ φ ρ ] \dfrac{\partial(\rho,\varphi)}{\partial(x,y)}=\left(\dfrac{\partial(x,y)}{\partial(\rho,\varphi)}\right)^{-1}=\begin{bmatrix} \cos\varphi &-\rho\sin\varphi\\ \sin\varphi &\rho\cos\varphi \end{bmatrix}^{-1}{}=\begin{bmatrix} \cos\varphi &\sin\varphi\\ \dfrac{-\sin\varphi}{\rho}&\dfrac{\cos\varphi}{\rho} \end{bmatrix} (x,y)(ρ,φ)=((ρ,φ)(x,y))1=[cosφsinφρsinφρcosφ]1= cosφρsinφsinφρcosφ

你可能感兴趣的:(数学,矩阵,雅克比,极坐标,直角坐标)