summaryrefslogtreecommitdiff
path: root/2795/CH16/EX16.3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2795/CH16/EX16.3
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 '2795/CH16/EX16.3')
-rwxr-xr-x2795/CH16/EX16.3/Ex16_03.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/2795/CH16/EX16.3/Ex16_03.sce b/2795/CH16/EX16.3/Ex16_03.sce
new file mode 100755
index 000000000..ce509efab
--- /dev/null
+++ b/2795/CH16/EX16.3/Ex16_03.sce
@@ -0,0 +1,15 @@
+// Scilab Code Ex16.3: Page-587(2014)
+clc; clear;
+m_n = 939.566; // Rest mass of the neutron, MeV/c^2
+m_p = 938.272; // Rest mass of the proton, MeV/c^2
+e = 1.6e-019; // Energy equivalent of 1 eV, J
+c = 1; // For simplicity assume speed of light of light to be unity
+T = 1e+010; // Temperature of the universe, K
+delta_m = m_n - m_p; // Mass difference between a proton and a neutron, MeV/c^2
+k = 1.38e-023; // Boltzmann constant, J/k
+// As from Maxwell-Boltzmann distribution from thermodynamics, N = exp(-m*c^2/(k*T)), so
+ratio = exp(delta_m*c^2*1e+006*e/(k*T)); // Ratio of protons to neutrons in the universe at 10 billion kelvin
+printf("\nThe ratio of protons to neutrons in the universe at 10 billion kelvin = %3.1f", ratio);
+
+// Result
+// The ratio of protons to neutrons in the universe at 10 billion kelvin = 4.5 \ No newline at end of file