Modeling of reactive sputtering of hot titanium target in nitrogen and oxygen