c3d / db48x

RPL runtime for the DM42 calculator, in the spirit of HP48/49/50
http://48calc.org
GNU Lesser General Public License v3.0
107 stars 13 forks source link

The db48x needs the Black-Body Integral function F0λ(T_K, λ_nm) (Low priority) #1139

Open Wiljea opened 2 months ago

Wiljea commented 2 months ago

The db48x needs the emissive power Black-Body Integral function F0λ(T_K, λ_nm) defined in the HP50G (HP50G_AUR 3-82 and 5-31 for a graphic illustration of the under the curve surface). This is a low priority issue since there is only one section "Black Body Radiation" concerned in the chapter "Heat Transfer".

Wiljea commented 1 month ago

Either the developer defines the function F0λ(T_K, λ_nm) internally or I calculate them directly in the Equation Library. We need the precise algebraic syntax of the n-ary function INTEGRATE. Is it: INTEGRATE(xmin; xmax; h(x); x) ? Let's assume this syntax is the correct one.

Since the integral from 0 to of g(x) = x^3/(EXP(x)-1) = π^2/15, one can verify on the db48x that the integral of h(x) = (15/π^2)·x^3/EXPM1(x) where EXPM1(x) = (EXP(x)-1) gives the normalized value of one. Concretely:

with x = Ⓒh·Ⓒc/((λ_nm)·Ⓒk·(T_K)) one can verify numerically (on the db48x):

INTEGRATE(0.001; 1000 ;h(x); x) = 0.99999 99999 31043 which is close enough to 1. Note that for numeric convergence of the integration algorithm, xmin = 0.001 was chosen instead of 0 and xmax = 1000, instead of . Note also that for numerical convergence the function h(x) used here is defined in terms of the frequency instead of the wavelength because in terms of the latter (with the appropriate change of variable), results are not as good: f(x') = (15/Ⓒπ^2)·x'^-5/(EXP(1/x')-1) with x'=1/x = (λ_nm)·Ⓒk·(T_K)/(Ⓒh·Ⓒc)

Therefore, a call to the emissive power function will translate in the db48x as:

F0λ(T_K, λ_nm) = (15/Ⓒπ^2)·INTEGRATE(Ⓒh·Ⓒc/((λ_nm)·Ⓒk·(T_K)); 1000 ;x^3/EXPM1(x); x)

where, taking into account the change of variable x=1/x', we integrate from xmin to (here: 1000) the distribution depending on the frequency f(x) instead of integrating from 0 to x'min the distribution depending on the wavelength g(x') (the one which is illustrated in the HP50G_AUR). Both approaches are physically equivalent with the same normalisation.

Note, however, that I do not reproduce the numerical results of the SOLVER of the HP50G which finds f = F0λ(λ2; T) – F0λ(λ1; T) = 0.0036 (see HP50G_AUR p. 5-31) while the 3 calculators (db48x, HP50G, HP-Prime) obtain f = 0.000320698 for the same subtraction of integrals when explicitly calculated. I am confident enough in my calculations to claim that there is an error in the calculation of the HP50G.