Physics & Mathematical Modeling
Selected software applications that showcase physics and mathematical modeling.To see more of my work in this field, plese drop me a line.
Kinetic Theory of Gases
Gas particles packed in a container can be modeled using KTG. Velocity distribution of these
gas particles is described by Maxwell-Boltzmann probability distribution. This application
models a special case of a container having a hole on one side. The particles can escape the
container through the hole.
The algorithm is easy to understand:
- We define a molecule structure/class. It includes mass, velocity, position, etc.
- Container is another class that models dimentions, temperature, pressure, etc.
- Now we create several particles in container (this application has 1500)
- Maxwell-Boltzmann distribution is applied onto all these molecules. i.e. Their velocities are determined according to probability distribution. You can see that distribution when you execute it & reach last page.
- Then we create 2 video pages (memory bitmaps if you come from WinSDK/VC++ or Image class in Java)
- And star simulation. With each iteration, we determine for each particle where it is going to be in the container. We know its velocity vector and position. So using Delta(T) time we can extrapolate the position. Then determine if the particle is likely to "hit" the hole or the wall. If it hits the wall, it gets reflected back. And that's it.
- With each frame, we do all these on "hidden" video page, and then bring it on the "visible" video page.
3D version of KTG
Above 2D example, can be extended in 3D easily. In 3D the rectangular container becomes a cubic container.
All movements and velocities happen in 3D. The idea is simple, each particle has 3 vectors associated with it.
(Vx, Vy, Vz) triplet of vectors specifies the magnitude of velocities along X, Y, and Z axes respectively.
Following figures show:
- Maxwell Boltzmann distribution of velocities.
- 3D Cube container with particles & hole.
Source code for this application is available upon request.Binaries can be downloaded here.
Planet Generator
Like all other organic objects, planet generation also involves stochastic modelling - a mathematical
model that involves randomness, probability, and large number of variables.
My application shows a technique that emulates continent drifting. The algorithm is as follows:
- Start with a sphere
- Imagine a plane going across (through) it
- Hemi-sphere on one side of the plane expands a little bit
- Second hemi-sphere gets compressed a little bit
- If these steps are carried out with large number of iterations with variable amounts of compression and expansion, the planet starts getting better and better
Heat Equation Solver
Laplace wave euqation is a versatile mathematical model used for modeling vibrations, heat flow, and
general waves analysis.
My application solves differential equations related to Laplace wave equation.
And plots function values using "heat color palette". It is technically a cooling that occurs over
period of time. The temperature decreases exponentially with time. The plate is assumed to be
insulated on its boundaries.
Download executable for Heat Solver. Source code for application is available upon request.
Fluid Flow Solver
Fluids attract most of attention in scientific, engineering, and computer graphics problems.
Modelling of fluid motions can be implemented in several ways. And visualization of that model
can also be achieved in many different ways.
- Mathematical & Physics based modeling
- Navier-stokes equations
- Conformal mapping
- Rigid body model
- Visualization
- Particle systems
- Volume rendering
My application uses Conformal mapping as a basis to model a specific case of fluid motion around cylindrical (circular in 2D) obstacle. Animation of fluid is achieved using simple particle systems. It has a Plug-N-Play Architecture, so that you can write another flow solver with only its Mathematical model, and this application will take care of animation, page flipping, GUI, start/stop etc. It is implemented in C++, GUI is built with MFC on VC++. Plugin classes I wrote for fluid solver are:
Source code for fluid flow visualization application, flow solver classes is available upon request.

