Luke Carlson edited Method.tex  about 11 years ago

Commit id: e6a567092bd0e25a3a2b638ecd6d322d8213b7d8

deletions | additions      

       

\section{Method}  \subsection{Computing Pressure}  I began constructing my simulation with '3D Balls Bouncing', a project from Open Processing, as a base. Starting off with a system that could already handle 3D collisions of small objects inside a container was necessary [see Failed Methods]. From there, I created small spheres with the properties of an ideal gas. Their speed was roughly determined on a Maxwell-Boltzman distribution and assuming that the most probable speed ($V_{p}$) would occur the most often (calculated using the formula $V_{p} = \sqrt{\frac{2kT}{m}}$. Next, I focused on one wall in the container and tracked each time a particle collided with the area. I could then compute the change in momentum over the area since I had the masses and velocities of the particles. The simulation did not keep track of total time since initiation, which is equivalent to \Delta time, but I knew that aspects of the code were executed every frame. The project ran at a fixed number of frames per second (60) so I designed this formula to figured out the change in time: $total\ time (seconds) = \frac{total\ frames}{frames\ per\ second}$.   I inserted that data into this formula $F = \frac{2m * \displaystyle\sum\limits_{0}^n v}{\Delta t}$ (see Introduction) to find the total force on the wall. To obtain the pressure, I just divided the answer by the area of the wall.  \subsection{Testing Accuracy}  Now that I was able to compute the pressure, I could test my hypothesis by increasing the number of particles in the system and comparing the pressure readings. I started off with 5 particles and then tried 10, 15, and 20 particles. I calculated the total pressure of each system once every 5 seconds for 20 seconds.  \subsection{Experimentally Assessing the Relationship Between Pressure and Volume}  The next step of my experiment involved manipulating the volume of the container while keeping the number of particles constant. In order to do so, I altered one line of code in box_class.pde: the box Class:  \verb|int boxsize = 300;|  This variable alters the dimensions of the box (currently 300x300x300 pixels). I changed the boxsize to 400, 500, and 600, and calculated the pressure every 5 seconds for 20 seconds.