Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSOLVER: "Invalid function" (in "Black Body Radiation"?) #1307

Closed
Wiljea opened this issue Nov 5, 2024 · 3 comments
Closed

MSOLVER: "Invalid function" (in "Black Body Radiation"?) #1307

Wiljea opened this issue Nov 5, 2024 · 3 comments
Labels
bug Something isn't working user Reported by an actual user, yay!

Comments

@Wiljea
Copy link

Wiljea commented Nov 5, 2024

The solution of MSOLVER takes a very long time and finally gives Invalid function. This is probably due to the integration in the following equations:

"Black Body Radiation",  "{ "
// In eqn 2, change the calls for F0λ to explicit integral where the
// integration limits are from x1 to x2 with xi,j=Ⓒh·Ⓒc/((λi,j_nm)·Ⓒk·(T_K))
"'(eb_(W/m^2))=Ⓒσ·(T_K)^4' "
//"'f=F0λ((λ2_nm);(T_°C))-F0λ((λ1_nm);(T_°C))' "
"'f=15/Ⓒπ^4·∫(Ⓒh·Ⓒc/((λ2_nm)·Ⓒk·(T_K));Ⓒh·Ⓒc/((λ1_nm)·Ⓒk·(T_K));x^3/expm1(x);X)' "
"'(eb12_(W/m^2))=f·(eb_(W/m^2))' "
"'(λmax_nm)·(Tmax_°C)=Ⓒc3' "
"'(q_W)=(eb_(W/m^2))·(A_(cm^2))' "
"}",
@Wiljea
Copy link
Author

Wiljea commented Nov 15, 2024

But I discover that it is truly related to ISSUE #1314.
Moreover in the present case the integration limits are pure numbers with:

T=1273.15_K  λ1=1000_nm  λ2=600_nm
'Ⓒh*Ⓒc/((λ2_nm)*Ⓒk*(T_K))=1.88347 62339 3⁳⁻⁸ m/nm'

and if I apply UBASE I obtain 18.83476 23393

'Ⓒh*Ⓒc/((λ1_nm)*Ⓒk*(T_K))=1.13008 57403 6⁳⁻⁸ m/nm'

and if I apply UBASE I obtain 11.30085 74036

Then the integral computes

'f='15/Ⓒπ^4*∫(11.30085 74036;18.83476 23393;X^3/expm1(X);X)'=3.60929 06376 4e-3

Therefore in this case EITHER we need an algebraic expression of BASE to apply it to the limits OR the integration algorithm needs to apply BASE to the limits X1 & X2

@Wiljea
Copy link
Author

Wiljea commented Nov 19, 2024

I just write to @c3d, because I was able to rule out the problem, not by deleting units using VALUE for instance but by imposing the required simplification. Because, indeed, the limit of integration is a complicated algebraic expression: 'ⒸhⒸc/((λ2_nm)Ⓒk(T_K))' which simplifies to a pure number that I can recover by doing:

T=1273,15_K  λ1=1000_nm  λ2=600_nm
'→NUM(UBASE(Ⓒh*Ⓒc/((λ2_nm)*Ⓒk*(T_K))))'
@ Expecting 18.83476 23393
'→NUM(UBASE(Ⓒh*Ⓒc/((λ1_nm)*Ⓒk*(T_K))))'
@ Expecting 11.30085 74036

Then we can compute the integral without problem. A similar technique may also apply to #1314. I will do a commit of equations.cc including these corrections and I hope that a special version will be available soon. This concerns 15 different integrals in 7 simulations !

@c3d c3d added bug Something isn't working user Reported by an actual user, yay! labels Dec 2, 2024
@c3d c3d changed the title MSOLVER: "Invalid function" probably due to the integration in "Black Body Radiation" MSOLVER: "Invalid function" (in "Black Body Radiation"?) Dec 2, 2024
@Wiljea Wiljea closed this as completed Feb 6, 2025
@Wiljea
Copy link
Author

Wiljea commented Feb 6, 2025

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user Reported by an actual user, yay!
Projects
None yet
Development

No branches or pull requests

2 participants