Necessary and sufficient conditions in the minimal control field problem for linear systems