I have a non-negative function $f(x) \ge 0$ defined on the interval $[a,b]$. I would like to have a finite-dimensional approximation to this function that is guaranteed to be non-negative on $[a,b]$. What would be a good way to do this (say assuming $f$ is a smooth function)?
The reason I want to do this is that I would like to solve a functional equation $T(f)=0$ by using a collocation method and $T$ is defined only for non-negative $f$.