Computational particle physics

Click For Summary

Discussion Overview

The discussion revolves around generating initial velocities for particles in a computational particle physics simulation, specifically focusing on how to incorporate a specific statistical weight distribution, such as Maxwellian or loss cone distributions. The participants explore methods for achieving this within the constraints of their existing random number generator and the desired physical properties of the particle system.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant seeks to modify a FORTRAN random number generator to produce initial velocities that follow a Maxwellian distribution, questioning how to effectively use a weight function (wt) as a probability for particle distribution.
  • Another participant suggests that if initial velocities are uniformly distributed, particles can be retained with a probability proportional to wt, but notes that this may result in losing many particles.
  • There is a discussion about whether to use Maxwell–Boltzmann speed distribution or velocity distribution, with some participants indicating that both should yield similar results in a spherically symmetric system.
  • Concerns are raised about the need for specific particle IDs and the non-uniform distribution of generated velocities, complicating the application of statistical weights.
  • Participants express uncertainty about how to implement the concept of initial statistical weight and how to effectively analyze the resulting particle trajectories in a dipolar field.
  • Clarifications are sought regarding the meaning of "weighted sum" over particles and its implications for observing properties like velocity and density.
  • There is a suggestion that assigning weights mathematically could involve multiplying the distribution function by initial values, although this remains a point of contention.

Areas of Agreement / Disagreement

Participants express differing views on the implementation of statistical weights and the appropriate distribution functions to use. There is no consensus on the best approach to achieve the desired initial particle distribution or how to effectively utilize the weight function in their simulations.

Contextual Notes

Participants mention limitations related to the uniformity of the initial velocity distribution and the specific requirements of their simulation environment, which may affect the applicability of proposed solutions.

mehdi6
Messages
4
Reaction score
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
 
Physics news on Phys.org
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.
 
mfb said:
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
 
mfb said:
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.
 
mehdi6 said:
making the particles to move based on their initial weight
What do you mean by that?
mehdi6 said:
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?
mehdi6 said:
"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.
mehdi6 said:
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.
 
mfb said:
What do you mean by that?
I meant Initial statistical weight.
mfb said:
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).
mfb said:
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?
mfb said:
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?
 
mehdi6 said:
I meant Initial statistical weight.
That answer doesn't clarify what you mean by "make them move based on a weight".
mehdi6 said:
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.
mehdi6 said:
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
1K
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K