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
113 stars 13 forks source link

Hint about MSOLVER "Inconsistent units" error occurring #1323

Open Wiljea opened 1 week ago

Wiljea commented 1 week ago

This happens in "2 Slits Young Interference" of the Equations Library. The idea is to compare two cases, one which works fine and a second one which fails only due to different output units in the ROOT call. The eqns to be solved are: "'(I(W/m^2))/(Imax(W/m^2))=4·(COS(Δφ_°)/2)^2' " "'(Δφ_r)=(2·(Ⓒπ_r)·(dμm)·SIN(θ°))/(λnm)' " "'TAN(θ°)=(y_m)/(L_m)' " "'(Δyint_m)=(λ_nm)·(L_m)/(d_μm)' "

The case which works fine: L=2_m d=800._μm λ=600_nm θ='ASIN(0.6·(λ_nm)/(dμm))' Imax=10(W/m^2) @ Expecting [ Δφ=3.76991 11843 1 r I=6.54508 49718 7 W/m↑2 y=9.00000 09112 5⁳⁻⁴ m Δyint=1.5⁳⁻³ m ] 'ROOT(Ⓔ2 Slits Young Interference;[Δφ;I;y;Δyint];[1r;1(W/m^2);1_m;1_m])'

The case which fails with "Inconsistent units" (using the same input data): L=2_m d=800._μm λ=600_nm θ='ASIN(0.6·(λ_nm)/(dμm))' Imax=10(W/m^2) @ Failing [ Δφ=3.76991 11843 1 r I=6.54508 49718 7 W/m↑2 y=0.90000 00911 25 mm Δyint=1.5 mm ] 'ROOT(Ⓔ2 Slits Young Interference;[Δφ;I;y;Δyint];[1r;1(W/m^2);1_mm;1_mm])'

Strangely the only minor change is "1_m;1_m" replaced by "1_mm;1_mm" at the end of the ROOT call. This should not make any difference.

Wiljea commented 4 hours ago

A very simple case of "EquationSolver error : No solution ?": ω0=15_r/s k=10N/m 'ROOT((ω0(r/s))=(1r)*√((k(N/m))/(m_kg));[m];[1_kg])' the answer should be [ m=4.44444 44444 4e-2 kg ]

I tried to insert UBASE with no more success.