Skip to content

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Jun 11, 2023

When I originally wrote this code, I didn't really understand how it was supposed to work, simply copying the algorithm from modia. As a result, the algorithm was somewhat incomplete, and we ended up switching to dummy_derivative_graph! instead. However, we are now seeing issues where the state selection from dummy_derivative_graph! (ddg) is resulting in state selections that are numerically sub-optimal because ddg does not respect solvability. With the benefit of hindsight, fix pss_graph_modia! to be actually correct.

The keen eyed reader will notice that the changes to pss_graph_modia! are essentially exactly what ddg does right now, except that I don't currently implement the linear case. I think it would make sense to further unify this and fully switch over MTK to the new pss_graph_modia!, but past experience has shown the MTK/Downstream tests to be quite sensitive to the exact state selection, so this does not attempt to make that change yet.

@YingboMa
Copy link
Member

Can we add this as an option in ddg? It seems like a different priority for nonlinear equations.

When I originally wrote this code, I didn't really understand how it
was supposed to work, simply copying the algorithm from modia. As a
result, the algorithm was somewhat incomplete, and we ended up switching
to dummy_derivative_graph! instead. However, we are now seeing issues
where the state selection from `dummy_derivative_graph!` (ddg) is resulting
in state selections that are numerically sub-optimal because ddg does
not respect solvability. With the benefit of hindsight, fix pss_graph_modia!
to be actually correct.

The keen eyed reader will notice that the changes to pss_graph_modia!
are essentially exactly what ddg does right now, except that I don't
currently implement the linear case. I think it would make sense
to further unify this and fully switch over MTK to the new `pss_graph_modia!`,
but past experience has shown the MTK/Downstream tests to be quite
sensitive to the exact state selection, so this does not attempt to
make that change yet.
@Keno
Copy link
Contributor Author

Keno commented Jun 13, 2023

Yes, we should unify these. However, I'd like to do that in a separate PR. This function still needs support for the linear exact jacobian that ddg has, so I'd just like to do that all at once.

@YingboMa YingboMa merged commit 85df648 into SciML:master Jun 13, 2023
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 this pull request may close these issues.

2 participants