Closed LenaOsu closed 1 year ago
Fritsh Carlon monotonic spline type seems to be used on MaCh3, useful to be able to compare different types of splines
Thank you very much Lena!
Just added the description of the splines
@ClarkMcGrew do you know which type of monotonic splines is currently constructed in GUNDAM?
Spline types: Without taking a deep dive into the math terminologies, almost all "splines" are simply cubic polynomials (so a+bx+cx^2+dx^3) between adjacent knots, with the only difference being how a, b, c, and d, are calculated. At the moment, we include preliminary calculations for a,b,c&d using not-a-knot, natural, and catmull-rom definitions. It's pretty straight forward to add any other definition.
Monotonic: I won't quote the formula, but there an inequality that needs to be met for [a,b,c,d] to give a monotonic curve. After the parameters are calculated, [a,b,c,d] are modified by applying a "bounding" constraint to make sure so that the equality is satisfied (and the first derivative is continuous). Simplifying for "github", the bounding constraint used in GUNDAM is that the derivative at the knot has to be less than 3 times the average slope between the neighboring knots.
Aside: The current catmull-rom implementation is called Compact since it minimizes the memory foot print. C-R splines don't need to save the slopes so we can save memory. We could also add a C-R implementation that uses GeneralSpline (just like not-a-knot and natural). The MonotonicSpline just applies the monotonic constraint to the compact version of the C-R spline.
Another aside: It would be fairly easy to add different monotonic constraints.
I'm leaving this open until I can cross chech, but...
This may be the easiest issue to solve ever. I need to read the original paper to make sure, but our Monotonic splines already use Fritch-Carlson. I just didn't know that was the algorithm name.
Provisionally closing this since my understanding is that we are already applying this algorithm.