Method of controlling a gaseous-fuelled direct injection internal combustion engine, said method comprising a. calculating output data from system data, said system data comprising i. an injector geometry defined by a fuel injector in fluid communication with a combustion chamber of said engine, wherein the injector geometry is a reference defined by at least one variable of: sizes of injector needles, sizes of plungers, sizes of flow channels and reservoirs, sizes of injector holes and number of injector holes, ii. an engine geometry defined by said engine, iii. an engine operating command based on a desired engine output, iv. an initial injector command, v. an engine speed, said engine operating command being indicative of a commanded torque for said engine, said output data comprising i. an engine out value indicative of a brake torque delivered by said engine, and ii. an output control parameter indicative of a cylinder pressure value, b. when said output data does not satisfy a predetermined relationship, determining a subsequent injector command and recalculating said output data with said subsequent injector command, where said predetermined relationship compares said output data and said engine operating command and a demanded control parameter, said demanded control parameter being indicative of a maximum cylinder pressure value, c. when said output data satisfies said predetermined relationship, commanding said injector to provide fuel to said combustion chamber according to a last injector command. a. calculating output data from system data, said system data comprising i. an injector geometry defined by a fuel injector in fluid communication with a combustion chamber of said engine, wherein the injector geometry is a reference defined by at least one variable of: sizes of injector needles, sizes of plungers, sizes of flow channels and reservoirs, sizes of injector holes and number of injector holes, ii. an engine geometry defined by said engine, iii. an engine operating command based on a desired engine output, iv. an initial injector command, v. an engine speed, said engine operating command being indicative of a commanded torque for said engine, said output data comprising i. an engine out value indicative of a brake torque delivered by said engine, and ii. an output control parameter indicative of a cylinder pressure value, i. an injector geometry defined by a fuel injector in fluid communication with a combustion chamber of said engine, wherein the injector geometry is a reference defined by at least one variable of: sizes of injector needles, sizes of plungers, sizes of flow channels and reservoirs, sizes of injector holes and number of injector holes, ii. an engine geometry defined by said engine, iii. an engine operating command based on a desired engine output, iv. an initial injector command, v. an engine speed, i. an engine out value indicative of a brake torque delivered by said engine, and ii. an output control parameter indicative of a cylinder pressure value, b. when said output data does not satisfy a predetermined relationship, determining a subsequent injector command and recalculating said output data with said subsequent injector command, where said predetermined relationship compares said output data and said engine operating command and a demanded control parameter, said demanded control parameter being indicative of a maximum cylinder pressure value, c. when said output data satisfies said predetermined relationship, commanding said injector to provide fuel to said combustion chamber according to a last injector command.