A method of calculating a residual gas mass in a cylinder of an internal combustion engine, wherein the cylinder has at least one intake valve and one exhaust valve, comprising: obtaining a cylinder residual gas mass base value that is based on a predefined model; determining a first cylinder residual gas mass value that indicates a cylinder residual gas mass remaining in the cylinder clearance volume after an expulsion of exhaust gas; determining a second cylinder residual gas mass value that indicates a cylinder residual gas mass flowing into the cylinder due to a valve overlap of the intake valve and the exhaust valve, wherein the second cylinder residual gas mass value is determined based on the cylinder residual gas mass base value and the first cylinder residual gas mass value; and calculating the residual gas mass in the cylinder, based on the first and second cylinder residual gas mass values.
展开▼