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 --- 2411/CH4/EX4.8/Ex4_8.sce | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 2411/CH4/EX4.8/Ex4_8.sce (limited to '2411/CH4/EX4.8/Ex4_8.sce') diff --git a/2411/CH4/EX4.8/Ex4_8.sce b/2411/CH4/EX4.8/Ex4_8.sce new file mode 100755 index 000000000..b322474e3 --- /dev/null +++ b/2411/CH4/EX4.8/Ex4_8.sce @@ -0,0 +1,17 @@ +// Scilab Code Ex4.8: Page-237 (2008) +clc; clear; +c = 3e+008; // Speed of light in vacuum, m/s +// Case 1: when velocity of firing is away from the earth +v = 0.5*c; // Speed of the rocket away from the earth, m/s +u_prime = 0.8*c; // Speed of the outgoing spaceship relative to earth, m/s +u = (u_prime+v)/(1+u_prime*v/c^2); // Velocity of rocket moving away relative to the earth, m/s +printf("\nThe velocity of rocket moving away relative to the earth = %4.2f c = %4.2e m/s", u/c, u); +// Case 2: when velocity of firing is towards the earth +v = 0.5*c; // Speed of the rocket moving towards the earth, m/s +u_prime = -0.8*c; // Speed of the outgoing spaceship relative to earth, m/s +u = (u_prime+v)/(1+u_prime*v/c^2); // Velocity of approaching rocket relative to the earth, m/s +printf("\nThe velocity of approaching rocket relative to the earth = %3.1f c = %3.1e m/s", u/c, u); + +// Result +// The velocity of rocket moving away relative to the earth = 0.93 c = 2.79e+008 m/s +// The velocity of approaching rocket relative to the earth = -0.5 c = -1.5e+008 m/s \ No newline at end of file -- cgit