Gain-scheduling and preview control of selective catalytic reduction systems in diesel engines