0% found this document useful (0 votes)
15 views5 pages

Project Report - Physics 1 - Topic 10

This report discusses the Maxwell-Boltzmann velocity distribution, which describes the speed distribution of particles in a gas at thermal equilibrium, and its applications in understanding gas dynamics. It includes a MATLAB program that calculates and plots the distribution for various gases and temperatures, demonstrating the probability of particles within specified velocity ranges. The findings confirm the theoretical predictions and highlight the utility of MATLAB for complex calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Project Report - Physics 1 - Topic 10

This report discusses the Maxwell-Boltzmann velocity distribution, which describes the speed distribution of particles in a gas at thermal equilibrium, and its applications in understanding gas dynamics. It includes a MATLAB program that calculates and plots the distribution for various gases and temperatures, demonstrating the probability of particles within specified velocity ranges. The findings confirm the theoretical predictions and highlight the utility of MATLAB for complex calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY

ASSIGNMENT REPORT PHYSICS 1:


Project 10: Maxwell – Boltzmann velocity
distribution

Members
Full name ID number Class
Nguyễn Trần Việt Hưng 2152629 CC02
Trần Gia Huy 2352409 CC02
Nguyễn Võ Nguyên Khang 2352494 CC02
Nguyễn Gia Khánh 2352523 CC02
Trần Anh Khoa 2352587 CC02
Applied Physics Department: Matlab Projects 2

1. INTRODUCTION
The Maxwell-Boltzmann velocity distribution describes the distribution of speeds among particles
in a gas that is in thermal equilibrium. It is derived from the principles of statistical mechanics
and provides a probability distribution for the speeds of particles in the gas. This distribution is
fundamental in understanding the kinetic theory of gases and plays a critical role in various fields
of physics.
The distribution function is given by:
r
m 3 mv 2
f (v) = 4πv 2 e− 2kT
2πkT
where:
• m is the mass of a particle
• k is Boltzmann constant
• T is the absolute temperature of the gas
Explanation and Application:
• Thermal Motion: The Maxwell-Boltzmann distribution explains the speed spread of par-
ticles in a gas. At higher temperatures, the distribution broadens, indicating a wider range
of particle speeds and a higher average speed.
• Gas Dynamics: It is essential to predict the behavior of gases under different conditions,
such as diffusion and overflow rates.
Graphical Representation: The Maxwell-Boltzmann distribution is often represented as a curve
on a graph where the x-axis is the speed of the particles and the y-axis is the probability density.
The curve shows a peak at the most probable speed and a gradual decrease at higher and lower
speeds. The area under the curve represents the total probability, which is 1.

2. THEORY
The expression for the average of the squares of velocities in one dimension is given by:
Z ∞
2
⟨v ⟩ = v 2 f (v) dv
−∞

where f (v) is the Maxwell-Boltzmann distribution for velocity v.


 1/2 2
− mv
Substituting f (v) = 2πkmB T e 2kB T , we obtain:

3kB T
⟨v 2 ⟩ =
m
For three dimensions, the total kinetic energy is three times that of one dimension:
3kB T
⟨v 2 ⟩total = 3⟨v 2 ⟩ =
m
The RMS velocity vrms is defined as the square root of the average of the squares of the velocities:
r
p 3kB T
vrms = ⟨v 2 ⟩total =
m
The kinetic molecular theory is used to determine the motion of a molecule of an ideal gas under
a certain set of conditions. However, when looking at a mole of ideal gas, it is impossible to
measure the velocity of each molecule at every instant of time. Therefore, the Maxwell-Boltzmann
distribution is used to determine how many molecules are moving between velocities v and v + dv.
Assuming that the one-dimensional distributions are independent of one another, that the velocity
in the y and z directions does not affect the x velocity, for example, the Maxwell-Boltzmann
distribution is given by
 1/2
dN m − mv
2
= e 2kB T dv (1)
N 2πkB T
Applied Physics Department: Matlab Projects 3

where
• dN
N is the fraction of molecules moving at velocity v to v + dv,
• m is the mass of the molecule,

• kB is the Boltzmann constant, and


• T is the absolute temperature.
Additionally, the function can be written in terms of the scalar quantity speed c instead of the
vector quantity velocity. This form of the function defines the distribution of the gas molecules
moving at different speeds, between c1 and c2 , thus
 3/2
2 m mc
− 2k
2
f (c) = 4πc e B T
(2)
2πkB T

Finally, the Maxwell-Boltzmann distribution can be used to determine the distribution of the
kinetic energy for a set of molecules. The distribution of the kinetic energy is identical to the
distribution of the speeds for a certain gas at any temperature.

3. MATLAB CODE
1 % Define constants
2 k_B = 1.38 e -23; % Boltzmann constant ( J / K )
3

4 % Define the mass of different gases ( kg )


5 gas_masses = struct ( ’ H2 ’ , 3.34 e -27 , ’ He ’ , 6.64 e -27 , ’ N2 ’ , 4.65 e -26 , ’ O2 ’ ,
5.31 e -26) ;
6

7 % Prompt user to enter the number of systems


8 num_systems = input ( ’ Enter the number of systems : ’) ;
9

10 % Initialize arrays to store data for each system


11 T = zeros (1 , num_systems ) ;
12 gas_types = cell (1 , num_systems ) ;
13 v_min = zeros (1 , num_systems ) ;
14 v_max = zeros (1 , num_systems ) ;
15

16 % Input data for each system


17 for i = 1: num_systems
18 fprintf ( ’ Enter data for system % d :\ n ’ , i ) ;
19 gas_type = input ( ’ Enter the type of gas ( H2 , He , N2 , O2 ) : ’ , ’s ’) ;
20 while ~ isfield ( gas_masses , gas_type )
21 disp ( ’ Invalid gas type . Please enter again . ’) ;
22 gas_type = input ( ’ Enter the type of gas ( H2 , He , N2 , O2 ) : ’ , ’s ’)
;
23 end
24 gas_types { i } = gas_type ;
25 T ( i ) = input ( ’ Enter the system temperature ( in K ) : ’) ;
26 v_min ( i ) = input ( ’ Enter the minimum velocity ( in m / s ) : ’) ;
27 v_max ( i ) = input ( ’ Enter the maximum velocity ( in m / s ) : ’) ;
28 end
29

30 % Velocity range for plotting ( choose the largest range among the systems )
31 v_max_plot = max ( v_max ) ;
32 v = linspace (0 , 2 * v_max_plot , 1000) ;
33

34 % Colors for each system


35 colors = [ ’b ’ , ’r ’ , ’g ’ , ’m ’ , ’c ’ , ’y ’ , ’k ’ ];
36 legend_labels = cell (1 , num_systems ) ;
37

38 % Plot the Maxwell - Boltzmann distribution for each system


39 figure ;
40 hold on ;
Applied Physics Department: Matlab Projects 4

41

42 for i = 1: num_systems
43 % Get the mass of the current gas
44 m = gas_masses .( gas_types { i }) ;
45

46 % Maxwell - Boltzmann distribution function for the current system


47 f_MB = @ ( v ) ( m / (2 * pi * k_B * T ( i ) ) ) ^(3/2) * 4 * pi * v .^2 .* exp ( - m
* v .^2 / (2 * k_B * T ( i ) ) ) ;
48

49 % Plot the distribution


50 plot (v , f_MB ( v ) , ’ Color ’ , colors ( mod (i -1 , length ( colors ) ) + 1) , ’
LineWidth ’ , 2) ;
51

52 % Highlight the specified velocity range


53 v_range = linspace ( v_min ( i ) , v_max ( i ) , 1000) ;
54 area ( v_range , f_MB ( v_range ) , ’ FaceColor ’ , colors ( mod (i -1 , length ( colors
) ) + 1) , ’ EdgeColor ’ , ’ none ’ , ’ FaceAlpha ’ , 0.5) ;
55

56 % Calculate the probability of particles existing within the specified


velocity range
57 probability = integral ( f_MB , v_min ( i ) , v_max ( i ) ) ;
58 disp ([ ’ The probability of particles existing in the velocity range ’ ,
num2str ( v_min ( i ) ) , ’ m / s to ’ , num2str ( v_max ( i ) ) , ’ m / s for system ’ ,
num2str ( i ) , ’ is ’ , num2str ( probability ) ]) ;
59

60 % Add label to legend


61 legend_labels { i } = [ ’ System ’ , num2str ( i ) , ’ ( ’ , gas_types { i } , ’) ’ ];
62 end
63

64 xlabel ( ’ Velocity ( m / s ) ’) ;
65 ylabel ( ’ Probability Density ’) ;
66 title ( ’ Maxwell - Boltzmann Velocity Distribution for Multiple Systems ’) ;
67 legend ( legend_labels , ’ Location ’ , ’ northeast ’) ;
68 grid on ;
69

70 % Display the plot


71 hold off ;
Listing 1: MATLAB program to calculate and plot the Maxwell-Boltzmann velocity distribution
for multiple systems

4. RESULTS AND DISCUSSION


Input:
Enter the number of systems: 3
Enter the type of gas (H2, He, N2, O2): H2
Enter the system temperature (in K): 373
Enter the minimum velocity (in m/s): 0
Enter the maximum velocity (in m/s): 10000
Enter the type of gas (H2, He, N2, O2): He
Enter the system temperature (in K): 273
Enter the minimum velocity (in m/s): 0
Enter the maximum velocity (in m/s): 10000
Enter the type of gas (H2, He, N2, O2): N2
Enter the system temperature (in K): 300
Enter the minimum velocity (in m/s): 0
Enter the maximum velocity (in m/s): 10000
Output:
The probability of particles existing in the velocity range 0 m/s to 10000 m/s
for system 1 is 1
The probability of particles existing in the velocity range 0 m/s to 10000 m/s
for system 2 is 1
The probability of particles existing in the velocity range 0 m/s to 10000 m/s
Applied Physics Department: Matlab Projects 5

for system 3 is 1

Discussion: The results is satisfied with the manual calculations. With the Matlab calculations, we
can evaluate for many specific cases
Conclusion: By researching the theory and programming calculations in Matlab for Maxwell –
Boltzmann velocity distribution, we complete the project and satisfied requirements. With these
calculations and Matlab program, we can solve for other complex cases which are difficult for
manual calculations.

5. Conclusion
Conclusion:We have conducted research based on theory and computational programming on Mat-
lab to analyze the Maxwell - Boltzmann distribution so we can more clearly determine the distri-
bution of gases at a certain temperature. Matlab’s charts and calculations help us solve difficult
calculation cases manually.

You might also like