-
Notifications
You must be signed in to change notification settings - Fork 60
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
Learner2D.interpolator and Learner2D.interpolated_on_grid give different results #427
Comments
Hey @MCFlowMace! The interpolation depends on the triangulation being used. The triangulation, on the other hand, is sensitive to the aspect ratio of the data because that changes the notion of which point is the nearest. Learner 2D internally rescales its data to occupy a unit square and builds a triangulation from that. Your data limits, on the other hand, have a different aspect ratio, which is the origin of the disagreement. Try rescaling x and y to have the same extent and seeing if the problem persists. |
Hey @akhmerov thanks for the fast reply! I was already wondering if it has to do with the aspect ratio. I have an aspect ratio of 25 in the first case and only 0.5 in the second. Are you suggesting I should rescale x and y of my function before giving it to the learner or for the interpolator object that I get back? Also if this is the fault then as a user I am still wondering why |
Okay this way I get expected results:
I can work with it this way. But just commenting that this was not clear for me from the documentation. The documentation sounded like I can just use |
I have stumbled upon this behaviour as well, has to look into the |
I managed to obtain an interpolator that produces the exact same data as |
Hi thanks for this awesome package! I have an issue with the use of the interpolated data of the Learner2D with a function that I'm trying to analyze. This is what I try to do:
In the code above learner is an instance of Learner2D after running it until convergence. First I inspect the result with the internal
plot
function. Result looks good:For the 2nd plot I use
interpolated_on_grid
to get the data and plot it myself. Result is consistent with the other plot:For the 3rd plot I want to use the interpolator myself. The result of that is not the same:
Using a different function for the learner the difference is a lot less significant but still existing.
2nd plot:
3rd plot:
Am I using the interpolator object in the wrong way or is it a bug? I would prefer to use the interpolator object instead of
interpolated_on_grid
since that gives more flexibility for the evaluation points. I am using adaptive version 0.15.1The text was updated successfully, but these errors were encountered: