You are on page 1of 5

SetDirectory["/Users/YvetteSingh/Desktop/"]

data=Import["project data 1.csv"]


/Users/yvettesingh/Desktop
({
{x, y, y/2, , , , , },
{0, 4.7476, 2.3738, , , , , },
{0.2795, 4.296, 2.148, , , , , },
{0.559, 3.7511, 1.8756, , , , , },
{0.8385, 3.3472, 1.6736, , , , , },
{1.118, 2.8881, 1.4441, , , , , },
{1.3975, 2.5275, 1.2638, , , , , },
{1.677, 2.1074, 1.0537, , , , , },
{1.9565, 1.6185, 0.8093, , , , , },
{2.236, 1.2814, 0.6407, , , , , },
{2.5155, 1.0811, 0.5406, , , , , },
{2.795, 1.0566, 0.5283, , , , , },
{3.0745, 0.8897, 0.4449, , , , , },
{3.354, 0.7204, 0.3602, , , , , },
{3.6335, 0.5976, 0.2988, , , , , },
{3.913, 0.5788, 0.2894, , , , , },
{4.1925, 0.4602, 0.2301, , , , , },
{4.472, 0.4389, 0.2195, , , , , },
{4.7515, 0.4295, 0.2148, , , , , },
{5.031, 0.4224, 0.2112, , , , , },
{5.3105, 0.4314, 0.2157, , , , , },
{5.59, 1.1476, 0.5738, , , , , },
{5.8695, 1.8425, 0.9213, , , , , },
{6.149, 2.4255, 1.2128, , , , , },
{6.4285, 2.9303, 1.4652, , , , , },
{6.708, 3.1751, 1.5876, , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , },
{, , , , , , , }
})

ListPlot[
Table[
{data[[i,1]],data[[i,2]]},
{i,2,26}
],
Filling->Axis,
AspectRatio->Automatic
]

f=Interpolation[Table[
{data[[i,1]],data[[i,2]]},
{i,2,26}],
InterpolationOrder->1
]
InterpolatingFunction[({
{0., 6.708}
}),<>]
Plot[f[x],
{x,0,6.6708},
AspectRatio ->Automatic,
PlotRange->All,
AxesOrigin->{0,0}
]

Show[
Plot[f[x],
{x,0,6.708},
PlotRange->All,
AspectRatio ->Automatic,
AxesOrigin->{0,0}
]
,
ListPlot[
Table[
{data[[i,1]],data[[i,2]]},
{i,2,26}
],
Filling->Axis,
AspectRatio->Automatic
]
]

ParametricPlot3D[
{x,f[x]*Cos[t],f[x]*Sin[t]},
{x,0,6.708},
{t,0,2p},

AxesOrigin->{0,0},
Boxed->False,
AxesLabel->{x,y,z}
]

1.)Mathematica Integration:
p*NIntegrate[f[x]^2,{x,0,6.708}]
23.5649
2.)Simpsons Rule:
((6.708-0)/(3*26))(4.7476^2 +
4*4.296^2+2*3.7511^2+4*3.3472^2+2*2.8881^2+4*2.5275^2+2*

2.1074^2+4*1.6185^2+2*1.2814^2+4*1.0811^2+2*1.0566^2+4*.8
897^2+2*.7204^2+4*.5976^2+2*.5788^2+4*.4602^2+2*.4389^2+
4*.4295^2+2*.4224^2+4*.4314^2+2*1.1476^2+4*1.8425^2+2*2.
4255^2+4*2.9303^2+3.1751^2)
27.7683
3.)Trapazoid Rule:
((6.708-0)/(2*26))(4.7476^2 +
2*4.296^2+2*3.7511^2+2*3.3472^2+2*2.8881^2+2*2.5275^2+2*
2.1074^2+2*1.6185^2+2*1.2814^2+2*1.0811^2+2*1.0566^2+2*.8
897^2+2*.7204^2+2*.5976^2+2*.5788^2+2*.4602^2+2*.4389^2+
2*.4295^2+2*.4224^2+2*.4314^2+2*1.1476^2+2*1.8425^2+2*2.
4255^2+2*2.9303^2+3.1751^2)
27.837

You might also like