I am trying to fit some data which is sin convolved with an exponential. Here is the code that gives me a problem:
TF1 *myfit = new TF1("myfit", "[0]+[1]*exp(-[2]*t-[3])*cos([4]*t-[5])", 50, 1000);
myfit->SetParName(0, "c0");
myfit->SetParName(1, "c1");
myfit->SetParName(2, "c2");
myfit->SetParName(3, "c3");
myfit->SetParName(4, "c4");
myfit->SetParName(5, "c5");
myfit->SetParameter(0, -39);
myfit->SetParameter(1, 2);
myfit->SetParameter(2, 1);
myfit->SetParameter(3, -100);
myfit->SetParameter(4, 200);
myfit->SetParameter(5, 50);
myfit->SetLineColor(2);
myfit->SetLineWidth(1);
er->Fit("myfit");
I get this error when I compile:
Error in <TF1::TF1>: function: myfit/[0]+[1]*exp(-[2]*t-[3])*cos([4]*t-[5]) has 4 parameters instead of 1
Error in <Fit>: function is zombie
Any suggestions would be greatly appreciated.