At the intersection of differential equations and optimization: inverse problems, path planning and Krylov subspaces