How to make a polyfit with constraints to the first and second derivative?
17 views (last 30 days)
Show older comments
I want to make a polyfit of some data. The start and end point, and also the derivative and second derivative in begin and endpoint are knowns, how do I make a polyfit, which fulfills to this needs?
I found a polyfix, function, where you can give constraints to the start and end point, and also the derivative, but you cannot add a constraint to the second derivative. Is there another solution?
This is the link to the polyfix function: https://nl.mathworks.com/matlabcentral/fileexchange/54207-polyfix-x-y-n-xfix-yfix-xder-dydx
0 Comments
Accepted Answer
Matt J
on 9 May 2023
More often than not, if you have such constraints, it is spline that you want to fit, not a polynomial. Constrained spline fits can be done with this FEX download:
2 Comments
Matt J
on 9 May 2023
Yes, but they are splines. An order 4 spline is much more flexible than a degree five polynomial.
See Also
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!