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 --- 24/CH2/EX2.1.c/Example2_1c.sce | 30 ++++++++++++++++++++++++++++++ 24/CH2/EX2.1.c/Example2_1c_graph.jpg | Bin 0 -> 23848 bytes 24/CH2/EX2.1.c/Example2_1c_result.txt | 3 +++ 3 files changed, 33 insertions(+) create mode 100755 24/CH2/EX2.1.c/Example2_1c.sce create mode 100755 24/CH2/EX2.1.c/Example2_1c_graph.jpg create mode 100755 24/CH2/EX2.1.c/Example2_1c_result.txt (limited to '24/CH2/EX2.1.c') 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 Binary files /dev/null and b/24/CH2/EX2.1.c/Example2_1c_graph.jpg 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 -- cgit