Fit a function by minuit

Hi Root Experts

I would like to use Minuit to fit a function(not a histogram or a graph…)
say the function f = f( x, y)
and vary the parameter x, y to get f as close as a value f0

Is there any similar example to do this?

I tried to use the example(root/test/minexam.cxx) in user guide
The first problem I have is how to “SetFCN” ?
Is there any certain format for the FCN?

Thank you very much,
SC

Have a look at

root.cern.ch/root/html/MATH_MINUIT_Index.html

and in particular

wwwasdoc.web.cern.ch/wwwasdoc/minuit/node14.html