Mathematical modeling for software-in-the loop prototyping of automated manufacturing systems