   rmax = 0;

            <span class="comment">% Save search step</span>
            this.last_search = drv.step;

            <span class="comment">% Outer loop over reference particles</span>
            <span class="keyword">for</span> i = 1:drv.n_particles
                p1 = drv.particles(i);

                <span class="comment">% Update maximum velocity</span>
                <span class="keyword">if</span> (this.auto_freq)
                    vparticle = vecnorm(p1.veloc_trl);
                   