# How do I calculate numerically a tensor in polar coordinates?

You can formulate the question also like this: What is the easiest way of calculating directed derivative of a function if its values are evaluated in a cartesian grid?

a) fit a (spline) surface, differentiate exactly

b) differentiate numerically in cartesian coordinates, project to angle

c) something else

The function at hand is a displacement vector ($u : \mathbb{R}^2 \to \mathbb{R}^2$ ) and I need the circumferential strain tensor component $$\varepsilon_{\theta\theta} = \frac{\partial u_\theta}{\partial \theta}$$. (Also the radial strain would is somewhat interesting.)

background: In 2d strain tensor has four components: $\varepsilon_{i,j}$, where i and j is either taken from {x,y} (cartesian) or {$\theta$,r} (polar). The first index defines the direction of displacement and the second index the differentiation direction, i.e. $$\varepsilon_{i,j} = \frac{\partial u_i}{\partial j}$$

u here is the 2d displacement vector. In cartesian coordinates above is easy, in polar not so much.

-
Not exaclty clear what you ask. Can it be more specific? What is $\Theta$, and in what meaning are you using $\nabla$? –  Berci Sep 27 '12 at 12:16
ok, I added a bit more details. Basically I meant the angular derivative of the angular component. Also, added the word "tensor" where it was missing... –  Juha Sep 27 '12 at 13:52
The verb corresponding to the noun "derivative" is "differentiate", not "derivate". –  joriki Sep 27 '12 at 14:02
@joriki fixed, thanks. –  Juha Sep 28 '12 at 10:44

If we set

$$x=\rho\cos\theta\\ y=\rho\sin\theta$$

then

$$\mathbf{e}_\rho = \cos\theta\,\mathbf{e}_1+\sin\theta\,\mathbf{e}_2,\\ \mathbf{e}_\theta=-\sin\theta\,\mathbf{e}_1+\cos\theta\,\mathbf{e}_2.$$

We have

$$\nabla\otimes\mathbf{u}=\left(\mathbf{e}_\rho\frac{\partial}{\partial\rho}+\mathbf{e}_\theta\frac{1}{\rho}\frac{\partial}{\partial\theta}\right)\otimes(u_\rho\mathbf{e}_\rho+u_\theta\mathbf{e}_\theta)$$

and then

$$(\nabla\otimes\mathbf{u})_{\theta\theta}=\frac{1}{\rho}\left(\frac{\partial u_\theta}{\partial\theta}+u_\rho\right)$$

where the second term arises from the derivative of $\mathbf{e}_\rho$ with respect to $\theta$, giving $\mathbf{e}_\theta$.

If one would to express such quantities with respect to the corresponding Cartesian ones, the following formulas could be useful:

$$u_\rho =\mathbf{u}\cdot\mathbf{e}_\rho = u_1\cos\theta+u_2\sin\theta\\ u_\theta=\mathbf{u}\cdot\mathbf{e}_\theta=-u_1\sin\theta+u_2\cos\theta\\ \frac{\partial}{\partial\theta}=-\rho\sin\theta\frac{\partial}{\partial x}+\rho\cos\theta\frac{\partial}{\partial y}$$

-
Could you add the final step to numerical derivative, please? I mean, $\varepsilon_{\theta\theta}(x,y) = -\rho(x,y) sin \theta(x,y) \frac{u(x+h,y) - u(x,y)}{h} + \rho(x,y) cos \theta(x,y) \frac{u(x,y+h) - u(x,y)}{h}, h \to 0$ and also the same for radial component. Then it would be exactly what I wanted to know. –  Juha Sep 28 '12 at 10:55
First of all, I have only a poor knowledge of numerical methods, my analysis in the answer was purely theoretical. Secondly, I don't said $e_{\theta\theta}=\partial u/\partial\theta$, you are misinterpreting my answer. –  enzotib Sep 28 '12 at 14:57
Ah, ok. So I missed the $+ u_\rho$ and $1/\rho$, right? –  Juha Oct 1 '12 at 10:40
I have to use the fourth last equation in your answer and plug the last line in. Then it should be ok? –  Juha Oct 1 '12 at 10:46
@Juha: yeah, you also need $u_\rho, u_\theta$ in terms of $u_1, u_2$, if only have those. –  enzotib Oct 1 '12 at 15:38

I'm not sure if this is what you are looking for, but,

so, if $(x,y)$ is given by $x=r\cos\varphi$ and $y=r\sin\varphi$, then $$dx = dr\cdot \cos\varphi+r\cdot (-\sin\varphi)d\varphi$$ $$dy = dr\cdot \sin\varphi+r\cdot \cos\varphi\, d\varphi$$ $$r=\sqrt{x^2+y^2}\ \text{ and }\ \varphi = \arctan \frac yx \color{grey}{(+\pi)}$$ $$dr=\frac x{\sqrt{x^2+y^2}}dx+\frac y{\sqrt{x^2+y^2}}dy$$ $$\frac{\partial f}{\partial r}(x,y)=\frac x{\sqrt{x^2+y^2}}\frac{\partial f}{\partial x} + \frac y{\sqrt{x^2+y^2}}\frac{\partial f}{\partial y}$$ $$d\varphi = -\frac y{x^2}\cdot\frac{1}{(y/x)^2+1}dx + \frac1x\cdot\frac{1}{(y/x)^2+1}dy$$ $$...$$

-