summaryrefslogtreecommitdiff
path: root/24/CH2/EX2.1.c
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /24/CH2/EX2.1.c
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 '24/CH2/EX2.1.c')
-rwxr-xr-x24/CH2/EX2.1.c/Example2_1c.sce30
-rwxr-xr-x24/CH2/EX2.1.c/Example2_1c_graph.jpgbin0 -> 23848 bytes
-rwxr-xr-x24/CH2/EX2.1.c/Example2_1c_result.txt3
3 files changed, 33 insertions, 0 deletions
diff --git a/24/CH2/EX2.1.c/Example2_1c.sce b/24/CH2/EX2.1.c/Example2_1c.sce
new file mode 100755
index 000000000..504628dcb
--- /dev/null
+++ b/24/CH2/EX2.1.c/Example2_1c.sce
@@ -0,0 +1,30 @@
+exec('Example2_1a.sce', -1)
+clc
+
+//Sample Problem 2-1c
+printf("\n**Sample Problem 2-1c**\n")
+average_velocity = overall_displacement/delta_t
+printf("The average velocity over the whole journey is %f km/h\n", average_velocity)
+
+//from position v/s time graph
+xset('window',1)
+xtitle ("position v/s time","time(hr)","position(Km)");
+//drawing reference lines
+plot(linspace(delta_t,delta_t,10),linspace(0,overall_displacement,10),'--.x')
+plot(linspace(0,delta_t,10),linspace(overall_displacement,overall_displacement,10),'--.o')
+plot(linspace(time,time,10),linspace(0,distance_covered,10),'--')
+plot(linspace(0,time,10),linspace(distance_covered,distance_covered,10),'--')
+//position v/s time graph
+x = linspace(0,time,10);
+y = linspace(0,distance_covered,10);
+plot(x,y,'r');
+//average graph
+x = linspace(time,delta_t,10);
+y = linspace(distance_covered,overall_displacement,10);
+plot(x,y,'r');
+//slope of this line will give us the average velocity
+x = linspace(0,delta_t,10);
+y = linspace(0,overall_displacement,10);
+plot(x,y,'m');
+legend('$\delta x=10.4 km$','time interval=.62hr')
+printf("The average velocity from the graph is %f km/h", 10.4/delta_t) \ No newline at end of file
diff --git a/24/CH2/EX2.1.c/Example2_1c_graph.jpg b/24/CH2/EX2.1.c/Example2_1c_graph.jpg
new file mode 100755
index 000000000..8dc9c59b7
--- /dev/null
+++ b/24/CH2/EX2.1.c/Example2_1c_graph.jpg
Binary files differ
diff --git a/24/CH2/EX2.1.c/Example2_1c_result.txt b/24/CH2/EX2.1.c/Example2_1c_result.txt
new file mode 100755
index 000000000..6ac548f46
--- /dev/null
+++ b/24/CH2/EX2.1.c/Example2_1c_result.txt
@@ -0,0 +1,3 @@
+**Sample Problem 2-1c**
+The average velocity over the whole journey is 16.774194 km/h
+The average velocity from the graph is 16.774194 km/h \ No newline at end of file