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 np6
# input7
# T: the air temperature degrees Celsius8
# Td: the dewpoint degrees Celsius9
# output10
# P : vapr pressure millibars11
# Ps: saturated water pressure millibars12
# Rh: Relative humedity13
T = 2014
Td = 1515
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)*10020
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





