Numerical random search

numericalrandomsearch.png

In meteorological station, air humidity measurement often use hygrometer which can give direct value in RH unit (%), but many meteorological station did not has this feature, so they use temperature measurement to calculate air humidity data.

Air humidity calculation using temperature data also give some problem about the data it self. Many meteorological stations have been recording temperature data in the minimum and maximum temperature daily only. So, if we want to know the variation of humidity every day, we might not get it, because we don't have temperature data based on the time of day (for example per hour or per ten minutes), while this data is very much needed if we are going to learn about plant micro-climatology.

To calculate air humidity from temperature data could be use below equation:

Es = 6.1078 exp {(17.239Twb / (Twb+237.3)}

Ea = Es – 0.661 (Tdb – Twb)

RH = (Ea / Es) 100%

Where:

Es = water vapor potential (mbar)

Ea = water vapor actual (mbar)

Twb = Temperature of wet bulb thermometer (°C)

Tdb = Temperature of dry bulb thermometer (°C)

RH = Relative humidity

We need information or data about air humidity fluctuation or variation in the one-day. How much the minimum, maximum and average the air humidity in relative humidity unit (%) if we only know the maximum and minimum temperature from dry and wet bulb thermometer in one-day?

Formulation of the problem

This problem will be solve using Numeric Search – Random Search.

Relative humidity will calculate using above equation and the temperature data will provided by four data which recorded in one day:

  • Maximum dry bulb temperature: X1_max

  • Minimum dry bulb temperature: X1_min

  • Maximum wet bulb temperature: X2_max

  • Minimum wet bulb temperature: X2_min

Generate X1 and X2 random numbers R1 :

  • X1 = X1_min +Ri (X1_max-X1_min)

  • X2 = X2_min +Ri (X2_max-X2_min)

Calculate the water vapor pressure by using above function:

  • Es = 6.1078 exp {(17.239 X2 / (X2 +237.3)}

  • Ea = Es – 0.661 (X1 – X2)

  • RH = (Ea/Es) 100%

RH calculation should be iterate base on minutes/day (1440 minutes)

Save RH as temporary solution

Compare and calculate :

Maximum RH (* is maximum or temporary value)

  • IF RH > RH_max* then RH_max* = RH; X1* = X1 and X2* = X2

Minimum RH ((* is minimum or temporary value)

IF RH < RH_min* then RH_min* = RH; X1* = X1 and X2* = X2

Average RH

  • RH_avg = (ΣRH) / number of iteration

Expected result

Get the maximum, minimum and average air relative humidity and how is the maximum and minimum temperature when the value has reached.

Finding the optimal value

Fluctuation of air humidity that represent by relative humidity could be used in the microclimate condition on certain site. For example, if we have crop plantation we need information on potential water needed and photosynthesis rate of plant that could be estimated from transpiration rate, while transpiration process (dilatation) is determined by air humidity. So once we are able to identify maximum, minimum and average RH we can also identify stomata activity and potential photosynthesis daily.

Solving the problem

Visual Basic 6 used to solve above problem. For example, the data as input is :

  • Maximum dry bulb temperature is 32°C

  • Minimum dry bulb temperature is 21°C

  • Maximum wet bulb temperature is 29°C

  • Minimum wet bulb tempereture is 17°C

Number of iteration is 1440 (same as number of minutes/day)

'Random search technique
Dim x1 As Double
Dim x2 As Double
x1_min = Minimum dry bulb temperature
x1_max = Maximum dry bulb temperature
x2_min = Minimum wet bulb temperature
x2_max = Maximum wet bulb temperature
MaxIter = Maximum Iteration
'Initialization
RH_max = 0
RH_min = "100"
RH_avg = 0
For i = 1 To MaxIter
'Generated random value of x1 and x2
    x1 = x1_min + Rnd(X1_max - x1_min)
    x2 = x2_min + Rnd(x2_max - x2_min)
 
'Calculated function
        es = 6.108 * Exp(17.27 * x2 / (x2 + 237.3))
        ea = es - 0.661 * (x1 - x2)
        RH = (ea / es) * 100
'Determination of Maximum RH
    If RH > RH_max Then
        RH_max = RH
        X1_RHmax = x1 'The value of dry bulb temperature when RH_max has been reached
        X2_RHmax = x2 'The value of wet bulb temperature when RH_max has been reached
    End If
'Determination of Mimimum RH
    If RH < RH_min Then
        RH_min = RH
        X1_RHmin = x1 'The value of dry bulb temperature when RH_min has been reached
        X2_RHmin = x2 'The value of wet bulb temperature when RH_min has been reached
    End If
'Determination of accumulated of RH
    Sum_RH = Sum_RH + RH
'Determination of average RH
    RH_avg = Sum_RH / i
Previous
Previous

Sistem Peringkat Bahaya Kebakaran

Next
Next

Multi Person Decision Making