Estas usando hi = trw / (trw+vw) / 100 Debe ser hi = trw / (trw+vw) * 100
Estas usando hi = trw / (trw+vw) / 100
Debe ser hi = trw / (trw+vw) * 100