summaryrefslogtreecommitdiff
path: root/1958/CH2/EX2.3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1958/CH2/EX2.3
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1958/CH2/EX2.3')
-rwxr-xr-x1958/CH2/EX2.3/Chapter2_example3.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/1958/CH2/EX2.3/Chapter2_example3.sce b/1958/CH2/EX2.3/Chapter2_example3.sce
new file mode 100755
index 000000000..abdb5f62c
--- /dev/null
+++ b/1958/CH2/EX2.3/Chapter2_example3.sce
@@ -0,0 +1,22 @@
+clc
+clear
+//Input data
+r1=[0,1]//Interval in m
+r2=[1,2]//Interval in m
+r3=[2,4]//Interval in m
+r4=[0,5]//Interval in m
+y=[6,12]//Y- coordinates from the graph 2.5 on page no. 27
+
+//Calculations
+a1=(1/2)*(r1(2)-r1(1))*y(1)//Area under the curve in J
+a2=(r2(2)-r2(1))*y(1)//Area under the curve in J
+a3=((r3(2)-r3(1))*y(1))+((1/2)*((r3(2)-r3(1))/2)*(y(2)-y(1)))+(((r3(2)-r3(1))/2)*(y(2)-y(1)))//Area under the curve in J
+a4=(a1+a2+a3+((1/2)*y(2)*(r4(2)-r3(2))))//Area under the curve in J
+
+//Output
+X=[0,1,2,3,4,5]//X- coordinate is distance in m
+Y=[0,6,6,12,12,0]//Y- coordinate is Force in N
+plot(X,Y)//Graph shown in figure 2.5 on page no.27
+xtitle('Distance versus Force','Distance in m','Force in N')
+
+printf('The work done in the intervals: \n (a)%i<=x<=%i m is %i J \n (b)%i<=x<=%i m is %i J \n (c)%i<=x<=%i m is %i J \n (d)%i<=x<=%i m is %i J \n',r1(1),r1(2),a1,r2(1),r2(2),a2,r3(1),r3(2),a3,r4(1),r4(2),a4)