# Inverse matrix mass computation

1. Sep 9, 2013

### ebrattr

Hi !
I've been thinking this problem a whole and I could not find an answer. I want to solve the following problem: suppose I have $N$ mass particles with absolute coordinates $\mathbf{x}_1, \mathbf{x}_2, \ldots, \mathbf{x}_N$. Besides, I have the following contraints: for all $i=1,2,\ldots,N-1$, $|\mathbf{x}_{i+1}-\mathbf{x}_i|=L$ where $L$ is a length. In every particle I have a total force over it $\mathbf{F}_i$.

I used spherical coordinates to express every constraints and parametrize $\mathbf{x}_i$. However, when I compute the inverse matrix through these method (https://www.dropbox.com/sh/y25m55jpzrh7kqz/Y8EGX25lOQ), I got troubles. Since, I express a generalized coordiante $q_i$ as $\cos q_i = \dfrac{\mathbf{r}\cdot \mathbf{k}}{L}$ and I get: $\dfrac{\partial q_i}{\partial \mathbf r} = -\dfrac{\mathbf{k}}{L\sin q_i}.$ Therefore, when $q_i = 0,\pi$ the denominator is 0, and -><-.

What can I do ?

Thanks !!!