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

Improve printing/display of XSystem parameters #2651

Open
TorkelE opened this issue Apr 16, 2024 · 0 comments · May be fixed by SciML/SymbolicIndexingInterface.jl#114
Open

Improve printing/display of XSystem parameters #2651

TorkelE opened this issue Apr 16, 2024 · 0 comments · May be fixed by SciML/SymbolicIndexingInterface.jl#114
Assignees

Comments

@TorkelE
Copy link
Member

TorkelE commented Apr 16, 2024

Currently, if we have a XProblem:

using Catalyst

@parameters p d
@variables t X(t)
D = Differential(t)
eq = D(X) ~ p - d*X
@mtkbuild osys = ODESystem([eq], t)

u0 = [X => 1.0]
ps = [p => 2.0, d => 0.5]
oprob = ODEProblem(osys, u0, (0.0, 1.), ps)

we can look at its parameters using

println(oprob.p) # Gives [2.0, 0.5]
println(oprob.ps) # Gives a very long structure.

However, neither of these are very useful. The first depends on order to tell us which parameter is which (which we should not do since I don't know when). The second doesn't tell us any information at all.

Wouldn't it make sense to at least for one of these display something like

p => 2.0
d => 0.5

This creates an easy way for the user what parameter values they have in a problem.

It would be good to have something similar for u. However, I realise oprob.u0 might just be a normal vector, in which case this might not be possible. However, at least for oprob.ps this should be possible.

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

Successfully merging a pull request may close this issue.

2 participants