Damping optimization of discrete mechanical systems -- rod/string model