A lot of the time when we're making measurements will derive certain quantities like density from things that are easier to measure like temperature, pressure, and humidity. For example, if we've got air moving around, it's really difficult to catch it and weigh it. But we know that the density of dry air at one standard atmosphere in 20 degrees Celsius is about 1.2 kilograms per cubic meter. And we can pull out an ideal gas loss state equation model to tell us how that's going to change if we change the pressure temperature and molecular weight a little bit. The molecular weight will change depending on if we add some additional components, for example, water if we have some humidity in our air. So the density will be proportional to the pressure, inversely proportional to the temperature and directly proportional to the molecular weight. That's what the ideal gas law tells us. And we'll leave it with thermodynamics to sort of further details on that. So we can calculate the molecular weight based on the ratio of partial pressures. And 29 is the molecular weight for air, that combination dry air of oxygen and nitrogen, and 18 is the molecular weight of water vapor. So when we combine them, we get this expression for the molecular weight, which eventually leads us to an expression for the density in terms of the original density for our reference state. So 1.2 kilograms per cubic meter times the reference temperature, 20 degrees Celsius, but we'll need to put that in Kelvin. So add 273. And then our ratio of partial pressures over here to account for the molecular weight and the pressure variation. So let's test out that relationship to make sure that it works. Now I'm going to import some stuff so that I can do my calculations. Then I'm going to define some functions. Now I went to Wikipedia and found this expression to allow me to get the saturation pressure for water at different temperatures. I checked it on a couple of values and it seems to work out okay. I've got my function here, row ideal. It's row based on a density based on an ideal gas model for pressure temperature and partial pressure water. That's from this expression that I had up here. And finally, I've got it based on relative humidity because very often we talk about water content in terms of relative humidity, the total amount of water that's in the air compared to how much it could take at maximum, that is if the pressure was saturated. So I've defined these functions. I can get them into my system. And now I can check and see what happens with those functions. So I'm going to plot over 100 points. I'm going to go over pressure in a numpy range from 100,000. That's a little less than one normal atmosphere up to 102,000. That's a little more than one standard atmosphere. I'm going to go over a range of temperatures from 20 up to 80 degrees Celsius. And then once I'm looking over that range, I'll get the pressure that I'm interested in based on what the saturation pressure is. So I'm going to have a linear space from zero up to the saturation pressure. I'll make a space to put my density in. And then for each of the values there, I'll calculate a density value from this row ideal function. Then I could plot that out and put some labels on it. And let's see what happens. So I plotted it out. And for temperatures up here at 20 degrees C and a relatively small range of humidities, I get values around 1.2 kilograms per cubic meter. As I increase the temperature, that's where I see this significant effect of these four different bands getting a lower and lower density as I increase the ambient temperature. So I check these numbers and they seem to make sense. So I'm fairly confident in these functions that I built up here. So let's try it in terms of relative humidity here. We'd like to work in relative humidity, although it makes our calculation a little more complicated because the relative humidity really depends on what the saturation pressure is at that particular temperature. But I can do exactly the same kind of thing here. For the pressure in the various range of the temperature in the various range, I can calculate the relative humidity over a linear space from 0 to 100, 0 to 100 percent. And I'll get my density is still my placeholder to put things into. And then I'll go over a range from 0 to N where I calculate the density based on relative humidity rather than on partial pressure. And I'll do the plot and we'll see what comes out. And I do that plot and I find the same collection of densities, but now I've got a different quantity on the x-axis here. I got relative humidity. And I can see the slopes of these lines are different. So the function's now a little bit more complicated. Now the question then becomes how are we going to estimate our uncertainties in this derived density number, especially if we're starting with relative humidity.