Plus42: incorrect behaviour in equation using temperature UOM
|
05-27-2024, 04:21 PM
(This post was last modified: 05-27-2024 04:58 PM by Thomas Okken.)
Post: #4
|
|||
|
|||
RE: Plus42: incorrect behaviour in equation using temperature UOM
This is indeed a bug.
When the numeric solver calls the function to be solved and receives a return value with an attached unit, it needs to get rid of the unit before being able to use the return value in the root finding iteration algorithm. This unit removal needs to be done in a way that gives consistent results, even if the function can return results with different units at different iterations. (Of course the units returned by the function must always be consistent between iterations: returning m in one iteration and ft in another is fine, but returning m in one iteration and m^2 in another is not.) The current implementation performs this consistent unit removal using UBASE and then UVAL. This works fine in most cases, except with °C and °F, because of the offset introduced when UBASE converts those to K. This could be fixed by remembering the unit returned by the first successful call of the function to be solved, and converting all subsequent return values to that initial unit using CONVERT, and then using UVAL to get the scalar. Or maybe °C and °F should be handled completely separately and not be considered compatible with anything, even each other. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Plus42: incorrect behaviour in equation using temperature UOM - Marco Polo - 05-27-2024, 01:32 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - ht003 - 05-27-2024, 03:16 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Marco Polo - 05-27-2024, 03:25 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Thomas Okken - 05-27-2024 04:21 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Albert Chan - 05-27-2024, 05:15 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Thomas Okken - 05-27-2024, 06:32 PM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Marco Polo - 05-28-2024, 07:54 AM
RE: Plus42: incorrect behaviour in equation using temperature UOM - Marco Polo - 05-28-2024, 07:41 AM
|
User(s) browsing this thread: 2 Guest(s)