Nonlinear

data = {{15.05, 0.1943}, {25.2, .05987}, {47.1, 3.5333}, {67.13, 7.636}, {82.11, 10.0953}, {133.4, 17.878}, {204.05, 22.7202}, {256.5, 24.8038}, {283., 26.0833}}

{{15.05, 0.1943}, {25.2, 0.05987}, {47.1, 3.5333}, {67.13, 7.636}, {82.11, 10.0953}, {133.4, 17.878}, {204.05, 22.7202}, {256.5, 24.8038}, {283., 26.0833}}

Fig1a = ListPlot[data, PlotRange-> {{0, 300}, {0, 30}}, Frame→True, Prolog→AbsolutePointSize[6], PlotStyle→Hue[.8]] ;

[Graphics:../HTMLFiles/MATH5_TUT1_474.gif]

Call for nonlinear fitting

<<Statistics`NonlinearFit`

Make sure that there is no predefined values for our variables

Clear[a, b, c]

nlfex1 = NonlinearFit[data, a + b x + c/x^2, {x}, {{a, 1}, {b, 1}, {c, 1}}, MaxIterations→1000, Method→Automatic]

1.58538 - 870.703/x^2 + 0.0940781 x

Define the function using the values from the previous command

cv[x_] := 1.58538 - 870.703/x^2 + 0.0940781 x

If x_ is not working try x in cv[x_]

Fig2 = Plot[cv[x], {x, 14, 300}]

[Graphics:../HTMLFiles/MATH5_TUT1_481.gif]

-Graphics -

We use the Show command to superimpose figures

Show[{Fig2, Fig1a}, Prolog→AbsolutePointSize[12]]

[Graphics:../HTMLFiles/MATH5_TUT1_484.gif]

-Graphics -

Problem 3. - Consider the following data and find a fit and plot the data and the best fit function
data2 ={{220,.642},{250,.759},{275,.861},{300,.952},{325,1.025},{350,
      1.085},{380,1.142},{400,1.177}}


Created by Mathematica  (September 7, 2006) Valid XHTML 1.1!