Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you Dirk! I am indeed trying to use "least squares" i.e. minimization. Now, do you know any source of info about methods that make practical use of constraints on $g$ and $f$?