You are on page 1of 5

SetDirectory@"UsersYvetteSinghDesktop"D

data = Import@"project data 1.csv"D


UsersyvettesinghDesktop
x
0
0.2795
0.559
0.8385
1.118
1.3975
1.677
1.9565
2.236
2.5155
2.795
3.0745
3.354
3.6335
3.913
4.1925
4.472
4.7515
5.031
5.3105
5.59
5.8695
6.149
6.4285
6.708

y
4.7476
4.296
3.7511
3.3472
2.8881
2.5275
2.1074
1.6185
1.2814
1.0811
1.0566
0.8897
0.7204
0.5976
0.5788
0.4602
0.4389
0.4295
0.4224
0.4314
1.1476
1.8425
2.4255
2.9303
3.1751

y2
2.3738
2.148
1.8756
1.6736
1.4441
1.2638
1.0537
0.8093
0.6407
0.5406
0.5283
0.4449
0.3602
0.2988
0.2894
0.2301
0.2195
0.2148
0.2112
0.2157
0.5738
0.9213
1.2128
1.4652
1.5876

Printed by Wolfram Mathematica Student Edition

Untitled-2.nb

ListPlot@
Table@
8data@@i, 1DD, data@@i, 2DD<,
8i, 2, 26<
D,
Filling Axis,
AspectRatio Automatic
D

2.0
1.5
1.0
0.5

f = Interpolation@Table@
8data@@i, 1DD, data@@i, 2DD<,
8i, 2, 26<D,
InterpolationOrder 1
D
InterpolatingFunction@H 0. 6.708 L, <>D
Plot@f@xD,
8x, 0, 6.6708<,
AspectRatio Automatic,
PlotRange All,
AxesOrigin 80, 0<
D
2.5
2.0
1.5
1.0
0.5

Printed by Wolfram Mathematica Student Edition

Untitled-2.nb

Show@
Plot@f@xD,
8x, 0, 6.708<,
PlotRange All,
AspectRatio Automatic,
AxesOrigin 80, 0<
D
,
ListPlot@
Table@
8data@@i, 1DD, data@@i, 2DD<,
8i, 2, 26<
D,
Filling Axis,
AspectRatio Automatic
D
D

2.5
2.0
1.5
1.0
0.5

Printed by Wolfram Mathematica Student Edition

Untitled-2.nb

ParametricPlot3D@
8x, f@xD * Cos@tD, f@xD * Sin@tD<,
8x, 0, 6.708<,
8t, 0, 2 <,
AxesOrigin 80, 0<,
Boxed False,
AxesLabel 8x, y, z<
D
0

2
1
0
-1
-2

2
1
0
-1
z

-2

1.L Mathematica Integration :

* NIntegrate@f@xD ^ 2, 8x, 0, 6.708<D


23.5649

2.L Simpsons Rule :

Printed by Wolfram Mathematica Student Edition

Untitled-2.nb

6.708 - 0
H4.7476 ^ 2 + 4 * 4.296 ^ 2 + 2 * 3.7511 ^ 2 + 4 * 3.3472 ^ 2 +
3 * 26
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 * .8897 ^ 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 ^ 2L
27.7683
3.L Trapazoid Rule :
6.708 - 0
H4.7476 ^ 2 + 2 * 4.296 ^ 2 + 2 * 3.7511 ^ 2 + 2 * 3.3472 ^ 2 +
2 * 26
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 * .8897 ^ 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 ^ 2L
27.837

Printed by Wolfram Mathematica Student Edition

You might also like