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

Speedup transfer function calculations #190

Merged
merged 8 commits into from
Jun 20, 2024

Conversation

fjebaker
Copy link
Member

No description provided.

fjebaker added 8 commits June 8, 2024 16:39
Changed from Roots.jl to SimpleNonlinearSolve.jl to get the
time-per-solve down from about 20ms to 2.7ms on well defined problems.
An issue that persists is that for small radii on the disc, the solver
has a much harder time converging, and sometimes converges badly.

This commit attempts to make things a bit more robust, by adding a
`best` parameter to track the best solution so far incase the one
returned by the root finder projects poorly, and by trying to keep the
manifold over which we optimize as smooth as possible. This means, for
instance, determining the difference from the projected radius
irrespective of disc intersection.

The biggest win of this commit however is that calculating a set of
interpolated transfer functions has gone from ~20 seconds to about 5, so
we get a 4x speedup, with barely any (if any) loss in precision.
Visual inspection of the `impact_parameters_for_target` result shows
that there is basically no difference between the two paths, so it's a
sort of "good enough" situation.
@fjebaker fjebaker merged commit d7750b4 into main Jun 20, 2024
1 check passed
@fjebaker fjebaker deleted the fergus/speedup-transfer-functions branch June 20, 2024 13:14
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.

1 participant