Computational particle physics

  • #1
4
0
Hi to all,
I have a random number generator in FORTRAN, which gives a random numbers to my particles initial velocity in three dimension (vx,vy,vz). If, I want to make my particles to embark to move with a specific weight (eg. Maxwellian), what should I do?

absv = sqrt(vx*vx+vy*vy+vz*vz)
wt= absv*absv*exp(-(absv*absv)/(a*a))
(a = sqrt(2*k*t/m))

if you simply plot any random numbers based on 'wt' you will get the maxwellian speed distribution as an output. I want to know, how can I make the 'wt' to be effective as a probability of particles initial distribution.
any suggestion is appreciated
 

Answers and Replies

  • #2
35,266
11,528
If your initial velocities have a uniform distribution over some sufficient range: You can keep particles with a probability proportional to wt. You might lose most of them in the process, however. If you can keep them and assign a weight to them you might get better results.
Even better would be a process that directly produces Gaussian random numbers, e.g. via the Box-Muller transform.
 
  • #3
4
0
If your initial velocities have a uniform distribution over some sufficient range: You can keep particles with a probability proportional to wt. You might lose most of them in the process, however. If you can keep them and assign a weight to them you might get better results.
Even better would be a process that directly produces Gaussian random numbers, e.g. via the Box-Muller transform.
Thanks for your reply.
As you may know, the random generator produce a number between -1 to 1 for the 3 velocity components. I make the arrangement so the velocity would be around -0.35 to 0.35 for each of them (non-relativistic range).
My code is a test particle code, and I could make it work efficiently for each test particle in both constant and dipolar field (with or without Electric field(acc)), but still I am struggling with making the particles to move based on their initial weight. I don't even know, whether I need to use the Maxwell–Boltzmann speed distribution or Maxwell–Boltzmann velocity distribution which in concept, both are telling the same story but giving me different result.
https://en.wikipedia.org/wiki/Maxwell–Boltzmann_distribution
"You can keep particles with a probability proportional to wt" would you please tell me how?
I will be appreciated if you can guide me through, cause I have been struggling with this issue for a while.
Thanks again
 
  • #4
4
0
If your initial velocities have a uniform distribution over some sufficient range
I have generated those numbers by using a self made function, so it Not some pseudo random generator. I need to give my particles an specific ID's apart from just giving them random velocity. plus their distribution is not uniform in this domain (-0.35 up to 0.35).

Before I run the code, I need my particle to gain weight initially. If you plot the generated velocity over 'wt', you can find out that they follow the maxwellian, as I mentioned. The question simply comes down to a point that, how to make particles to gain initial weight? what should be done?

Modifying the way that I produce those random numbers (like Box-Muller transform) won't be the appropriate solution for that. later I may need to change the maxwellian to another type of distribution (eg. loss cone ), So the concept is what I am looking for which can be used in different situation.
please let me know if you have any suggestions.
Thanks.
 
  • #5
35,266
11,528
making the particles to move based on their initial weight
What do you mean by that?
I don't even know, whether I need to use the Maxwell–Boltzmann speed distribution or Maxwell–Boltzmann velocity distribution which in concept, both are telling the same story but giving me different result.
As long as the system is spherically symmetric they should give the same result. What exactly are you doing?
"You can keep particles with a probability proportional to wt" would you please tell me how?
What is unclear? Just keep every particle. If you want to know some property of your gas, make a weighted sum over the particles.
Before I run the code, I need my particle to gain weight initially.
Weight as in m*g or a mathematical weight? Why, how? Giving them a mathematical weight: Just assign the weight to each of them.
 
  • #6
4
0
What do you mean by that?
I meant Initial statistical weight.
As long as the system is spherically symmetric they should give the same result. What exactly are you doing?
I am trying to initially distribute my particle based on an specific statistical weight (e.g. maxwellian, loss cone or...) then put them in an specific field like dipolar field and analysis their trajectory. plus Analyzing and deriving the final distribution function (for large number of particles).
What is unclear? Just keep every particle. If you want to know some property of your gas, make a weighted sum over the particles.
maybe from your side everything is clear, but not in mine that's why I am asking question. My environment is solar atmosphere which is plasma. what is weighted sum over the particle? what does it represent?
Weight as in m*g or a mathematical weight? Why, how? Giving them a mathematical weight: Just assign the weight to each of them.
Statistical- I need to initialize them based on their density probability to see how the outcome would be.
by assigning you mean, simply multiplying the distribution function to the initial values? In any case?
 
  • #7
35,266
11,528
I meant Initial statistical weight.
That answer doesn't clarify what you mean by "make them move based on a weight".
what is weighted sum over the particle? what does it represent?
Whatever you want to observe. Velocity, density, ...
100 particles in some volume with a weight of 1/10 each are the same thing as 10 particles with a weight of 1 - but the former will typically lead to smaller statistical fluctuations and it can be easier to generate.
Statistical- I need to initialize them based on their density probability to see how the outcome would be.
by assigning you mean, simply multiplying the distribution function to the initial values? In any case?
If I understand your question right: Yes.
 

Related Threads on Computational particle physics

Replies
5
Views
2K
Replies
12
Views
2K
Replies
6
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
5
Views
2K
Replies
8
Views
900
Top