summaryrefslogtreecommitdiff
path: root/2411/CH4/EX4.8/Ex4_8.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2411/CH4/EX4.8/Ex4_8.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 '2411/CH4/EX4.8/Ex4_8.sce')
-rwxr-xr-x2411/CH4/EX4.8/Ex4_8.sce17
1 files changed, 17 insertions, 0 deletions
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