Combined fit of similar model functions / one shared param


i am having a hard time building a fitting routine which is able to do a combined fit using several similar model functions with one shared parameter.

The model functions have the following form:

f0(x,y) = p0 + p1x + p2x^2y^2
f1(x,y) = p0 + p3
x + p4x^2y^2
f2(x,y) = p0 + p5x + p6x^2y^2
f3(x,y) = p0 + p7
x + …
f4(x,y) = p0 + …


I have already done the fit for one of those functions independently but i have problems doing it for all the functions in a combined fit.

I found a tutorial on a similar issue where two histograms are fitted in combination: … Fit.C.html

Understanding this seems absolutely non trivial for me and i would need to work hard and a lot in order to understand this but i lack the necessary time. Therefore my hope is that someone could give some hints or a slightly simplified solution compared to the tutorial. This would be great and helping me achieving my aims in time.