Curve Fitting

The following examples fit your data to four possible functional forms:

1. a line

2. a quadratic

3. an exponential

4. a Gaussian

Simply enter your data in the format shown and evaluate the appropriate cell to see the fit you want.

For periodic data, us the Smooth function in the Pulsatile Flow notebook.

data={{1,1},{2,4},{3,9},{4,16},{5,25},{6,36},
		{7,49},{8,64},{9,81},{10,100}};

Do not change anything in the cells below.

xtab=Table[data[[n,1]],{n,Length[data]}];

xleft=Min[xtab];

xright=Max[xtab];

Print["y= ",y=Fit[data,{1,x},x]];

Show[{ListPlot[data],
		Plot[y,{x,xleft,xright}]}];

Print["y= ",y=Fit[data,{1,x,x^2},x]];

Show[{ListPlot[data],
		Plot[y,{x,xleft,xright}]}];

lndata=Table[{data[[n,1]],Log[data[[n,2]]]},
			{n,Length[data]}];

Print["y=e^ ",y=Fit[lndata,{1,x},x]];

Show[{ListPlot[data],
		Plot[E^y,{x,xleft,xright}]}];

Print["y=e^ ",y=Fit[lndata,{1,x,x^2},x]];

Show[{ListPlot[data],
		Plot[E^y,{x,xleft,xright}]}];