Open Wiljea opened 2 weeks ago
As I commented elsewhere, the BASE function has to be applied to the integration LIMITS but also to the INTEGRAND itself. In the last version of the simulation with the recent equations.cc (simulator constructed from the EQNS branch) I tried the computation with no net units remaining in both limits & integrand. But to simplify these units either the algorithm has to execute BASE or the user has to do so with an algebraic form of BASE. This will be the simplest solution for the time being.
It is essential to cure this problem because we now have 1 (Black Body) + 2 (Terminal Velocity) + 2 (Buoyancy & Terminal Velocity) + 4 (Planck & Wien Comparison) + 4 (Planck & Rayleigh-Jeans Comparison) = 13 such integrals up to now in the Library Equation. And in all case this idea of algebraic BASE function should work without further modifications of the Romberg algorithm.
In the Examples1 & 2 of the "Terminal Velocity" simulation, I added two new eqns (3) & (4), where the latter involves an integral (Δx=∫v·dt from 0 to tfr): "'(vt_(m/s))=√((2·(mkg)·Ⓒg)/(Cd·(ρ(kg/m^3))·(Ahcm^2)))' " "'v(m/s)=(vt_(m/s))·TANH((ts)·Ⓒg/(vt(m/s)))' " "'tfrs=ATANH(fr)/(Ⓒg/(vt(m/s)))' " "'xfrft=(vt(m/s))·∫(0_s;tfr_s;TANH((ts)·Ⓒg/(vt(m/s)));t)' "
Previously, MSOLVER worked fine for vt & v alone:
Then, I added a new variable
fr
: fraction of terminal velocity (fr=0.95) and two new unknowns:[tfr_s ; xfr_ft]
(time required to reach the fractionfr
ofvt
, displacement duringtfr
) with their respective eqns. Using them, I just calculated by hand the two required answers: @ Expecting [ tfr=10.00590 25332 s xfr=1 117.39339 246 ft ]AND the problem lies with the integral using physical units (in the limits & variables): '(175.74722 3631_ft/s)·∫(0_s;10.00590 25332_s;TANH((t_s)·Ⓒg/(175.74722 3631_ft/s));t_s)' doesn't work
where in TANH, t_s needs to be in second in order to cancel units from the remaining factors of the argument. Indeed, after many attempts, I found the only way to obtain a valid answer with: '(175.747223631_ft)·∫(0;10.0059025332;TANH(t·Ⓒg/(175.747223631_ft/s)·(1_s));t)' =1 117.39339 246 ft=xfr providing that I cancel myself the remaining units of TANH. In other words, integration works ONLY WITHOUT physical units (I had also to remove them from the integration limits, which is not physically satisfactory). This is probably related to ISSUE #1307. The very same problem is encountered in 3 other cases. Everything is clearly documented in "equations.md".