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

feat: compute jac_prototype for SDEFunction #3535

Merged
merged 17 commits into from
Apr 8, 2025
Merged

Conversation

vyudu
Copy link
Member

@vyudu vyudu commented Apr 3, 2025

Close #3527

@ChrisRackauckas
Copy link
Member

Can we make sure to add the mass matrix into the pattern? Because it will be a requirement of the future, so we should just make it robust now.

@vyudu
Copy link
Member Author

vyudu commented Apr 3, 2025

Mass matrix is already in there

@ChrisRackauckas
Copy link
Member

The mass matrix is a subset of jacobian_sparsity(sys)? Are you sure? I don't remember handling that here.

@vyudu
Copy link
Member Author

vyudu commented Apr 3, 2025

No I mean it was there before, see lines 656-657 of the updated file

@vyudu
Copy link
Member Author

vyudu commented Apr 3, 2025

@ChrisRackauckas @oscardssmith @AayushSabharwal
So the behavior implemented here is:

  • generate_jacobian returns the jacobian, generate_W returns the W
  • prob.f.jac_prototype and prob.f.W_prototype both return the same thing, the W_prototype (which I added in case we want to switch to only using W_prototype in the solvers at some point)
  • the jac! returned by generate_jacobian will error if the passed in jac doesn't have the W pattern

is this right? anything I'm missing?

@vyudu vyudu marked this pull request as draft April 3, 2025 17:57
@vyudu
Copy link
Member Author

vyudu commented Apr 3, 2025

Nevermind this is writing to the wrong entries, need to investigate

JuliaSymbolics/Symbolics.jl#1521

@vyudu vyudu marked this pull request as ready for review April 3, 2025 21:19
@ChrisRackauckas
Copy link
Member

So this is good to go?

@vyudu
Copy link
Member Author

vyudu commented Apr 7, 2025

No I think it's still writing to the wrong entries sorry, investigating

@vyudu
Copy link
Member Author

vyudu commented Apr 7, 2025

OK I think I fixed it, let's see how tests do.

@vyudu
Copy link
Member Author

vyudu commented Apr 7, 2025

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas merged commit d5f3dc1 into SciML:master Apr 8, 2025
40 of 44 checks passed
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.

No jacobian prototype for sparse jacobian SDEProblems?
3 participants