Simple pendulum with magnetic bob through a circular loop
I'm developing a project for my electromagnetism course and the idea is to make a simple pendulum that has a magnetic bob, and the bob passes through a circular loop induced with some current. i.e. a coil. Each time the bob passes through the coil there is a simple circuit that switches the polarity and creates a pendulum-like movement. The pendulum is somewhat like
except that there is actually no string attached to the bob, there is no magnet, instead there is the circular loop as I have already described and the bob is not charged but rather has a magnetic field of itself, it is actually a spherical neodymium magnet. What's actually happening is that the bob sits in a rail that's curved to that it resembles a kind of semi-sphere, that's why it doesn't have a string attached.
The prototype works to some extent, but the actual question comes in when trying to develop the theoretical model of the movement of the bob. Part of the project is to eventually create a computer simulation using the equations of motion.
The simplest way I thought of doing this is to work out the lagrangian for this, using a simple pendulum as a starting point (which actually is) and add the magnetic contribution of the circular loop which is acting as a coil, looking something like $$ L = \frac{m}{2}( \dot{x}^2 + \dot{y}^2 ) + mgy + \mathbf{\mu} \cdot \mathbf{B}.$$ Where $\mu$ is the magnetic dipole moment, and $g$ is the acceleration due to gravity. 782
Here are some of my considerations before writing out the equations of motion:
1. The distance or length of the string (which it doesn't exist in the actual prototype) is constant, thus the $r$ generalized coordinate does not contribute and the only generalized coordinate will be $\theta$, the angular displacement between the vertical axis the bob, as shown in the picture above.
2. The second consideration is that there will exist some friction because of air resistance, so eventually I will have to model this as a damped pendulum, which just adds a term that depends on the velocity of the bob.
Because there is only one generalized coordinate, I got the following differential equation describing the movement of the pendulum: $$ \ddot{\theta} + (\frac{g}{l} + \frac{|\mu| |\mathbf{B}|}{m l^2}) \sin{\theta} = 0 $$
And now I arrive at my actual concern (and question); and it's about the magnetic contribution. There are several concerns actually:
1. Is there a way to simplify the expression for the magnetic energy provided by the coil $\mathbf{\mu} \cdot \mathbf{B}$ in such a way that one can use the generalized coordinate of the problem?
2. Does the magnetic dipole moment and the magnetic field in the energy term actually characterize the coil and not the magnetic bob?
3. While the bob moves through the coil, given that the bob is a magnet as well it must be creating an electric field following $ \nabla \times \mathbf{E} = {-\partial \mathbf{B}}/{\partial t} .$ How can I take into account this contribution in the lagrangian? 649