Professional Documents
Culture Documents
Richard Wardin
Acknowledgements
First, I’d like to thank my physics teacher, who through
making me rewrite 6 pages worth of equations and calculations,
made sure that my work was as accurate as possible.
Second, I would like to thank my chemistry teacher, who
only laughed a little when I told her I forgot everything from
chemistry last year. Despite this, she helped reshow everything I
needed to know for the chemistry part of this.
Finally, I would like to thank my parents, who allowed me
the time to make this possible. Go mom and dad! =P
Introduction
Boom!
You’re playing the everyday, run of the mill game, when all
of the sudden, an explosion goes on. It could be a small explosion,
like a grenade, or a large building blowing up. But for the most
part, you notice that the explosions tend to be just a sphere of fire.
Now you start wondering, how could the programmers be so lazy
as to resort to the easy way out of an explosion? But in honesty,
the programmers don’t know what goes on in an explosion. Well
now, here are the calculations, so you no longer have to settle for
the sphere as an explosion. Now, you can make things go Boom!
like never before!!!
Basic Physics concepts
There are some basic physics concepts that need to be
understood before you can figure out what happens during an
explosion. If you already feel like you know these, feel free to
move on, but don’t say I didn’t warn you…
-Displacement (variable x, unit:m)
Generic definition is just distance, but there is a
difference between distance and displacement. Distance is how far
you travel; displacement is how far you travel relative to your
starting location.
-Velocity (variable v, unit m/s)
Displacement over time. Similar to speed except using
displacement instead of distance.
-Acceleration (variable a, unit m/s²)
Velocity over time
-Mass (variable m, unit kg)
It may seem like weight, but it’s not. It a relative
measurement to other objects, meaning that the mass will
ALWAYS be the same in other gravities, unlike weight
-Volume (variable V, unit m^3)
Amount of space a substance takes up
-Force (variable F, unit kg*m/s² or Newton (N))
Mass times acceleration
-Pressure (variable P, unit N/m² or Pascal (I’m not sure of the
abbreviation, I’ll have to look it up))
The amount of force acting upon a cross sectional area
The Ideal Gas law
In the formulas I am going to present, you need to know the
ideal gas law, which is a formula from chemistry that allows you to
find the properties of a gas.
This law states that:
PV=nRT
For ANY gas.
PV = PV
nT nT
1. 2.
As you can see, there are really only a few main parts to an
explosion:
-Initialization
-Building of Pressure
-Separation of pieces
-Flying pieces
Because I want to bear no responsibility, I am warning you
that the information contained from here on out was made for
programming purposes only. Because of this, the information here
should not be used for calculations involving actual explosions.
The author assumes no responsibility for any injury that may result
from misuse of this information.
Also, I will NOT provide the chemical reactions needed to
make an explosion. Instead, the programmer will use a value ‘r’
which will stand for the rate of mole increase. To make a realistic
explosion that is accurate, you will have to do some outside
research to find this rate, or find a value for it that seems suitable
for the type of explosion you would like to create.
Thank you for your understanding and cooperation. Now I
shall continue…
Initialization
The first thing you need to do before you can start making an
explosion is to figure out all the specs of the container that the
explosion is happening in. For this, I prefer to just use a mesh (for
those of you who don’t know, a mesh is a series of points that form
triangles that make up your object). By forming a mesh, most
computer programming languages can do simple calculations to
figure out the surface area of each piece. Also, you can use simple
loops to add any other variables you may need to the mesh.
Now, after you form the mesh of your object, you need to
find 4 things per piece in order to make it explode accurately. They
are mass, surface area, bind force and shatter force.
The bind force and shatter force are forces that you’ll have to
use a random variable for, because the real values for these are not
easy to calculate or find (to be honest, I didn’t find anything on
these, so I’m using variable ranges that I have seen studying
explosions). Anyways, the ranges have to be made such that the
piece will normally break before it will shatter, meaning that the
ranges will end up being like so:
Piece Shatters
Bind breaks
If you remember from earlier, I showed that the ideal gas law
stated that:
PV/nT = PV/nt = R
1 2
For this equation, I am going to use 1 for the pressure initial
(Pi) and 2 for the pressure at time t (Pt) (to help prevent confusion,
I will keep things with 2 letters meaning one thing in parenthesis).
Now, for most explosions, I am going to assume that the
volume and temperature are going to remain the same throughout
the building up of pressure, so therefore, I can multiply all
equations by T/V to get:
(Pi)/(n1) = (Pt)/(n2) = RT/V
Also, as was mentioned earlier, most explosions start out
with the pressure inside the container equaling the pressure outside
the container, or 101300 Pascal. And since Pt is just Pi plus the
change in pressure:
101300/(n1) = (101300 + ΔP)/(n2) = RT/V
n1 stands for the moles initial. n2 is n1 plus the change in
moles. Now, through some basic manipulation of variables, I get
that:
n1 = 101300V/RT
As such:
n2 = 101300V/RT + Δn
Now just plug this into my the second equality in the earlier
equation and I get:
(101300 + ΔP)/(101300V/RT + Δn) = RT/V
Through a lot of multiplication to get rid of the fractions, I
get:
V(101300 + ΔP) = RT(101300V/RT + Δn)
101300V + ΔP = 101300V + RTΔn
Remove 101300V from both sides and you get:
ΔP = RTΔn/V
Or since I like putting the constants all together:
ΔP = (RT/V) Δn
Finally, since you have the rate of mole increase (or will
make one up), which is r = Δn/t, you can move that around to get
Δn = rt. Substitute that in to get the first part of the equation:
ΔP = rt(RT/V)
From this, you should be able to see that there are a few
points where a piece will shatter before the bonds break, but the
distribution of these points depends on what values you put in for
your ranges, and how you want the explosion to turn out. If you
want large pieces, keep your ranges higher up. If you want small
fragments, reduce the ranges.
For the most part, you can figure out what pieces are
separated now using a simple ‘for’ loop. Be sure that if some
triangles don’t separate after everything is calculated, that you
count them as 1 piece and as such, add their surface areas and
masses for calculating their velocities.
After each piece has been separated, you’ll then need to
calculate the velocity of each piece. This can be done using this
equation:
Vf = (At/m) ((r+RT)/V + 101300)
where the velocity is directed towards the vector formed by the
line formed by the center of the piece and the center of the pressure
reaction.
After that, the pieces are left to projectile motion. Have fun,
and go make some explosions!