Controllability of a Nonhomogeneous String and Ring under Time Dependent Tension