System optimization and analysis for manufacturing