Numerical Approximation of the Exact Control for the Vibrating Rod with Improvement of the Final Error by Particle Swarm Optimization