-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Time can't have units in systems generated by DSL #1141
Comments
See https://github.com/SciML/Catalyst.jl/blob/master/test/miscellaneous_tests/units.jl for example usage. But note units have been somewhat broken ever since MTK switched to DynamicQuantities. If I remember right, converting everything to SI means that numeric prefactors can intermix with factors from implicit conversions and give incorrect results, and registered functions also have issues. |
You also shouldn’t ever use an external symbolic, |
rs = @reaction_network begin
@ivs t [unit=u"s"]
@species begin
A(t), [unit=u"mol/m^3"]
B(t), [unit=u"mol/m^3"]
C(t), [unit=u"mol/m^3"]
end
@parameters begin
k1, [unit=u"mol/(s*m^3)"]
k2, [unit=u"s^(-1)"]
k3, [unit=u"(m^3)/(s*mol)"]
end
k1, 0 --> A
k2, A --> B
k3, A + B --> 2B
end |
Thanks, that works! |
Describe the bug 🐞
I would like to be able to use the DSL to generate systems that have time with units of seconds. However, I cannot figure out how to make this happen.
Expected behavior
I would like the time to have units of seconds.
Minimal Reproducible Example 👇
So, in the above code, I would like
to result in
1.0 s
, because I am usingModelingToolkit.t
, which has units of seconds, but instead it results in1.0
.Error & Stacktrace⚠️
No error, as such.
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
cc @jialinl6
The text was updated successfully, but these errors were encountered: