Second part:
Simulate a collection of N particles with different
masses, bouncing off each other, and moving in one dimension.
For the final part of this project,
it's important that the particles should all have different masses (for example,
ranging between 1 and 9 mass units).
But initially when developing your program it might be
wise to check what happens in the special case where they are equal.
Collect data at every time Tc, 2Tc, 3Tc, ...
If you are making a movie, you will want to have Tc a little smaller than the
typical time between collisions.
If you are just gathering statistics and not making a movie,
you can use a bigger Tc -- perhaps N times bigger is reasonable, where
N is the number of particles.
Run the simulation for a long time, and then plot histograms
of the velocities and positions of all the different masses.
Pick two particles, having the biggest and smallest masses, and
look at the histograms of their velocities.
Make a theory to describe these histograms.
|
|
Here are histograms of velocities
using 400 samples. The histogram with
velocities ranging from -8 to 8 is for a particle with mass 9.
The histogram with
velocities ranging from -24 to 24 is for a particle with mass 1.
To make good histograms you will
want 1000s of samples.
When making histograms, you may find the octave function histo useful.
However, in my experience, this function does not do what I really want. Its bin
sizes are too big. I therefore offer to you
my histogram routine,
djcmhisto.m, which also returns a Gaussian Fit
to the histogram, and tells you the mean and standard deviation of each column.
You can see a simple example use of this histogram program
here (TESTdjcmhisto.m).
|
Solution
A solution is in bounce1.m.
Here are examples of the types of graph that are interesting
to plot.
In order to not give away the results that you
will get for a simulation with lots of masses,
with masses ranging from 1 to 9,
I show here some small histograms and scatterplots
for a system with just two balls.
(1) (most important): Histogram of velocity of each particle
|
(2) scatter plot of positions of particles, or histograms of positions.
|
(3) scatter plot of position versus velocity.
|
|