diff options
Diffstat (limited to '24/CH2/EX2.7/Example2_7.sce')
-rwxr-xr-x | 24/CH2/EX2.7/Example2_7.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/24/CH2/EX2.7/Example2_7.sce b/24/CH2/EX2.7/Example2_7.sce new file mode 100755 index 000000000..f882519fd --- /dev/null +++ b/24/CH2/EX2.7/Example2_7.sce @@ -0,0 +1,26 @@ +//Given that
+g = -9.8 //in m/sec^2
+v_initial = 12 //in m/s
+v_final = 0 //at maximum height velocity equal to zero
+
+//Sample Problem 2-7a
+printf("**Sample Problem 2-7a**\n")
+//using newton'd first equation of motion
+// v_final = v_initial + g * t
+h_max_time = (v_final - v_initial)/g
+printf("After %f sec, the ball will attain its maximum height\n", h_max_time)
+
+//Sample Problem 2-7b
+printf("\n**Sample Problem 2-7b**\n")
+//using newton's second equation of motion
+h_max = (v_final^2 - v_initial^2)/(2 * g)
+printf("The maximum height reached by the baseball is %f m\n", h_max)
+
+//Sample Problem 2-7c
+printf("\n**Sample Problem 2-7c**\n")
+displacement = 5
+t = poly(0,'t')
+quad_t = v_initial * t + .5 * g * t * t - displacement
+t_5 = roots(quad_t)
+printf("At following times in sec, the ball will be at height 5m")
+disp(t_5)
\ No newline at end of file |