function Tnew = findT(H,T1,MflowN2,MflowH2,MflowNH3,FeedAr,FeedCH4,CpCoef)
% find the temperature from the enthalpy value
tol = 1.e-7;
while (1)
    T2 = T1 + 0.1;
    Tnew = T1 - 0.1*fH(H,T1,MflowN2,MflowH2,MflowNH3,FeedAr,FeedCH4,CpCoef) ...
        / (fH(H,T2,MflowN2,MflowH2,MflowNH3,FeedAr,FeedCH4,CpCoef) ...
        - fH(H,T1,MflowN2,MflowH2,MflowNH3,FeedAr,FeedCH4,CpCoef));
    if abs((Tnew-T1)/Tnew)<tol ; break ; end
    T1 = Tnew;
end

