Differentiation spherical coordinates

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
ebrattr
Messages
16
Reaction score
0
Hi ! I'm trying to inverse a mass matrix so I need to do something like this

[itex]\dfrac{q}{\partial \mathbf{r}}[/itex] where [itex]\cos q = \dfrac{\mathbf{r}\cdot \hat{\mathbf{k}}}{r}[/itex]

However, when [itex]\mathbf{r} = \hat{\mathbf{k}} \text{ or } -\hat{\mathbf{k}}[/itex] I have problems.

¿What can I do?

Thanks !
 
Physics news on Phys.org
ebrattr said:
Hi ! I'm trying to inverse a mass matrix so I need to do something like this

[itex]\dfrac{q}{\partial \mathbf{r}}[/itex] where [itex]\cos q = \dfrac{\mathbf{r}\cdot \hat{\mathbf{k}}}{r}[/itex]
What does ##\dfrac{q}{\partial \mathbf{r}} ## mean?
Did you mean to write this?
##\dfrac{\partial q}{\partial \mathbf{r}}##
ebrattr said:
However, when [itex]\mathbf{r} = \hat{\mathbf{k}} \text{ or } -\hat{\mathbf{k}}[/itex] I have problems.

¿What can I do?
Isn't k##\cdot##k = 1, and similarly, isn't -k##\cdot##k = -1? What problems are you having?
 
Yes, I mean [itex]\dfrac{\partial q}{\partial \mathbf{r}}[/itex] As you know if you do [itex]\dfrac{\partial}{\partial \mathbf{r}}[/itex] both sides you get [itex]\dfrac{\partial q}{\partial \mathbf{r}} -\sin q = \dfrac{\hat{\mathbf{k}}}{L}[/itex]. Solving for [itex]\dfrac{\partial q}{\partial \mathbf{r}}[/itex] you get [itex]\dfrac{\partial q}{\partial \mathbf{r}} = -\dfrac{\hat{\mathbf{k}}}{L\sin q}[/itex] So, when [itex]q=0[/itex] I'm having troubles.
 
You have to transform the gradient to spherical coordinates first. This you get with
[tex]\mathrm{d} f=\mathrm{d} \vec{r} \cdot \vec{\nabla} f = (\mathrm{d} r \vec{e}_r \cdot +\mathrm{d} \vartheta r \vec{e}_{\vartheta} + \mathrm{d} \varphi r \sin \vartheta \vec{e}_{\varphi}) \cdot \nabla{f}.[/tex]
Since [itex]\vec{e}_{r}[/itex], [itex]\vec{e}_{\vartheta}[/itex], and [itex]\vec{e}_{\varphi}[/itex] build a complete orthonormal system you immediately read off
[tex]\vec{\nabla} \cdot \vec{r}=\vec{e}_r \frac{\partial f}{\partial r} + \vec{e}_{\vartheta} \frac{1}{r} \frac{\partial f}{\partial \vartheta} + \vec{e}_{\varphi} \frac{1}{r \sin \vartheta} \frac{\partial f}{\partial \vartheta}.[/tex]
For [itex]f=\vartheta[/itex] you thus get
[tex]\vec{\nabla} \vartheta=\frac{1}{r} \vec{e}_{\vartheta}.[/tex]
You can of course do the whole thing in Cartesian coordinates:
[tex]f=\arccos \left (\frac{\vec{k} \cdot \vec{r}}{r} \right ).[/tex]
Using the chain rule gives
[tex]\vec{\nabla} f=-\frac{1}{\sin \vartheta} \vec{\nabla} \left (\frac{\vec{k} \cdot \vec{r}}{r} \right )=-\frac{1}{\sin \vartheta} \left (\frac{\vec{k}}{r}-\frac{(\vec{r} \cdot \vec{k}) \vec{r}}{r^3} \right ).[/tex]
Now we can simplify
[tex]\frac{\vec{k}}{r}-\frac{(\vec{r} \cdot \vec{k}) \vec{r}}{r^3}<br /> =\frac{1}{r} \left (\vec{k} - \frac{(\vec{r} \cdot \vec{k})<br /> \vec{r}}{r^2} \right )=-\frac{\sin \vartheta}{r} \begin{pmatrix}<br /> \cos \varphi \cos \vartheta \\ \sin \varphi \cos \vartheta \\ -\sin \vartheta<br /> \end{pmatrix}=-\frac{\vec{e}_{\vartheta} \sin \vartheta}{r}.[/tex]
Plugging this into the equation above you again get
[tex]\vec{\nabla} \vartheta=\frac{1}{r} \vec{e}_{\vartheta}.[/tex]
As you see you always must use the correct expression of the covariant differential operators to get the right result!