Calculate the position of a point constrained to be at a fixed distance to another one I have a point let's say A, and I'm trying to calculate its position under the effect of different forces in a way that its distance to a point B stays fixed as if they were attached by a string.
One initial approach I thought of is to calculate its position without the distance constraints and then project that point onto the circumference which has B as center and passes by A. But I don't think that this approach would be right in all situations.
I tried looking online but I couldn't find any helpful hints, What is a good approach to this problem?  
 A: To solve problems like this you take the following steps:


*

*Position Kinematics - Take the position of the particle and parameterized it such that it always obeys the constraint. 
In this example, the position of point A described by a vector $\boldsymbol{r}_A$ is found using spherical coordinates originating from point B described by the vector $\boldsymbol{r}_B$.
$$\boldsymbol{r}_A (\varphi,\psi) = \boldsymbol{r}_B + \pmatrix{R \cos \varphi \cos \psi \\ R \sin \varphi \cos \psi \\ R \sin \psi} \tag{1} $$ where $R = \| \boldsymbol{r}_A - \boldsymbol{r}_B \|$ is the fixed distance, and $\varphi$, $\psi$ the varying parameters.

*Velocity Kinematics - Take the time derivative of the position, assuming the motion of B is known. For example $\boldsymbol{v}_B =0$. Use the chain rule to evaluate each component (for example $\frac{\rm d}{{\rm d}t} \cos \varphi = (-\sin \varphi) \dot{\varphi}$ and so on), in terms of the parameter derivatives $\dot \varphi$ and $\dot \psi$.
$$\require{cancel} \boldsymbol{v}_A = \cancelto{0}{ \boldsymbol{v}_B} + \pmatrix{-R \dot\varphi \sin \varphi \cos \psi - R 
\dot \psi \cos \varphi \sin\psi \\ R \dot\varphi \cos\varphi \cos\psi - R \dot \psi \sin\varphi \sin \psi \\ R \dot \psi \cos \psi } \tag{2} $$

*Acceleration Kinematics - Similarly take the time derivative of (2) to get to acceleration. Again using the chain rule as if $\varphi$ and $\dot \varphi$ were independent (for example $\frac{{\rm d}}{{\rm d}t} \dot\varphi \cos \varphi = \ddot \varphi \cos \varphi + \dot \varphi (-\dot \varphi \sin \varphi) $ and so on).
$$ \boldsymbol{a}_A = \pmatrix{-R \left( \cos \varphi ( \ddot \psi \sin\psi + (\dot \varphi^2+ \dot \psi^2) \cos\psi ) + \sin \varphi ( \ddot \psi \cos\psi -2 \dot \varphi \dot \psi \sin \psi ) \right) \\
R \left( \cos \varphi ( \ddot \varphi \cos\psi + 2 \dot \varphi \dot \psi \sin\psi ) - \sin \varphi ( \ddot \psi \sin\psi +( \dot \varphi^2 +  \dot \psi^2) \cos \psi ) \right) \\
 R \left( \ddot \psi \cos \psi - \dot \psi^2 \sin \psi \right) } \tag{3}$$

*Global → Local Transformations - Yikes, nobody said this is going to be easy. But things improve a bit when the above acceleration vector is transformed along the local coordinate system, with 1st direction radially out $\boldsymbol{\hat{r}} = \pmatrix{ \cos \varphi\cos \psi \\ \sin\varphi \cos\psi \\ \sin\psi }$, the 2nd direction tangentially around $\boldsymbol{\hat \varphi} = \pmatrix{-\sin \varphi \\ \cos \varphi \\ 0}$ and the 3rd direction tangentially toward the poles $\boldsymbol{\hat \psi} = \pmatrix{\cos\varphi \sin\psi \\ -\sin \varphi \sin\psi \\ \cos \psi}$
The above kinematics in local coordinates (denoted with $\star$) are
$$  \boldsymbol{r}_A^\star = \boldsymbol{r}_B^\star + \pmatrix{ R \\ 0 \\ 0}  \tag{4}$$
$$ \boldsymbol{v}_A^\star = \pmatrix{ 0 \\ R \dot \varphi \cos \psi \\ R \dot \varphi } \tag{5}$$
$$  \boldsymbol{a}_A^\star  = \pmatrix{ -R ( \dot \varphi^2 \cos^2 \psi + \dot \psi^2) \\ R ( \ddot \psi \cos \psi - 2 \dot \varphi \dot \psi \sin \psi) \\ R ( \ddot \psi + \dot \varphi^2 \sin\psi \cos\psi)   } \tag{6} $$

*Equations of motion - Apply $\boldsymbol{F}^\star = m \boldsymbol{a}_A^\star$ for the particle along the local coordinate system
$$ \pmatrix{ F_r \\ F_\varphi \\ F_\psi } = m \pmatrix{ -R ( \dot \varphi^2 \cos^2 \psi + \dot \psi^2) \\ R ( \ddot \psi \cos \psi - 2 \dot \varphi \dot \psi \sin \psi) \\ R ( \ddot \psi + \dot \varphi^2 \sin\psi \cos\psi)   } \tag{7}$$

*Motion Solution - Given known tangential forces $F_\varphi$ and $F_\psi$ find the unknown radial "normal" force $F_r$ and the acceleration of the particle. Use (7) to find
$$ \begin{aligned}
 F_r & = -R m (\dot \varphi^2 \cos^2 \psi+ \dot \psi^2) \\
 \ddot \varphi & = \frac{F_\varphi}{m R \cos \psi} + 2 \dot \varphi \dot \psi \tan \psi \\ 
 \ddot \psi & = \frac{F_\psi}{m R} - \dot \varphi^2 \sin\psi \cos\psi
\end{aligned} \tag{8} $$
Plug the parameter acceleration values $\ddot \varphi$ and $\ddot \psi$ into (3) or (6) to get the acceleration vector in cartesian coordinates. Most likely (8) is really an Ordinary Differential Equation with two parameters, and you can simulate the solution using an ODE solver.
A: What you are basically trying to solve is totally the same thing as trying to find the equations of motion for a particle constrained to move on the surface of a sphere. The radius of the sphere is the string length (more like rigid rod since you want the distance to be constant)  and its center is the position of the fixed particle.
To solve this I recommend using Lagrangian mechanics. It will be much easier, though I can’t provide you with a formula without knowing the forces.
If you wanna try for yourself, use Lagrangian mechanics, express your forces in terms of energies, and there you go. Use spherical coordinates.
A: To keep it moving in a circle the particle (mass $m$) must be provided with a centripetal force component (that is a force component towards the circle centre, B) of magnitude $mv^2/r$. $v$ is the particle's speed and $r$ is its distance from B. In the case you are considering, $v$ is not necessarily a constant, so the centripetal force component must vary accordingly.
You want to calculate the particle's position at any time. The particle has only one degree of freedom since it is moving in a circular path. We can use the arc length, $s$, around the circle from some chosen point as the measure of its position. Then $s$ is the solution that is consistent with velocity and value of $s$ at time $t=0$ of the equation
$$m\frac{d^2 s}{dt^2}=F_{tan}(t).$$
$F_{tan}(t)$ is the component of force that is supplied to the particle tangential to the circle. The equation is just the same as would apply to a particle moving in a straight line.
But don't forget that as $ds/dt$ changes, the centripetal component of the applied force must change, in order to keep the particle going in a circle.
