-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
non-SI units not working #1037
Comments
This really requires someone to dig into MTK and DynamicQuantites to understand how they are handling numeric coefficients that arise when converting and comparing units, and ensure that only numeric components arising from unit conversions are getting compared (i.e. numeric components that are part of expressions like |
MTK version 9.34 supports non-SI units as described here: SciML/ModelingToolkit.jl#2621 . However Catalyst is currently pinned to MTK v9.32. So it may just be as simple as updating that dependency. |
Catalyst isn't pinned to 9.32; are you sure this isn't something you did locally? I currently have ModelingToolkit 9.35.1 with Catalyst 14.4 locally. Note that the line
in the Project.toml means support is declared for any 9.X release with X >= 32 (see https://pkgdocs.julialang.org/v1/compatibility/). |
I suspect the issue here is that ModelingToolkit converts non-SI units to SI internally it seems, and that can lead to expressions where numeric coefficients in a symbolic expression get merged with numeric coefficients generated from the unit conversions (like in converting micromolar to mol/m^3). There is then no effective way to unit check after this point. I think expressions need to have numeric coefficients removed prior to unit conversion to avoid this issue. |
Or perhaps a way is needed for users to indicate how registered functions transform units to avoid having to try to trace through them. |
Oh, sorry, I guess I should have read the manual more carefully :) |
No worries! I still get messed up on aspects of semver in Julia (and finding out where to even read about it can take a bit of effort). |
This may be related to SciML/ModelingToolkit.jl#3017 |
SI units works, i.e.
passes, but non-SI units still have issues right now:
gives
So it seems there are still issues with unit conversion to SI going on.
The text was updated successfully, but these errors were encountered: