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

Fix issues with is_jacobian_term_used() #1500

Conversation

maximumcats
Copy link
Member

@maximumcats maximumcats commented Mar 3, 2024

There were three problems here. First, the logic within the function was incorrect: a Jacobian term is used if both spec1 and spec2 are connected to the same rate, rather than if either species is used. Second, this function is indexing the species using 1-indexing, but we were calling it with zero-indexed species inside the linear algebra. Third, we can only skip entries if we're using the analytical Jacobian. The numerical Jacobian will have some additional non-zero entries since it captures some physics, such as the screening, which we are not currently able to conclude in the analytical netowrk implementation.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@zingale
Copy link
Member

zingale commented Mar 3, 2024

closes #1499

@zingale
Copy link
Member

zingale commented Mar 3, 2024

these changes cause test_linear_algebra to fail:

original x and x from the solve (RHS:: solve): 
                   1    7.162462030968882
                  20    13.97277986846644
                   3   -0.822910119156765
                  40    33.89190438198373
                   5    2.117609026004514
                  60    56.02163984189685
                   7    3.458108032248415
                  80    75.97253851812479
                   9    6.080893721649049
                 100    96.56668190864372
                  11    8.490387506470494
                 120    117.0183692563761
                  13    10.03295745366218
                 140    140.7876345006217

@zingale
Copy link
Member

zingale commented Mar 9, 2024

we worked around this for now in #1502

@zingale zingale closed this Mar 9, 2024
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.

None yet

2 participants