Faculty of Engineering International Credit Hours Engineering Programs Communication Systems Engineering Program Academic Year 2023/2022 – Spring 2022 PHM 123 Thermal and Statistical Physics Major Task Phase (2) Name ID Youssef Hany Youssef 21P0398 Omar Mohamed Kamal 20P7817 1|Page Table of content: 1. Question I…………………………………………….... 3 2. Question II……………………………….…….………. 5 3. Question III…………………………………………………. 7 4. Question IV…………………………………………... 11 5. Question V……………………………………..…….. 13 2|Page Question I: ๐ฎ๐๐๐๐๐: ๐ = 8.3144621 ๐๐๐๐๐๐๐๐ก๐ข๐๐ = 100 โ/373 ๐พ ๐ = 0.55 ๐ = 3.0 × 10−5 ๐ = 1 ๐๐๐๐ ๐๐๐๐ข๐๐ ๐๐๐๐๐ โถ 0.5 – 1 ๐3 Firstly, we set 100 steps for the volume. Then, we set up equations for the real P and the ideal P. We then plot both of them, with the pressure being the y-axis and the volume being the x-axis. Then, we identify a function at V for the real P, so that we can get the exact integration answer (from 0.5 to 1). As for the numerical method, we use the trapezoidal method to get the approximated answer. To calculate the error, we use the rule: ๐๐๐๐๐ = √|๐๐๐๐๐ − ๐๐๐๐๐๐๐๐๐๐ ๐ | As most of the numerical methods word, if we increase the number of steps, the error decreases, and vice versa. This is how the plot should look like: Figure (1): PV diagram for a gas at 373 K at a pressure from 0.5 to 1 m 3 3|Page In this range, the differences will not be clear. However, if we zoom in on a smaller range, it will be clearer. Figure (2): PV diagram for a gas at 373 K at a pressure from 0 to 5 dm 3 It is clear that with really high pressure and low temperature, the ideal starts deviating from the real. As we can see, when the pressure decreases there are almost no differences again. This can be explained by the fact that ideal gases have no definite volume, which can be negligible, unlike real gases. This is why the ideal gases have more pressure than the real gases, under the same volume. ๐น๐๐๐๐๐๐: ๐โ๐ ๐๐๐๐๐๐๐๐๐๐๐ ๐ค๐๐๐ (๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐ฆ ๐๐ข๐๐๐๐๐๐๐ ๐๐๐ก๐๐๐๐๐ก๐๐๐ ๐๐ ๐๐๐๐. ๐๐๐๐ ๐โ๐ ๐๐๐๐๐ ๐ค๐๐๐ (๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐ฆ ๐๐๐ก๐๐๐๐๐ก๐๐๐ ๐๐ ๐๐๐๐. ๐๐๐๐ ๐โ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐๐๐ % 4|Page Question II: ๐บ๐๐ฃ๐๐๐ : ๐ = 20โ/293 ๐พ ๐ = 28.78 × 1.66 × 10−27 ๐๐ = 1.38 × 10−23 Here we start by putting the velocity from 0 to 1500, with a step of 0.1. We then set up our function, as a function of v, and plot it. Then, we got the most probable speed by using the equation: 2๐พ๐ ๐ We multiply the answer we got by 1.5 to know where the point we want is (let’s call it v1). We also plot that point. Here is the plot of the function and the point. ๐๐๐ = √ Figure (3): Maxwell-Boltzmann distribution at 293K with the specified point in red. 5|Page Then we iterate until we find the velocity at which the graph after it saturates to approximately zero and call it the case max speed. The numerical answer is done by numerically integrating from the start speed to the case max speed and then we compare it with the exact answer given by integrating the function itself from the start speed to infinity and we calculate the error. ๐น๐๐๐๐๐๐ ๐โ๐ ๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐ ๐๐ ๐๐. ๐๐๐๐ % ๐โ๐ ๐๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐ ๐๐ ๐๐. ๐๐๐ % ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐๐๐% 6|Page Question III: A) A theory of the specific heat capacity of solids put forward by Peter Debye in 1912, in which it was assumed that the specific heat is a consequence of the vibrations of the atoms of the lattice of the solid. In contrast to the Einstein theory of specific heat, which assumes that each atom has the same vibrational frequency, Debye postulated that there is a continuous range of frequencies that cuts off at a maximum frequency νD, which is characteristic of a particular solid. Debye treated the solid as a continuous elastic body in which the vibrations of the atoms generate stationary waves. According to Debye, the atoms in a solid do not vibrate independently with the same frequency. The oscillations belong to the entire solid and frequencies of various modes of oscillation vary from 0 to a certain maximum value which is characteristic of a substance and one can express it in terms of elastic constants. Figure (4): Comparison of Debye and Einstein Models 7|Page The theory leads to the conclusion that the specific heat capacity of solids is proportional to T3, where T is the thermodynamic temperature. A key quantity in this theory is the Debye temperature, θD, defined by θD = hνDk, where h is the Planck constant and k is the Boltzmann constant. At very low temperatures, the T dependence of specific heat agrees for nonmetals. And for metals, the specific heat of the atoms at high temperatures is defined by the Einstein model. The temperature dependence of the Einstein model is just on T. Both Einstein model and Debye model gives major contribution to the high temperature. To explain the low-temperatures specific heats of metals, they include electron contribution to the specific heat. Figure (5): Summary of Debye vs Einstein Model 8|Page B) ๐ฎ๐๐๐๐๐: ๐๐ = 2230๐พ ๐=1 Here we put different number of steps for each temperature, where the approximate has 100 steps while the exact has 1000 steps. Then we put our entropy functions, again one for the approximate and another for the exact, and we plot both of them after. Figure (5): Entropy – temperature graph for diamond from 4k to 40k We then identify a function at T so we can integrate it. We use trapezoidal method to integrate it numerically then we integrate it normally from 4 to 40 to get the exact answer. This is how our results looked like: 9|Page ๐น๐๐๐๐๐๐: ๐ต๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐ ๐๐ ๐ฝ/๐พ ๐๐ ๐. ๐๐๐๐๐๐๐ ๐ฌ๐๐๐๐ ๐๐๐๐๐๐ ๐๐ ๐ฝ/๐พ ๐๐ ๐. ๐๐๐๐๐๐ C) We already calculated the exact answer and error in B, and they were: ๐น๐๐๐๐๐๐: ๐ฌ๐๐๐๐ ๐๐๐๐๐๐๐ก๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐๐% 10 | P a g e Question IV: ๐๐ ๐๐ ๐๐๐๐๐๐๐๐ก๐ข๐๐ = 500๐พ ๐ถโ๐๐๐๐๐๐ ๐๐๐ก๐๐๐ก๐๐๐ = +0.005 ๐๐ ๐พ๐ = 1.38 × 1023 ๐ = 1.6 × 10−19 ๐พ๐ = ๐ ∗ ๐พ๐ First, we put the equations for the three types of distributions: Boltzman_dist = 1./exp((E+0.005*e)./KT) ; Fermi_dist = 1./((exp((E+0.005*e)./KT))+1) ; Boson_dist = 1./((exp((E+0.005*e)./KT))-1) ; We then plot the three equations. Also, we put out y limit at 1 because boson distribution wouldn’t fit the plot at low values. The plot is as following: Figure (6): the energy distribution for the 3 energy distributions at 500K and chemical potential of 0.005 ev 11 | P a g e The distribution of particles in a system at a particular temperature is described by the Maxwell-Boltzmann, Bose-Einstein, and Fermi-Dirac statistics. Systems of non-interacting, non-identical particle systems, such as gases made up of atoms or molecules, are covered by the Maxwell-Boltzmann statistics. It claims that the temperature divided by the negative exponential of the energy is inversely proportional to the likelihood of a particle possessing a particular energy. This can be concluded from the graph because the energy decreases as the energy increases until it saturates at a zero probability at about 4KT. Systems of identical, non-interacting bosons, such as photons or atoms in a Bose-Einstein condensate, are subject to the BoseEinstein statistics. It says that the exponential of the negative of the energy divided by the temperature, minus one, is proportional to the likelihood of a particle having a given energy. This minus one is the reason it approaches infinity at zero energy because at this point the dominator will equal zero. This may mean that these particles cannot have zero energy. Systems containing identical, non-interacting fermions, such as the electrons in a metal or the atoms in a Fermi gas, are covered by the Fermi-Dirac statistics. According to this formula, the chance of a particle possessing a specific amount of energy is equal to the negative exponential of the energy divided by the temperature, plus one. From the graph, this can be understood because the fermi is just like the Maxwell-Boltzmann except that it’s always less than it. 12 | P a g e Question V Part 1: ๐๐ ๐๐ ๐บ๐๐ = ๐๐ฅ๐ฆ๐๐๐ ๐ = 5.312 × 1026 ๐พ๐ = 1.38 × 10−23 ๐๐ข๐๐๐๐ ๐๐ ๐๐๐๐๐๐ข๐๐๐ = 106 ๐๐๐๐๐๐๐ก๐ฆ ๐๐๐๐๐ = 0: 2000 First, we declare the main variables and constants. Our first job is to calculate the temperature, so we need to put a range. We can assume that the temperature is between 1 and 1000 K, so we will iterate through range with a step 0.01 K and calculate the value of the number of molecules in the three specified range and compare it with the real values we have in the problem. The error was calculated using the following formula: ๐๐๐๐๐ = √|๐๐๐๐๐ − ๐๐๐๐๐๐๐๐๐๐ ๐ | Then we add the error for the three ranges and compare it with the minimum error (its initial value was very big to be changed in the Figure (7): Maxwell-Boltzmann distribution at the specified temperature with the given ranges specified using dotted lines. 13 | P a g e iteration). If the error is less than the minimum error, then this temperature is the new best temperature, and this error is the new minimum error. The process continues until the range is finished. After we made this Process, the best temperature found was 499.96 K which is approximately 500 K. For this temperature we have plotted the velocity distribution and calculated the needed number. Answer: ๐๐๐๐๐๐๐๐ก๐ข๐๐ = ๐๐๐. ๐๐ ๐ฒ โ ๐๐๐ ๐ฒ ๐๐๐๐๐๐ข๐๐๐ โ๐๐ฃ๐ ๐ ๐๐๐๐ ๐ฃ๐๐๐ข๐๐ ๐๐๐๐ 400 ๐/๐ ๐ก๐ 450 ๐/๐ = ๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐ข๐๐๐ โ๐๐ฃ๐ ๐ ๐๐๐๐ ๐ฃ๐๐๐ข๐๐ ๐๐๐๐ 950 ๐/๐ ๐ก๐ 1000 ๐/๐ = ๐๐๐๐๐ ๐ท๐๐๐๐๐๐๐๐ Part 2: First, we started by declaring the main variables and constants. Then we started to take the input from the user and ensure that the input is logical (like that the number of particles is less than 108). Then we start by normalizing the portion of the graph that the user gives as an input. This normalizing process is done by integrating the function in the specified range and divide all the values in the range by this factor, so that the total area of this part is exactly 1. Then, we start by iterating through each velocities range. For each range we approximate the number of particles that have a velocity in this range. Then we randomly generate the needed number of particles’ speeds in this range by the following code ๐๐๐ค_๐๐๐๐๐๐ข๐๐๐ = (๐๐๐๐(1, ๐๐๐ข๐๐(๐๐๐ก๐๐_๐๐_๐๐๐๐๐ ∗ ๐๐ข๐_๐๐๐๐๐๐ข๐๐๐ )) ∗ ๐ ๐ก๐๐_๐ ๐๐ง๐) + ๐; Then we add the velocities for each range to the main velocities array. 14 | P a g e Figure (8): Flowchart describing the model of part 2 of question 5. 15 | P a g e After this process, we ensure the velocities graph contains exactly the number of speeds needed. We may eliminate or add small number of velocities to regulate the array. Then, we iterate through the speed to find the number of velocities that range between 200 and 900 m/s. Then, we calculate the exact number from the integration of the main function and the error is calculated. The root mean square velocity Is calculated by squaring the array of velocities, find its mean and then calculate its square root. The exact value is calculated using the theoretical formula. The average velocity is calculated by just finding the mean of the array of velocities. Then the mode is calculated by rounding the values in the array and finding the mode by a direct function. Allt he numerical values were compared with the theoretical formulas that are summarized in Figure (9). Figure (9): Maxwell-Boltzmann velocity distribution and speeds formulas 16 | P a g e To test the output of this code, we will show a test case: ๐ฐ๐๐๐๐๐ ๐โ๐๐๐ ๐๐๐ 4 ๐๐ฃ๐๐๐๐๐๐ ๐๐๐ ๐๐ : 1 − ๐๐ฅ๐ฆ๐๐๐ 2 − ๐๐๐ก๐๐๐๐๐ 3 − ๐ป๐ฆ๐๐๐๐๐๐ 4 − ๐ป๐๐๐๐ข๐ ๐ธ๐๐ก๐๐ ๐กโ๐ ๐๐ข๐๐๐๐ ๐๐ ๐กโ๐ ๐๐๐ ๐ฆ๐๐ข ๐ค๐๐๐ก , ๐๐ ๐๐ ๐๐๐ ๐๐ ๐ข๐ ๐๐ ๐๐ฅ๐ฆ๐๐๐ ๐ 1 ๐ธ๐๐ก๐๐ ๐กโ๐ ๐๐ข๐๐๐๐ ๐๐ ๐๐๐๐๐๐ข๐๐๐ , ๐๐ก ๐๐ข๐ ๐ก ๐๐ ๐๐๐ ๐ ๐กโ๐๐ก 10^8 1๐5 ๐ธ๐๐ก๐๐ ๐กโ๐ ๐ก๐๐๐๐๐๐๐ก๐ข๐๐ ๐๐ ๐กโ๐ ๐ ๐ฆ๐ ๐ก๐๐ 250 ๐ธ๐๐ก๐๐ ๐กโ๐ ๐๐๐๐๐๐๐๐๐ ๐กโ๐ ๐ ๐๐๐๐ ๐๐๐๐๐ 0 ๐ธ๐๐ก๐๐ ๐กโ๐ ๐๐๐ ๐กโ๐ ๐ ๐๐๐๐ ๐๐๐๐๐ 1500 ๐ถ๐๐๐๐๐ ๐โ๐ ๐๐ข๐๐๐๐ ๐๐ ๐๐๐๐๐๐ข๐๐๐ ๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐๐๐ 200 ๐ก๐ 900 ๐๐ ๐๐๐๐๐ ๐โ๐ ๐๐ฅ๐๐๐ก ๐๐ข๐๐๐๐ ๐๐ ๐๐๐๐๐ ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐ % ๐โ๐ ๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐๐๐ ๐๐ ๐๐๐. ๐๐๐๐ ๐โ๐ ๐๐ฅ๐๐๐ก ๐๐๐๐ ๐๐ ๐๐๐. ๐๐๐ ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐ % ๐โ๐ ๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐ฃ๐๐๐๐๐ ๐ฃ๐๐๐๐๐๐ก๐ฆ ๐๐ 406.6994 ๐โ๐ ๐๐ฅ๐๐๐ก ๐๐๐๐ ๐๐ฃ๐๐๐๐๐ ๐ฃ๐๐๐๐๐๐ก๐ฆ 406.6779 ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐๐๐๐ % ๐โ๐ ๐๐๐๐ข๐๐๐๐ก๐๐ ๐๐๐ ๐ก ๐๐๐๐๐๐๐๐ ๐ ๐๐๐๐ ๐ฃ๐๐๐๐๐๐ก๐ฆ ๐๐ ๐๐๐ ๐โ๐ ๐๐ฅ๐๐๐ก ๐๐๐ ๐ก ๐๐๐๐๐๐๐๐ ๐ ๐๐๐๐ ๐๐ ๐๐๐. ๐๐๐๐ ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐. ๐๐๐๐ % 17 | P a g e The Histogram for the velocities range is as follows: Figure (10): Histogram of the generated array of velocities 18 | P a g e