homeR: an R package for building physics

For the past few weeks we’ve been very busy here at Neurobat with the analysis of field tests results. In the process of doing that, we had to implement several functions in R that relate to building physics.

We thought it might be useful for the community to have access to those functions, so we decided to begin submitting them to CRAN. That’s why we’re pleased to announce the first release of the homeR package, which we will fill over time with such functions.

This first release, version 0.1, contains just `pmv`, a function to calculate the so-called Predicted Mean Vote, i.e. a measure from -3 (cold) to +3 (hot) of thermal comfort as a function of several variables, including air temperature, clothing and metabolism.

Here I show how with this function one can derive a contour plot showing, for given clothing and metabolism, the optimal indoor temperature (assuming 50% relative humidity). We’re basically going to solve `pmv(clo, met, temp, sat) = 0` equation for `temp` across a grid of `clo` and `met` values with the `uniroot` function.

> clo <- seq(0,2,length=21) > met <- seq(0.6,3.2,length=21) > zero.pmv <- function(clo, met) uniroot(function(temp) pmv(clo,met,temp,50), c(-10,40))$root > contourplot((outer(clo,met,Vectorize(zero.pmv))),
cuts=20,
aspect=”fill”,
panel=function(…) {
panel.grid(h=-1,v=-1,…)
panel.contourplot(…)
},
row.values=clo, column.values=met,
xlim=extendrange(clo), ylim=extendrange(met),
xlab=”[Clo]”, ylab=”[Met]”)

And here is the resulting plot:

Predicted Mean Vote contour plot
Predicted Mean Vote contour plot

As you can see, this is pretty similar to that sort of plots one finds in standard textbooks on the subject, such as Claude-Alain Roulet’s Santé et qualité de l’environnement intérieur dans les bâtiments:

PMV contour plot from textbook
PMV contour plot from textbook

Please give the `homeR` package a try, and give us your feedback. There’s only the `pmv` function in there at the time of writing but we plan to extend the package in the weeks to come.

homeR: an R package for building physics

2 thoughts on “homeR: an R package for building physics

  1. Where did you get your original data to derive the PMV from, i.e. which and how many human samples were used?

  2. Fanger derived his PMV model (and the closely related Predicted Percentage of Dissatisfied users, or PPD, model) about forty years ago. I have never read the original papers but from what I understood, he studied hundred of subjects and derived a physically sound model for thermal comfort that says, in essence, that the thermal input should equal the thermal output.

    In spite of some recent criticism, that model remains the most widely accepted one in the profession. I know several people who are working on improving this model to take into account the dynamic nature of thermal comfort, e.g. to account for the fact that after being too warm for while you might want to open a window or drink a coke.

    So to answer your question, I claim no authority in this matter at all and am clearly not worthy of untying the PMV’s sandals, and content myself with standing on the shoulders of giants 🙂

Comments are closed.

Scroll to top