Analysis and control of mixing with an application to micro and macro flow processes.