summaryrefslogtreecommitdiff
path: root/1286/CH6/EX6.20/6_20.sce
diff options
context:
space:
mode:
Diffstat (limited to '1286/CH6/EX6.20/6_20.sce')
-rwxr-xr-x1286/CH6/EX6.20/6_20.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/1286/CH6/EX6.20/6_20.sce b/1286/CH6/EX6.20/6_20.sce
new file mode 100755
index 000000000..18895fca6
--- /dev/null
+++ b/1286/CH6/EX6.20/6_20.sce
@@ -0,0 +1,18 @@
+clc
+//initialisation
+s1=1//m/sec
+s2=2//m/sec
+s3=3//m/sec
+s4=4//m/sec
+s5=5//m/sec
+n1=4
+n2=2
+n3=8
+n4=6
+n5=5
+//CALCULATIONS
+u=(n1*s1+n2*s2+n3*s3+n4*s4+n5*s5)/(n1+n2+n3+n4+n5)
+v=sqrt((n1*s1*s1+n2*s2*s2+n3*s3*s3+n4*s4*s4+n5*s5*s5)/(n1+n2+n3+n4+n5))
+//results
+printf(' mean speed of molecules= % 1f m/sec',u)
+printf(' \nrms speeed of molecules= % 1f m/sec',v)