# We can test for heat exchange with the environment by check to see if the
# heat gained by the cold water matches the heat lost by the hot water.
C_p <- 4.182 / 60 # / 60 because measureing m in L/min
HeatX2 <- transform(HeatX,
Q.cold = m.cold * C_p * (T.cold.out - T.cold.in),
Q.hot= m.hot * C_p * (T.hot.out- T.hot.in)
)
HeatX2 <- transform(HeatX2, Q.env = Q.cold + Q.hot)
if (require(mosaic)) {
stripplot( ~ Q.env, data=HeatX2, alpha=.6, cex=2, jitter.data=TRUE, factor=4)
t.test( ~Q.env, data = HeatX2 )
}
Run the code above in your browser using DataLab