Closed form optimal control solutions for continuous linear elastic systems