Reliability and Maintenance Modeling with Optimization