-
Notifications
You must be signed in to change notification settings - Fork 14
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
Bug in Open for variables that are derivatives #134
Comments
This is because we do a renaming by appending dots. e.g. Here, V becomes X \dot \dot. julia> SummationDecapode(dexpr)
SummationDecapode{Any, Any, Symbol} with elements Var = 1:6, TVar
= 1:2, Op1 = 1:2, Op2 = 1:2, Σ = 1:0, Summand = 1:0, Type = 1:0, Operator = 1:0, Name = 1:0
┌─────┬──────────┬────────┐
│ Var │ type │ name │
├─────┼──────────┼────────┤
│ 1 │ Form0 │ X │
│ 2 │ Form0 │ Ẋ │
│ 3 │ Constant │ k │
│ 4 │ infer │ mult_1 │
│ 5 │ infer │ Ẋ̇ │
│ 6 │ Literal │ -1 │
└─────┴──────────┴────────┘
┌──────┬──────┐
│ TVar │ incl │
├──────┼──────┤
│ 1 │ 2 │
│ 2 │ 5 │
└──────┴──────┘
┌─────┬─────┬─────┬─────┐
│ Op1 │ src │ tgt │ op1 │
├─────┼─────┼─────┼─────┤
│ 1 │ 1 │ 2 │ ∂ₜ │
│ 2 │ 2 │ 5 │ ∂ₜ │
└─────┴─────┴─────┴─────┘
┌─────┬───────┬───────┬─────┬─────┐
│ Op2 │ proj1 │ proj2 │ res │ op2 │
├─────┼───────┼───────┼─────┼─────┤
│ 1 │ 6 │ 3 │ 4 │ * │
│ 2 │ 4 │ 1 │ 5 │ * │
└─────┴───────┴───────┴─────┴─────┘ |
The renaming-with-dot behavior should get changed, but just to ascertain whether composition of derivatives works, does using X dot dot instead of V in your MWE work with whatever composition you were attempting? |
Yes, that workaround works. I guess this is a general problem about special casing the decapodes implementation to the DEC. Maybe we should refactor out the diagrammatic equations part and then have the parts that assume special structure of DEC as postprocessing. |
I think the real reason here is that sometimes users write |
Calling this quantity X dot dot gives the human some information that this is a double derivative without having to do any analysis of the TVar table. Calling it V respects the way that the user specified variable names in the macro. Both naming conventions are nice in their own way. The latter should probably be preferred since the former loses information. In the PR that closes this, I want to provide a function that does the dot renaming in its current aggressive form, but do the respectful non-renaming by default. Best of both worlds. |
It looks like if you want to expose a variable that is a derivative, you can't.
MWE:
The text was updated successfully, but these errors were encountered: