Collection of notes on mechanics and variational  principle