{"id":31242,"date":"2017-07-07T03:01:44","date_gmt":"2017-07-06T17:01:44","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=31242"},"modified":"2017-08-05T11:53:09","modified_gmt":"2017-08-05T01:53:09","slug":"ideal-gas-law-calculator-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/ideal-gas-law-calculator-primer-tutorial\/","title":{"rendered":"Ideal Gas Law Calculator Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ideal_gas_law.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Ideal Gas Law Calculator Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ideal_gas_law.jpg\" title=\"Ideal Gas Law Calculator Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Ideal Gas Law Calculator Primer Tutorial<\/p><\/div>\n<p>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 &#8230;<\/p>\n<ul>\n<li>solid<\/li>\n<li>liquid<\/li>\n<li>gas<\/li>\n<\/ul>\n<p> &#8230; and have worked the equations related to the Ideal Gas Law to do with describing qualities of matter in that last state <strike><font size=1>&#8230; the state of wow?! &#8230; no Nala &#8230; not even the state of bow wow &#8230; boom boom &#8230;<\/font><\/strike> &#8230; gas.<\/p>\n<p>Basically one equation of the Ideal Gas Law, about which we&#8217;d like to direct you to two great helping resources today, those being &#8230;<\/p>\n<ul>\n<li><a target=_blank title='http:\/\/www.molecularsoft.com\/help\/Gas_Laws-Ideal_Gas_with_Density.htm' href='http:\/\/www.molecularsoft.com\/help\/Gas_Laws-Ideal_Gas_with_Density.htm'>Ideal Gas Law with Density<\/a> &#8230; for the Chemistry &#8230; and explanation of equations below &#8230;<\/li>\n<li><a target=_blank title='http:\/\/www.bmrb.wisc.edu\/metabolomics\/' href='http:\/\/www.bmrb.wisc.edu\/metabolomics\/'>Biological Magnetic Resonance Data Bank<\/a> &#8230; our &#8220;onboard&#8221; calculator of Molecular Weight, which, if we are to be straightforward here, is the bulk of the &#8220;work&#8221; &#8230; so, thanks again<\/li>\n<p> &#8230; states &#8230;<\/p>\n<p><code><br \/>\nPV = nRT<br \/>\n<\/code><\/p>\n<p> &#8230; leading to &#8230;<\/p>\n<blockquote cite='http:\/\/www.molecularsoft.com\/help\/Gas_Laws-Ideal_Gas_with_Density.htm'><p>\nn = m\/MW and d = m\/V<br \/>\n<br \/>\nWhere:<br \/>\n    P &#8211; pressure<br \/>\n    V &#8211; volume<br \/>\n    n &#8211; number of moles<br \/>\n    T &#8211; temperature<br \/>\n    m &#8211; mass<br \/>\n    d &#8211; dendity<br \/>\n    MW &#8211; Molecular Weight<br \/>\n    R &#8211; 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.<br \/>\n<br \/>\nThe density (d) of a gas is defined as<br \/>\n d = m \/ V<br \/>\n<br \/>\nand the moles of a gas is:<br \/>\n n = m \/ MW<br \/>\n<br \/>\nWhere<br \/>\n m is the mass of the gas, and<br \/>\n MW is the molecular weight.<br \/>\n<br \/>\nSubstituting the definitions to the original Ideal Gas equation, it becomes:<br \/>\n d = P x MW \/ (R x T)<br \/>\n<br \/>\nWhen any three of the four quantities in the equation are known, the forth can be calculated. For example, we&#8217;ve known d, P and T, M can be:<br \/>\n MW = d x R x T \/ P\n<\/p><\/blockquote>\n<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 <a target=_blank title='http:\/\/www.bmrb.wisc.edu\/metabolomics\/' href='http:\/\/www.bmrb.wisc.edu\/metabolomics\/'>Biological Magnetic Resonance Data Bank<\/a> calculate the Molecular Weight of your gas, for you.  Along the way we need to call on some PHP you could call <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ideal_gas_law.php_GETME' title='ideal_gas_law.php'>ideal_gas_law.php<\/a>, with its (beloved for us) <a target=_blank title='PHP file_get_contents() method information' href='http:\/\/php.net\/manual\/en\/function.file-get-contents.php'>file_get_contents()<\/a> methodologies.<\/p>\n<p>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 <b>K<\/b>elvin for Temperature, perhaps?<\/p>\n<p>Here is a link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ideal_gas_law.html_GETME' title='ideal_gas_law.html'>ideal_gas_law.html<\/a> that you could try for yourself at this <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ideal_gas_law.html' title='Click picture'>live run<\/a> link.<\/p>\n<p>We will show you a link to a previous &#8220;Chemical Formula&#8221; game we created at <a title='HTML\/Javascript Chemical Formulae Game Tutorial' href='#html\/jcfgt'>HTML\/Javascript Chemical Formulae Game Tutorial<\/a> as shown below.<\/p>\n<hr>\n<p id='html\/jcfgt'>Previous relevant <a target=_blank title='HTML\/Javascript Chemical Formulae Game Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-chemical-formulae-game-tutorial\/'>HTML\/Javascript Chemical Formulae Game Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/chemicalformulae_chalkboard.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Chemical Formulae Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/ChemicalFormula.jpg\" title=\"HTML\/Javascript Chemical Formulae Game Tutorial\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Chemical Formulae Game Tutorial<\/p><\/div>\n<p>Here is a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/chemicalformulae_chalkboard.html\" title='HTML\/Javascript Chemical Formulae Tutorial'>tutorial<\/a> showing some client-side basics in HTML and Javascript that test your chemistry knowledge by piecing together chemical formula &#8220;sentences&#8221;, by filling in a missing bit of information in a three-part &#8220;chemical formula sentence&#8221;, and today we use an HTML5 canvas element in our methodology.   The inspiration for this came from the tutorial <a target=_blank title='Chemical Formulae' href='http:\/\/www.elementalmatter.info\/chemical-formula-and-equations.htm'>here<\/a> (thanks for the great list), and we invite you to play with another player, and add your own, maybe while they aren&#8217;t looking?!  (Hint: Try the middle Dot).<\/p>\n<p>This HTML\/Javascript solution uses three HTML select tags, one incomplete, to piece together a &#8220;chemical formula sentence&#8221; to score points in our chemical game.<\/p>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/chemicalformulae_chalkboard.html_GETME' title='chemicalformulae_chalkboard.html'>chemicalformulae_chalkboard.html<\/a> (please note that some of the utf-8 characters may be better seen with View-&gt;Page Source).<\/p>\n<p>Hope you add to your ideas from today&#8217;s tutorial.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d8818' onclick='var dv=document.getElementById(\"d8818\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=canvas\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d8818' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d31242' onclick='var dv=document.getElementById(\"d31242\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/chemistry\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d31242' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230; solid liquid gas &#8230; and have worked the equations related to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/ideal-gas-law-calculator-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[2251,203,1923,576,2252,652,932,997,1100,2005,1319],"class_list":["post-31242","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-calculator","tag-chemistry","tag-density","tag-html","tag-ideal-gas-law","tag-javascript","tag-php","tag-programming","tag-science","tag-tool","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31242"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=31242"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31242\/revisions"}],"predecessor-version":[{"id":31250,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31242\/revisions\/31250"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=31242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=31242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=31242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}