Optimization For A Sturm--Liouville Problem With The Spectral Parameter In The Boundary Condition