How to distribute molecules to states using C++

  • #1
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.
 

Answers and Replies

  • #2
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.
 

Suggested for: How to distribute molecules to states using C++

Replies
14
Views
2K
Replies
2
Views
97
Replies
7
Views
789
Replies
5
Views
783
Replies
14
Views
865
Replies
9
Views
412
Replies
1
Views
677
Replies
34
Views
1K
Back
Top