Zaslat SMS: Optimal control theory with applications in economics