# Simulating torque between axially magnetized cylinders

Consider the following system of cylinders with axial magnetization (shown in red):

Let cylinder 1 be the top cylinder and cylinder 2 the bottom one. The origin of the system is placed at the point of contact of cylinder 1 and 2. I aim to simulate the torque created by cylinder 2 on cylinder 1 about the origin. Currently, I have discretized my cylinders in such a way that they are each composed of a set of evenly distributed small point magnetic dipoles:

I then proceed to calculate the torque in the following way: for each dipole $$\mathbf{m}_{1,i}$$ in cylinder 1, I compute its distance to the other dipoles $$\mathbf{m}_{2,j}$$ and using the formula for the force between two magnetic dipoles, compute the sum of torques on this dipole exerted by all the dipoles in cylinder 2 via $$\mathbf{\tau}_{1,i} = \sum_{j} \mathbf{r}_{1,i} \times \mathbf{F}_{i,j}$$. I then proceed to do this for all the dipoles in cylinder 1 and obtain the total torque.

However, I have one concern with this method: since dipoles also experience torques in magnetic fields, do I also have to factor in the individual torques experienced by each dipole in cylinder 1 due to the dipoles in cylinder 2? But then, I assume that cylinder 1 would want to rotate about its center of mass, if we just restrict ourselves to this contribution.

Actually, now that I've thought of this out loud, I think that the correct approach should be to compute the sum of forces on cylinder 1, compute the torque about the origin due to the sum of these forces being applied to cylinder 1's center of mass and then add to this the total torque about cylinder 1's center of mass due to the dipoles' tendency to align themselves with the magnetic field. Is this the correct approach?