1#
2#   Model function for Reflectivity evaluation
3#
4
5mu = 1.130469005513490E-001                     # (cm-1) @ 17.479 keV
6t0 = 0.18                                       # cm
7tb = 11.417823202820120 * 0.01745329251994      # thetaB (radians)
8A = mu * t0 / cos(tb)
9P = (1 + (cos(2.*tb))**2) / 2
10Fhkl = sqrt(3.536346308456155**2 + (4.58815426260982e-4)**2) * 0.968
11r0 = 2.81794092e-13                             # classical electron radius
12lambda = 7.09338062818239e-9                    # Mo K in cm
13V = 1.62253546981499e-23
14P = (1. + (cos(2.*tb))**2) / 2.
15#
16# combine constants to avoid exponential overflow on systems with
17# D floating point format where exponential limits are ca. 10**(+/-38)
18# r0liV = r0 * lambda / V
19r0liV = 2.81794092*7.09338062818239/1.62253546981499e-1
20#
21
22W(x) = 1./(sqrt(2.*pi)*eta) * exp( -1. * x**2 / (2.*eta**2) )
23Y(tc) = tc/sin(tb) * Fhkl * r0liV
24f(tc)= (tanh(Y(tc)) + abs(cos(2.*tb)) * tanh(abs(Y(tc)*cos(2.*tb)))) / (Y(tc)*(1.+(cos(2.*tb))**2))
25Q(tc) = (r0*Fhkl/V)**2 * (lambda**3/sin(2.*tb)) * P * f(tc)
26a(x) = W(x) * Q(tc) / mu
27
28#
29
30R(x) = sinh(A*a(x)) * exp(-1.*A*(1.+a(x)))
31