Tools for designing optimal variable flip angle schemes