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

Jacobian by equation #651

Closed
Scottmar93 opened this issue Oct 9, 2019 · 3 comments
Closed

Jacobian by equation #651

Scottmar93 opened this issue Oct 9, 2019 · 3 comments

Comments

@Scottmar93
Copy link
Contributor

Scottmar93 commented Oct 9, 2019

Summary
Perform the Jacobian calculation on each individual equation and then concatenate the result.

Also simplify by equation.

Reason
Currently, we discretize equations and then combine into one large concatenated vector. This leads to very large expression tree which are lead to issues with RAM and are hard to interpret. We can instead simply hold off concatenating the discretized equations (i.e. move this step to the solver) and take the Jacobian of each equation individually. This helps with a few things:

  • it might help limit some of the RAM issues we were having on the larger expression trees
  • it keeps the expression trees reasonably small and manageable
  • we can add a "by equation" progress bar for calculating the Jacobian to help us understand what equations are slow
  • we could calculate the Jacobian of different equations in parallel using pythons multiprocessing
@rtimms
Copy link
Contributor

rtimms commented Oct 9, 2019

something that might help is checking if any state vectors are in the tree in the base method for jac here and returning zeros of the right shape if not. not sure how often it happens but it might avoid calculating jac down a particular branch unnecessarily. should at least stop the tree for jac becoming so large

@rtimms rtimms mentioned this issue Oct 18, 2019
8 tasks
@valentinsulzer
Copy link
Member

Can this now be closed @rtimms ?

@rtimms
Copy link
Contributor

rtimms commented Oct 28, 2019

yep. the functionality is there to do this if calculating the jacobian using the method in discretisation rather than during solver set up

@rtimms rtimms closed this as completed Oct 28, 2019
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

No branches or pull requests

3 participants