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

Converting equations (and Symbolics) to strings #1034

Open
TorkelE opened this issue Jan 3, 2024 · 2 comments
Open

Converting equations (and Symbolics) to strings #1034

TorkelE opened this issue Jan 3, 2024 · 2 comments

Comments

@TorkelE
Copy link
Contributor

TorkelE commented Jan 3, 2024

I am preparing functionality for saving Catalyst ReactionSystem models to file. Basically, I would just create a .jl file which recreates the reaction network model from scratch (and can be loaded through e.g. include.

This will require converting symbolic expressions to Strings so that they can be written to files. Is there any functionality for this, or do we need to create this?

@ChrisRackauckas
Copy link
Member

I think this should probably live in SymbolicIndexingInterface since that's where getname/hasname originates. stringname or something.

@TorkelE
Copy link
Contributor Author

TorkelE commented Jan 3, 2024

Still, some simple conversions are possible just using Symbolics, e.g.

@syms x y z
@variables t X(t) Y(t)

String(Symbol(x)) # "x"
String(Symbol(t)) # "t"
String(Symbol(X)) # "X(t)"

so something like this could exist in Symbolics. Not sure whether there is some additional stuff one would need which requires knowledge of a system though, but think it should be fine.

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

No branches or pull requests

2 participants