How to distribute molecules to states using C++

  • Context: C/C++ 
  • Thread starter Thread starter dilatoryyang
  • Start date Start date
  • Tags Tags
    C++ Molecules States
Click For Summary
SUMMARY

This discussion focuses on distributing a large number of molecules, specifically one million, across multiple ro-vibrational states, such as 100 states, based on their relative populations. The method involves generating a random number between 0 and 1 to assign states according to predefined population percentages, exemplified by 50%, 25%, 15%, and 10% for four states. This approach is crucial for accurately simulating the classical trajectory of molecules in a spatially inhomogeneous electric field. The technique is straightforward and effective for numerical simulations in molecular dynamics.

PREREQUISITES
  • Understanding of C++ programming
  • Knowledge of random number generation techniques
  • Familiarity with ro-vibrational states in molecular physics
  • Basic concepts of classical trajectory simulations
NEXT STEPS
  • Research C++ random number generation libraries
  • Explore algorithms for population distribution in molecular simulations
  • Learn about classical trajectory simulation techniques in molecular dynamics
  • Investigate the impact of electric fields on molecular behavior
USEFUL FOR

Researchers, physicists, and software developers involved in molecular dynamics simulations, particularly those focusing on the distribution of molecules across energy states in varying electric fields.

dilatoryyang
Messages
3
Reaction score
0
I don't know how to distribute large amount of molecules(say a million) to many ro-vibrational states(say 100 states), according to the relative population of these states. As is very important when I want to simulate numerically the classical trajectory of these molecules in a spatially inhomogeneous electric field.
 
Technology news on Phys.org
Doesn't sound very hard. If you have the relative populations, e.g. say 50%, 25%, 15%, 10% (four states) then you could, for instance: Pick a random number between 0 and 1 (which is what most random functions return) if it's 0-.5 assign state 1, if it's 0.5-0.75 assign state 2, 0.75-0.90 assign state 3 and 0.9-1 assign state 4.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
11K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
2
Views
2K