How to distribute molecules to states using C++

  • #1

Main Question or Discussion Point

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
alxm
Science Advisor
1,842
9
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.
 

Related Threads for: How to distribute molecules to states using C++

Replies
33
Views
4K
Replies
1
Views
1K
Replies
10
Views
1K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
10
Views
3K
  • Last Post
Replies
9
Views
1K
Top