Skip to content
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

Add model transformer for non-dimensionalisation #984

Open
clinssen opened this issue Nov 10, 2023 · 1 comment
Open

Add model transformer for non-dimensionalisation #984

clinssen opened this issue Nov 10, 2023 · 1 comment

Comments

@clinssen
Copy link
Contributor

Currently, physical units and their factors (nano-, micro-, kilo-, etc.) are stored in the model AST and converted by the printers during code generation.

I would suggest to replace this architecture with a transformer, that converts a model with quantities in terms of physical units, to a model containing only real-typed quantities (and int, bool, string, etc). Then, the printers and code generator do not have to deal with conversion factors.

See also #608.

@clinssen
Copy link
Contributor Author

Suggestion from @heplesser: to ward against confusion between variable names and unit literals, NESTML should allow unit literals to appear only directly after numeric literals, for example, V' = 2 * V - V_L would have V as voltage, exp(-V / (1 V)) would have the voltage in the numerator, divided by 1 V to make it unitless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant