February 15 Examples

The following is an example of a linear least squares fit.

Fit[{{0, 1},  {1, 4},  {2, 5},  {3, 8}},  {Exp[x], Exp[2  x]},  
      x]

data  =  {{0, 1},  {1, 4},  {2, 5},  {3, 8}}

functions  =  {1, x,  x^2}

Fit[data, functions, x]

Part[Part[data, 3], 2]

data[[3]][[2]]

ordinates  =  
      Table[data[[i]][[2]], {i, 1, 4, 1}]

<< Statistics`DescriptiveStatistics`

Mean[ordinates]

StandardDeviation[ordinates]

sqttwo  =  2; 
    Do[{sqttwo  =  N[sqttwo/2  +  1/sqttwo, 20]; Print[sqttwo]},  {i, 1, 
        10}]

N[Sqrt[2], 25]

funnyexpression  =  (x - 1)^2  +  Exp[t^2]  -  u^2

funnyexpression  /.  t_^2  ->  2 (t)^3

Export["g:\Math_487\2_02_15_example_data.dat", data]

Import["g:\Math_487\2_02_15_example_data.dat"]

newdata  = Import["g:\Math_487\\2_02_15_new_data.dat"]

newdata

Fit[newdata, {1, x,  x^2,  x^3}, x]

FunkTable[f_, x_,  h_,  n_]  :=  
      Do[{y = x + i*h, z = f[y], Print[y, z]}, {i, 0, n, 1}]

f[x_]  =  x^2

FunkTable[f, 0,  .1, 10]