How to fit data points with special constraints?

Hi,
I am trying to fit a histogram using the function = par[0]/(1.0+TMath::Exp((x[0]-par[1])/par[2])). And all three of these adjustable parameters satisfy an special equation (sum=20).

double sum=0.0;
for(int i=0;i<200;i++)
{
x=0.1*i;
sum = sum + 4.0*M_PI*par[0]/(1.0+TMath::Exp((x-par[1])/par[2]))*0.1*x*x;
}

Is there any way to do that?

Thanks.
Best regards,

Jingtao

may be the fit examples can help:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.