Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init_velocity distribution #1

Open
stanislc opened this issue Jan 21, 2023 · 1 comment
Open

Init_velocity distribution #1

stanislc opened this issue Jan 21, 2023 · 1 comment

Comments

@stanislc
Copy link

Hey,

Does your function:

 def _init_velocities(self, temp, size):
        """Initialize velocities for each atom from a Maxwell-Boltzmann 
        distribution"""
        kbT_over_m = 1.3806503*temp/(39.948e-3*6.0221415**(-1)) # m^2/s^2
        velo_std = (kbT_over_m)**0.5 # m/s
        init_velo = np.random.normal(0, velo_std, size)
        return init_velo

Provides the Maxwell distribution?

@Truman-Xu
Copy link
Owner

Yes, I believe so. The velocities are drawn from a Gaussian with std of 'sqrt(kBT/m)'. I also plotted the velocities in the jupyter notebook, and the shapes conforms to Maxwell-Boltzmann distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants