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

Confused about the true meaning of OnCell and OnGrid #228

Closed
timholy opened this issue Aug 23, 2018 · 3 comments · Fixed by #226
Closed

Confused about the true meaning of OnCell and OnGrid #228

timholy opened this issue Aug 23, 2018 · 3 comments · Fixed by #226

Comments

@timholy
Copy link
Member

timholy commented Aug 23, 2018

This may sound surprising, but I'm looking for clarification about what OnCell and OnGrid actually mean. Let's take the case of Constant: my interpretation is that OnCell should mean that the array value is constant over i-0.5 to i+0.5 but has a step discontinuity at the edges of this region. Conversely, I would expect OnGrid to be constant over i to i+(1-eps()). In other words, something like this:

constant-desired

But that's not what we have, and indeed OnGrid and OnCell seem to behave identically:

constant_real

Likewise for Quadratic:

quadratic

By the definition I am picturing, I'm not even sure there is an obvious meaning to Linear, OnCell that is also continuous. (The closest I can come up with is that the slope at i is (y[i+1]-y[i-1])/2, but that has discontinuities at the half-integers.)

So despite having worked with the package a lot (though not for quite a while, truth be told), I am confused.

@tomasaschan
Copy link
Contributor

tomasaschan commented Aug 23, 2018

I think the original discussion of OnGrid vs OnCell arose out of needs for handling boundaries on or between the given data points (see e.g. the discussion in #1, as well as #9 (comment) with following comments), with the intent of having the same results on the interior. Thus, I'm not sure it's supposed to make a difference except at the edges.

This realization might make it easier to find better names for the concepts.

@tomasaschan
Copy link
Contributor

tomasaschan commented Aug 23, 2018

Re: what it would mean to have Linear, OnCell in the interior, I recall drawing a graph with the knots between the data points, which basically looked like an optimization problem: find the series of slopes that create a continuous graph, with as small slope-jumps as possible. I think I also found a way to formulate that problem in terms of linear B-spline coefficients, but I have no idea where I found that, or if I documented it at the time. I think we discarded the concept because it was really silly and we couldn't imagine anyone ever preferring that to "normal" linear interpolation.

@timholy
Copy link
Member Author

timholy commented Aug 23, 2018

Thanks for the reminder!

OK, if this really is just about the boundary conditions, I might think about moving this to be more closely attached to the BC object. But not the highest priority.

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 a pull request may close this issue.

2 participants