A Model for Residual Gas Fraction Prediction in Spark Ignition Engines