Mathematical description of brain dynamics in perception and action