In a method for operating an internal combustion engine, the air-fuel ratio in
a combustion chamber is a function of the operating conditions and/or the operating
state of the internal combustion engine. It is provided that, with the aid of a
data model, a variable expressing a target air-fuel ratio is ascertained from a
target torque and an air mass determined with the aid of a model or a measured
value, and in addition a setpoint fuel quantity to be injected into the combustion
chamber is determined and, using the same data model, a setpoint air mass to be
conveyed to the combustion chamber is determined from the target torque and a variable
expressing a predefined air-fuel ratio in the combustion chamber.