JavaScript化原实验数据处理程序

来源:互联网 发布:四川广电网络资费 编辑:程序博客网 时间:2024/05/01 18:56

      前段时间做了化原实验,得到一大堆数据,看着那么多数据,本来是想用Excel和matlab处理的,但现在在学JavaScript,就突然有了一个用它做个数据处理程序的想法,做完后测试了一下,还好能用,呵呵!

<html>
<head>
<title>离心泵的性能实验计算器</title>
<style type="text/css">
.firedragon{
      background-color:yellow;
      }
pre{
      background-color:maroon;
      margin-left: 550px;
    margin-top: 10px;
    margin-right: 550px;
    margin-bottom: 10px;
    }
div{
      margin-left: 580px;
    margin-top: 10px;
    margin-right: 580px;
    margin-bottom: 10px;

    }
</style>
</head>
<body bgcolor="green">
<center>
<h1><font color="red" face="黑体">为处理离心泵的性能实验数据而制作的计算器
</font>
</h1>
</center>
有建议请<a href="mailto:plj450294634@126.com">联系作者</a><br><br>
<form name="formN" title="火龙制作 QQ:450294634">
<fieldset class="firedragon">
<legend align="center">
<font color="red"><b>
请输入您的实验数据:
</b>
</font>
</legend><br>
流量Q:
<input type="text" name="Q" size="10" maxlength="10">l/h

出 口压力H<sub><small>压力表</small></sub>:<input type="H2" id="H2" name="ckyl" size="10" maxlength="10">m<sub><small>水柱</small></sub>
入口压力H<sub><small>真空表</small></sub>:
<input type="H1" id="H1"name="rkyl" size="10" maxlength="10">m<sub><small>水柱</small></sub>
电 机功率N<sub><small>电</small></sub>:<input type="Ndian" name="djgl" id="Ndian" value="" size="10" maxlength="10">KW</sup>
孔板压降p:
<input type="text" name="kbyj" size="10" maxlength="10">KPa
</fieldset><br>

<fieldset class="firedragon">
<legend align="center"><font color="red"><b>泵的扬程He:</b></font></legend>
<br> 泵的扬程He为:<input type="text" name="bdyc" size="10" maxlength="10">m <input type="button" value="结果" onclick="He(rkyl.value,ckyl.value);">
</fieldset><br>

<fieldset class="firedragon" id="zhou">
<legend align="center"><font color="red"><b>泵的轴功率N:</b></font></legend>
<br> 泵的轴功率N为:<input type="text" name="bdzgl" size="10" maxlength="10">KW <input type="button" value="结果" onclick="N(djgl.value);">
</fieldset><br>

<fieldset class="firedragon">
<legend align="center"><font color="red"><b>泵的效率n:</b></font></legend>
<br> 泵的效率n为:<input type="text" name="bdxl" size="10" maxlength="10">% <input type="button" value="结果" onclick="n(Q.value,bdyc.value,bdzgl.value);">
</fieldset><br>

<fieldset class="firedragon">
<legend align="center"><font color="red"><b>孔流系数
Co:</b></font></legend>
<br>孔流系数
Co 为:<input type="text" name="klxs" size="10" maxlength="10"> <input type="button" value="结果" onclick="Co(Q.value,kbyj.value);">
</fieldset>
</form>

<script language="javascript" type="text/javascript">
<!--
    function He(H1,H2)
        {
          He = H2*1-H1*1+0.14;
          document.formN.bdyc.value = He;
          document.formN.bdyc.focus;
          return He;
        }

    function N(Ndian)
        {
          N = Ndian*0.9*1.0;
          document.formN.bdzgl.value = N;
          document.formN.bdzgl.focus;
          return N;
        }

    function n(Q,He,N)
        {
          n = (Q/3600000*He*1000*9.81)/N/1000*100;
          document.formN.bdzgl.value = N;
          document.formN.bdyc.value = He;
          document.formN.bdxl.value = n;
          document.formN.bdxl.focus;
          return n;
        }
    function Co(Q,_p)
        {
          Co=Q/[1246.898124209789*Math.sqrt(2*(_p))];
          document.formN.kbyj.value = _p;
          document.formN.klxs.value = Co;
          document.formN.klxs.focus;
          return Co;
        }
    function reset()
        {
          document.formN.Q.value = "";
          document.formN.rkyl.value = "";
          document.formN.ckyl.value = "";
          document.formN.djgl.value = "";
          document.formN.bdyc.value = "";
          document.formN.bdzgl.value = "";
          document.formN.bdxl.value = "";
          document.formN.klxs.value = "";
          document.formN.kbyj.value = "";
          }
-->
</script>
<div><input type="button" value="全部重置" onclick="reset()"></div>
<center><pre>
2009年10月28日制作
版权所有,违者必究</pre>
copyright©
firedragon
</center>
</body>
</html>

原创粉丝点击