Fix Rosenbrock MINUS_ONE bug - #535
Merged
Merged
Conversation
Rosenbrock was using wrong value of `alpha` when evaluating model Jacobian - there was an extra minus sign. This wasn't caught by the test because the test was also incorrectly using alpha in its own Jacobian - there was a missing minus sign. These cancelled out and cause correct behavior when Rosenbrock was applied to the test problem.
alexander-novo
force-pushed
the
alex/fix-rosenbrock-negative
branch
from
August 13, 2026 15:20
2475cca to
fc3075c
Compare
nkoukpaizan
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rosenbrock was using wrong value of
alphawhen evaluating model Jacobian - there was an extra minus sign. This wasn't caught by the test because the test was also incorrectly using alpha in its own Jacobian - there was a missing minus sign. These cancelled out and cause correct behavior when Rosenbrock was applied to the test problem.Some documentation has been added to assist with understanding the issue.
Proposed changes
The
MINUS_ONEin Rosenbrock's model Jacobian evaluation has been changed to aONE, and the test has been updated to compute its Jacobian in a way that agrees with the rest of GridKit.Checklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.
-Wall -Wpedantic -Wconversion -Wextra.This is a fix to the rosenbrock integrator, which is already included in the changelog
Further comments