summaryrefslogtreecommitdiff
path: root/1187/CH2/EX2.1/1.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1187/CH2/EX2.1/1.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 '1187/CH2/EX2.1/1.sce')
-rwxr-xr-x1187/CH2/EX2.1/1.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/1187/CH2/EX2.1/1.sce b/1187/CH2/EX2.1/1.sce
new file mode 100755
index 000000000..86f554e5d
--- /dev/null
+++ b/1187/CH2/EX2.1/1.sce
@@ -0,0 +1,21 @@
+clc
+d=1.5; // m
+m=1.2; // kg
+rate=0.0065; // K/m
+R=287; // J/(kg.K)
+T_0=288.15; // K
+p_0=101*10^3; // Pa
+g=9.81; // m/s^2
+
+rho=m/(%pi*d^3/6);
+rho_0=p_0/R/T_0;
+
+// log(rho/rho_0)=(g/R*rate - 1)*log((T_0-rate*z)/T_0)
+
+z=1/rate*(T_0-T_0*exp(log(rho/rho_0)/(g/R/rate-1)));
+
+disp("The height above sea level to which the ballon will rise = ")
+disp(z)
+disp("m")
+
+printf("The height above sea level to which the ballon will rise = %f m", z) \ No newline at end of file