We never did chemistry at school, but a lot of you out there will have, and you will probably know a lot about the three states of matter …
- solid
- liquid
- gas
… and have worked the equations related to the Ideal Gas Law to do with describing qualities of matter in that last state … the state of wow?! … no Nala … not even the state of bow wow … boom boom … … gas.
Basically one equation of the Ideal Gas Law, about which we’d like to direct you to two great helping resources today, those being …
- Ideal Gas Law with Density … for the Chemistry … and explanation of equations below …
- Biological Magnetic Resonance Data Bank … our “onboard” calculator of Molecular Weight, which, if we are to be straightforward here, is the bulk of the “work” … so, thanks again
… states …
PV = nRT
… leading to …
n = m/MW and d = m/V
Where:
P – pressure
V – volume
n – number of moles
T – temperature
m – mass
d – dendity
MW – Molecular Weight
R – ideal gas constant. If the units of P, V, n and T are atm, L, mol and K, respectively, the value of R is 0.0821 L x atm/K x mol or 8.314 J/K x mol.
The density (d) of a gas is defined as
d = m / V
and the moles of a gas is:
n = m / MW
Where
m is the mass of the gas, and
MW is the molecular weight.
Substituting the definitions to the original Ideal Gas equation, it becomes:
d = P x MW / (R x T)
When any three of the four quantities in the equation are known, the forth can be calculated. For example, we’ve known d, P and T, M can be:
MW = d x R x T / P
The way the web application we have for the Ideal Gas Law works is that when defining the Molecular Weight, if you do, you can alternatively enter in a chemical formula and have the brilliant Biological Magnetic Resonance Data Bank calculate the Molecular Weight of your gas, for you. Along the way we need to call on some PHP you could call ideal_gas_law.php, with its (beloved for us) file_get_contents() methodologies.
So, on this first draft of the Ideal Gas Law tool we have assumed the most often used units, but the units you use in the real world, of course, could be very different, such as Kelvin for Temperature, perhaps?
Here is a link to some downloadable HTML programming code … rename to ideal_gas_law.html that you could try for yourself at this live run link.
We will show you a link to a previous “Chemical Formula” game we created at HTML/Javascript Chemical Formulae Game Tutorial as shown below.
Previous relevant HTML/Javascript Chemical Formulae Game Tutorial is shown below.
Here is a tutorial showing some client-side basics in HTML and Javascript that test your chemistry knowledge by piecing together chemical formula “sentences”, by filling in a missing bit of information in a three-part “chemical formula sentence”, and today we use an HTML5 canvas element in our methodology. The inspiration for this came from the tutorial here (thanks for the great list), and we invite you to play with another player, and add your own, maybe while they aren’t looking?! (Hint: Try the middle Dot).
This HTML/Javascript solution uses three HTML select tags, one incomplete, to piece together a “chemical formula sentence” to score points in our chemical game.
Link to some downloadable HTML programming code … rename to chemicalformulae_chalkboard.html (please note that some of the utf-8 characters may be better seen with View->Page Source).
Hope you add to your ideas from today’s tutorial.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.