-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Suggestion: Make plot
plot unknowns AND observables by default (not just unknowns)
#3555
Comments
Even small models may have 1000s of observables.. |
I mean, this entierly depends on what you are using MTK for right? For people who does DAEs with very few differential equations and many many algebraic equations, yes. But I (and many others) have very few algebraic equations. Furthermore, when we use them it is typically because it is some quantity that we explicitly want to plot. I don't think we should specialise MTK to cater only to one specific field. |
Sure but if you try to plot 1000s of signals Julia will crash, so that's not a reasonable default |
So there are cases where one option makes sense and another doesn't? In Sys bio the main reason for observables is pretty much the opposite (I have 3,000 differential equations, butonly want to plot ~5 observables. So I distinctly specify these things to plot to avoid the crash). Ultimately, to the user, there isn't really any difference to observables/unknowns, they are all hidden stuff anyway? This feels exactly like the cases when you should use If our goal is to avoid accidental plotting of too much stuff, having a some heuristic/limit seems like the correct solution right. By default never plot more than 20/100/some other number of quantities, that sounds sensible. Anyone who does this (whether this is due to them having many differential/algebraic equations, or both) are probably making a mistake (and again one can plot all quantities using the |
The default plot is also not great for things like SBML reads where it can also crash your computer 😅, but including the observed by default only compounds to it. So I don't think we should plot the observables by default, but we should document an easy to do it. I don't know if we do.
Yes we should probably limit it by default to the first 100 indices and throw a warning. |
One could even imagine an heuristic where:
In practise it might be sensible not to meddle too much within, and as Chris said, only plot the first 100 (and in this case I'd think one might as well throw the observables in here, at least in certain cases, but that is my opinion). If there is more than 100, throw a warning telling the uer that they probably want to plot everything). Then we add a function |
To me it makes most sense that the plotting (continues to) show a minimal representation of the solution, i.e. only the unknowns, by default. But I do think it sounds like a good idea to error/warn if there are more than e.g. 100 and
I think such a function sounds like a very good idea. Personally I think using Plots
plot(sol) # maybe this should set idxs = nothing, so we can detect it when idxs is not explicitly set and error/warn
plot(sol, idxs = unknowns(sys))
plot(sol, idxs = [unknowns(sys); observeds(sys)])
# ... |
I agree we've been missing this one. I've been writing |
When splitting what variables become unknowns and what are observables, I feel like it makes sense to lump them together in the plot (i.e. plotting all by default). I.e. here:
only
X
is plotted (unless one specifyY
explicitly). Now from a user perspective there is no real difference here, they don't know whyX
is plotted and notY
. I think this is one of (if not the only?) cases wherestructural_simplify
have a direct impact on workflows.Furthermore, changing this would:
structural_simplify
. I.e. there could be minor updates to its algorithm that suddenly changes so thatX
is eliminated andY
is not (probably not in the example above, but in more complicated ones). If the observables are ploted, the user will never notice or case.eqs = [D(X) ~ -p]
is one that can be solved directly, i.e. the only unknown of the system becomes an observable. Here, if you doplot(solve(prob))
you will just get an empty plot plane, which seems really confusing.I think the other alternative is to just enforcethe use of
idxs =
inplot
. That makes sense for larger models. However, for small models this will be annoying.The text was updated successfully, but these errors were encountered: