SciMLBase.jl icon indicating copy to clipboard operation
SciMLBase.jl copied to clipboard

DAEFunction's observed should get `du`

Open Keno opened this issue 3 years ago • 4 comments

Currently all the observed function have the signature (sym, u, p [, t]). However, for DAEFunction, our equations in general depend on du, so if we want to move something to observed, du would have to be available. I think it would make sense to change the signature of observed for DAEFunction to take du also. cc @YingboMa

Keno avatar Oct 30 '22 03:10 Keno

What's a case where the observed variable requires a du to be defined?

ChrisRackauckas avatar Oct 30 '22 13:10 ChrisRackauckas

I don't think MTK does this right now, but you might have something like:

D(x) ~ f(x)
D(x) ~ z

In that case z can be made observable with z := D(x).

Keno avatar Oct 30 '22 15:10 Keno

We have now seen this return incorrect observed in the wild. What needs to be done to address this?

pepijndevos avatar Dec 07 '23 16:12 pepijndevos

We have now seen this return incorrect observed in the wild

That's a different issue. Can you open an issue with an MWE? This issue is about the fact that the du is not necessarily saved or defined (if the interpolation does not exist). There is no way for it to be incorrect if there is nothing computed, so I'd need more information on what you're computing.

ChrisRackauckas avatar Dec 07 '23 17:12 ChrisRackauckas