summaryrefslogtreecommitdiff
path: root/24/CH2/EX2.6/Example2_6.sce
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.6/Example2_6.sce
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.6/Example2_6.sce')
-rwxr-xr-x24/CH2/EX2.6/Example2_6.sce33
1 files changed, 33 insertions, 0 deletions
diff --git a/24/CH2/EX2.6/Example2_6.sce b/24/CH2/EX2.6/Example2_6.sce
new file mode 100755
index 000000000..d5e1987a9
--- /dev/null
+++ b/24/CH2/EX2.6/Example2_6.sce
@@ -0,0 +1,33 @@
+//Given that
+g = -9.8 //in m/sec^2
+displacement = -48 //in meter
+
+//Sample Problem 2-6a
+printf("**Sample Problem 2-6a**\n")
+//using newton's equation of motion
+//displacement = 0 * t + .5 * g * t * t
+//displacement = .5 * g * t * t
+time = sqrt(displacement/(.5 * g))
+printf("The time taken to reach at the ground is %f sec\n", time)
+
+//Sample Problem 2-6b
+printf("\n**Sample Problem 2-6b**\n")
+t = poly(0,'t');
+dis_t = 0 * t + .5 * g *t * t
+ds = horner(dis_t,[1,2,3])
+printf("The displacements at times 1,2,3 sec in meter is")
+disp(ds)
+
+//Sample Problem 2-6c
+printf("\n**Sample Problem 2-6c**\n")
+//using newton's first equation of motion v = u + a*t
+velocity = 0 + g * time
+printf("The velocity at water surface is equal to %f km/h\n", velocity)
+
+//Sample Problem 2-6d
+printf("\n**Sample Problem 2-6d**\n")
+//using newton's first equation of motion
+v_at_time_t = 0 + g * t
+velocities = horner(v_at_time_t,[1,2,3])
+printf("The velocitis at times 1,2,3 sec in m/s is")
+disp(velocities) \ No newline at end of file