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

testing backward euler with most of the analytical tests #576

Merged

Conversation

K20shores
Copy link
Collaborator

Closes #499

Backward euler passes all tests, but the robertson tests (the solver fails to converge and seems to get stuck, will be investigated by #498). I don't know how to test backward euler against HIRES, Oregonator, E5, but hopefully that can be fixed with #575

micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_surface_rxn(builder);
test_analytical_surface_rxn(rosenbrock, 1e-5);
test_analytical_surface_rxn(backward_euler, 1e-1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1e-1 seems large to me. This makes me think whether we should write a function of calculating the relative error instead of using expect_near, which compares the absolute difference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah these values are on the small side. I'll make that change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, only was able to use 0.05 for the relative error though

Copy link
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you decide the tolerance values? It is interesting to see they vary between each solver type and rate constant type.

@K20shores
Copy link
Collaborator Author

How do you decide the tolerance values? It is interesting to see they vary between each solver type and rate constant type.

it was super duper scientific. I set a value of 1e-8 and when that failed for a particular test I subtracted one from the exponent until it passed.

A more intelligent way would be to play with the solver tolerances to choose values that minimize the error

@boulderdaze
Copy link
Collaborator

How do you decide the tolerance values? It is interesting to see they vary between each solver type and rate constant type.

it was super duper scientific. I set a value of 1e-8 and when that failed for a particular test I subtracted one from the exponent until it passed.

A more intelligent way would be to play with the solver tolerances to choose values that minimize the error

Haha I see. Yeah that makes sense but would require a good amount of work to investigate that. I guess we don't need to worry about it for now

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@854ca2d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #576   +/-   ##
=======================================
  Coverage        ?   92.89%           
=======================================
  Files           ?       49           
  Lines           ?     3477           
  Branches        ?        0           
=======================================
  Hits            ?     3230           
  Misses          ?      247           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@K20shores K20shores merged commit c97024e into main Jun 24, 2024
29 checks passed
@K20shores K20shores deleted the 499-refactor-tests-to-use-both-solvers-for-all-analytical-tests branch June 24, 2024 13:37
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.

Refactor tests to use both solvers for all analytical tests
6 participants