Closed franflame closed 1 month ago
@franflame thank you for opening this issue. You are correct and I agree with your suggested form. The original scaled form is
$scaled = 10 \frac{\log unscaled - \log min}{\log max - \log min}$
Solving for $unscaled$ yields
$\log \frac{unscaled}{min} = \frac{scaled}{10} \log \frac{max}{min}$
$unscaled = min (10 \log \frac{max}{min})^\frac{scaled}{10} = min (\frac{max}{min})^\frac{scaled}{10}$
which matches your alternative formula.
I concur with @bpaul4, the math checks out.
During development for #1197, we found a potential mathematical inconsistency in the formula for the "Log" unscaling function. https://github.com/CCSI-Toolset/FOQUS/blob/fb0777c385d6c24286129e25bca2da6f1557e6a5/foqus_lib/framework/graph/nodeVars.py#L727-L728
For #1197, we found that the following alternative seems to work:
For reference, a plot of the scaling formulas can be found here: https://www.desmos.com/calculator/dxyj2nmpln