summaryrefslogtreecommitdiff
path: root/2795/CH16/EX16.4
diff options
context:
space:
mode:
Diffstat (limited to '2795/CH16/EX16.4')
-rwxr-xr-x2795/CH16/EX16.4/Ex16_04.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/2795/CH16/EX16.4/Ex16_04.sce b/2795/CH16/EX16.4/Ex16_04.sce
new file mode 100755
index 000000000..64ec97a01
--- /dev/null
+++ b/2795/CH16/EX16.4/Ex16_04.sce
@@ -0,0 +1,16 @@
+// Scilab Code Ex16.4: Page-589(2014)
+clc; clear;
+M = 1.99e+030; // Mass of the sun, kg
+G = 6.67e-011; // Universal gravitational constant, N-Sq.m/kg^2
+k = 1.38e-023; // Boltzmann constant, J/K
+R = 6.96e+008; // Radius of the sun, m
+m = 1.67e-027; // Rest mass of the proton, kg
+PE = 3/5*(G*M^2/R); // Self potential energy of the sun, J
+// As KE = 1/3*(M/m_p)*m_p*v^2, solving for v
+v = sqrt(2*PE/M); // Velocity of a proton inside the sun, m/s
+// From kinetic theory of gases, v = sqrt(3*k*T/m), solving for T
+T = m*v^2/(3*k); // The mean temperature of the sun, K
+printf("\nThe mean temperature of the sun = %1.0e K", T);
+
+// Result
+// The mean temperature of the sun = 9e+006 K \ No newline at end of file