Results 1 to 2 of 2

Math Help - Making a particle engine, need help!

  1. #1
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    357
    Thanks
    1

    Making a particle engine, need help!

    Hi! I have started creating a particle engine. It is going to simulate air and water.

    Now I have a question. To make it look realistic you will have to make the particles react with each other, since every water molecule pushes or pulls in other water molecules. How do I calculate the force between two water molecules (or in this case, particles)? Between two air molecules? I have made a simulation program for air turbulence before, but the physics became much simpler then since I used a map over the densities at different places instead of particles, and a map for the velocities (I also limited the simulation to two dimensions). However that type of simulation has disadvantages, like air that moves just horizontally or vertically, or that the air in one square (like pixels in the map) will get “blurred” when moving between two squares.

    Besides, how can you calculate the pressure in water with a certain density at a certain temperature? That is simple to do with gasses since you can use the ideal gas law. Since I also had a map over the temperature at different places, this was possible. I could even make a lens by decreasing the temperature inside of it to make the sound travel slower. A sound wave could then be concentrated at a specific point by using such a “temperature lens”, that was pretty cool.

    My other question is about optimizing the algorithm so that advancing one frame ahead doesn’t take O(n^2) time to do, but O(n) time. By only looking at say the 8 or 20 or something like that closest particles, you can still get a realistic simulation right? You don’t have to look at every particle in the whole system. I guess then you will also have to modify the physics to make it do about the same thing as it would have done if you would have looked at every particle? Now my question is, how do I know which particles I should look at? And when I know which particles to look at, I need to have access to those particles in constant time to make the whole simulation run in O(n) time, do I have to use some special kind of structure for that? Like a dynamic grid between particles or something? I know that this s not a question about physics, but sometimes mathematicians happen to be pretty good at programming to.

    I would love to get as much help as possible with this thing, information about how to do it is welcome, also if you can refer to some good site maybe a Wikipedia article I could read about this in I would be thankful. Thanks in advance.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,842
    Thanks
    320
    Awards
    1
    Quote Originally Posted by TriKri View Post
    Now I have a question. To make it look realistic you will have to make the particles react with each other, since every water molecule pushes or pulls in other water molecules. How do I calculate the force between two water molecules (or in this case, particles)? Between two air molecules?
    There are two (primary) interactions between molecules. The first is due to polar bonding, as in the case of water, and the second is the Van der Waals force. Neither is going to be particularly simple to use for you model as the polar forces depend on the orientation of the two molecules and to deal with Van der Waals properly you are likely to need to employ Quantum Mechanics. (Though you might be able to get some aid using Statistical Mechanics. I'm not sure.)

    -Dan
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. 3D Engine geometry Lines in 3D space
    Posted in the Geometry Forum
    Replies: 2
    Last Post: April 19th 2011, 11:49 AM
  2. Airplane Engine - Probability Question!
    Posted in the Statistics Forum
    Replies: 1
    Last Post: February 4th 2009, 06:33 PM
  3. Mathematical search engine
    Posted in the Math Software Forum
    Replies: 1
    Last Post: June 15th 2008, 03:01 AM

Search Tags


/mathhelpforum @mathhelpforum