Dynamics of poles with position-dependent strengths and its optical analogues