{"id":490,"date":"2014-01-12T23:53:22","date_gmt":"2014-01-12T22:53:22","guid":{"rendered":"http:\/\/antonpotocnik.com\/?p=490"},"modified":"2014-01-13T00:39:12","modified_gmt":"2014-01-12T23:39:12","slug":"energy-units-calculator","status":"publish","type":"post","link":"https:\/\/antonpotocnik.com\/?p=490","title":{"rendered":"Energy Units Calculator"},"content":{"rendered":"<p>Enter energy value in the appropriate input box and press enter, tab, or click outside of the input box.<br \/>\n<FORM NAME=\"Hartree\" METHOD=POST><\/p>\n<table border=\"0\">\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"J\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> J<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"eV\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> eV<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"K\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> K<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"Hz\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> GHz<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"cm-1\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> cm<sup>-1<\/sup><\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"H\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> Ha (Hartree)<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"Ry\" VALUE=1 onChange=\"myFunction(this.form,this.name)\"> Ry (Rydberg)<\/td>\n<\/tr>\n<tr>\n<td><INPUT TYPE=\"text\" NAME=\"B\" VALUE=0 onChange=\"myFunction(this.form,this.name)\"> Boltzman population ratio at 298.15K<\/td>\n<\/tr>\n<\/table>\n<p><\/FORM><\/p>\n<p><font size=\"2\" >Adapted from <A HREF=\"http:\/\/www.colby.edu\/chemistry\/PChem\/Hartree.html\">http:\/\/www.colby.edu\/chemistry\/PChem\/Hartree.html<\/A><\/font>.<\/p>\n<p><script>\nfunction myFunction(form,field)\n{\n    var energy = 0.000;\n    var idx = -1;\n    var c = 299792458;        \/\/ m\/s\n    var h = 6.6261E-34;       \/\/ Js\n    var e0 = 1.602176565E-19; \/\/ As \n    var kB = 1.3807E-23;      \/\/ J\/K\n    var hart = 4.359743E-18;  \/\/ J \n    var nfields = 7;\n    var conv = new Array();\n    conv[0] = 1.000;             \/\/ J\n    conv[1] = 1.0\/e0;            \/\/ eV\n    conv[2] = 1.0\/kB;            \/\/ K\n    conv[3] = 1.0E-9\/h;          \/\/ GHz\n    conv[4] = 1.0E-2\/h\/c;        \/\/ cm-1\n    conv[5] = 1.0\/hart;          \/\/ Ha\n    conv[6] = conv[1]\/13.605693; \/\/ Ry\n    conv[7] = -conv[2];          \/\/ Boltzmann\n   \/\/ find field index\n   for (var i=0; i<=nfields; i++) {\n       if ( form.elements[i].name == field ) {\n           idx = i;\n           break;\n       }\n   }\n   \/\/ calculate the base energy in Hartrees\n   if ( idx != 7) {\n      energy = form.elements[idx].value\/conv[idx];\n   } else {\n      energy = Math.log(form.elements[idx].value)*298.15\/conv[idx];\n   }\n   \/\/ convert to other units\n   for (var i=0; i<=nfields; i++) {\n\t  var res = 0;\n      if ( i != idx ) {\n         if ( i != 7) res = energy*conv[i];\n         else         res = Math.exp(energy*conv[i]\/298.15);\n\t form.elements[i].value = res.toPrecision(6); \n       }\n    }\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enter energy value in the appropriate input box and press enter, tab, or click outside of the input box. J eV K GHz cm-1 Ha (Hartree) Ry (Rydberg) Boltzman population ratio at 298.15K Adapted from http:\/\/www.colby.edu\/chemistry\/PChem\/Hartree.html.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18],"tags":[19],"class_list":["post-490","post","type-post","status-publish","format-standard","hentry","category-software","tag-tools"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3Hjcy-7U","_links":{"self":[{"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=490"}],"version-history":[{"count":26,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=\/wp\/v2\/posts\/490\/revisions\/495"}],"wp:attachment":[{"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/antonpotocnik.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}