Finite-dimensional optimal learning control: Application to a flexible link