From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1958/CH2/EX2.3/Chapter2_example3.sce | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 1958/CH2/EX2.3/Chapter2_example3.sce (limited to '1958/CH2/EX2.3') 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) -- cgit