Vapor pressure calculation
In this exercise we will use a thermodynamics relation in order to calculate : vapor pressure, saturated vapor pressure, relative humidity.
in order to calculate the above variables we need to know the air temperature and the dewpoint .
Question
Using the above relationship define and appropriate temperature [degree Celsius], calculate: the vapor pressure, the saturation vapor pressure and the relative humidity.
Solution
1
yacine.mezemate:
2
"""
3
# Here is Python script which calculate P, P_s and R_h :
4
5
import numpy as np
6
# input
7
# T: the air temperature degrees Celsius
8
# Td: the dewpoint degrees Celsius
9
# output
10
# P : vapr pressure millibars
11
# Ps: saturated water pressure millibars
12
# Rh: Relative humedity
13
T = 20
14
Td = 15
15
exposantP = (7.5*Td)/(237.3 + Td)
16
P = 6.11 * np.power(10, exposantP)
17
exposantPs = (7.5*T)/(237.3 + T)
18
Ps = 6.11 * np.power(10, exposantPs)
19
Rh = (P/Ps)*100
20
print("Vapr pressure: %d"%P , "Saturated water pressure: %d" %Ps , "Relative humedity: %d " %Rh)
21
Question
For different values of and plot P(T).
Hint
Put the above script in loop for different values of