I want to fit and draw a curve that is constrained with the following boundary condition:
diff (yfit)<=0
where yfit
is the polynomial fitted function to degree n
.
The condition ensures that the slope of the polynomial to any degree of is non-positive for all x
.
How can I apply the condition using the "polyfit
" function or any other polynomial fitting function?