Solution (source code)

= Solution

It can describe the motion per unit mass of a charged particle in the azimuthal <magnetic field> of a long straight current-carrying wire. Choose magnetic <vector potential>
$$
\mathbf A=-\frac{mC}{q}\log(R/R_0)\,\hat{\mathbf z}.
$$
Then $\mathbf B=\nabla\times\mathbf A=(mC/(qR))\hat{\boldsymbol\phi}$ and $(T+q\mathbf A\cdot\mathbf v)/m$ is the given <Lagrangian>. In terms of a straight-wire current $I$, $B_\phi=\mu_0I/(2\pi R)$, so $C=q\mu_0I/(2\pi m)$ with signs fixed by charge and current direction.

A static magnetic force does no work, consistent with the conserved <kinetic energy>. Its radial component is $-q\dot zB_\phi$ and its axial component is $q\dot RB_\phi$, reproducing the radial and axial couplings above. The reference length in the logarithm is a gauge convention, not a new physical wire radius in the ideal exterior-field model.