Chemistry 版 (精华区)

发信人: zjliu (秋天的萝卜), 信区: Chemistry
标  题: [转载]化学程序——计算气体反应化学平衡
发信站: BBS 哈工大紫丁香站 (Fri Sep 17 09:20:40 2004)

发信站: 日月光华 

有兴趣的同学可以用 FrontPage 来看VB源代码。

<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Chemical Balance of Gases</title>
</head>

<body>

<h1 align="center"><script language="VBScript"><!--
R0=8.31441
T0=298.15
DH=0
DH=0
DS=0
DG=0
AMol=0
BMol=0
CMol=0
DMol=0
EMol=0
FMol=0
A0V=0
B0V=0
C0V=0
D0V=0
E0V=0
F0V=0
A0P=0
B0P=0
C0P=0
D0P=0
E0P=0
F0P=0
AV=0
BV=0
BV=0
CV=0
DV=0
EV=0
FV=0
AP=0
BP=0
CP=0
DP=0
EP=0
FP=0
XX=0
P0=101325
V0=0.024465
LogK=0
LogQ=0

sub Gas_Constant_onChange
  Reaction.Gas_Constant.value=R0/Reaction.R_Unit.value
  MsgBox "Access Denied"
end sub

sub R_Unit_onChange
sub R_Unit_onChange
  Reaction.Gas_Constant.value=R0/Reaction.R_Unit.value
end sub

sub Temperature_onChange
  T0=Reaction.Temperature.value*1.0+Reaction.T_Unit.value
  if Reaction.AV_Unit.value<>0 then
    Reaction.A0_Volume.value=A0V/Reaction.AV_Unit.value*R0*T0/P0
  end if
  if Reaction.BV_Unit.value<>0 then
    Reaction.B0_Volume.value=B0V/Reaction.BV_Unit.value*R0*T0/P0
  end if
  if Reaction.CV_Unit.value<>0 then
    Reaction.C0_Volume.value=C0V/Reaction.CV_Unit.value*R0*T0/P0
  end if
  if Reaction.DV_Unit.value<>0 then
    Reaction.D0_Volume.value=D0V/Reaction.DV_Unit.value*R0*T0/P0
  end if
  if Reaction.EV_Unit.value<>0 then
    Reaction.E0_Volume.value=E0V/Reaction.EV_Unit.value*R0*T0/P0
  end if
  if Reaction.FV_Unit.value<>0 then
    Reaction.F0_Volume.value=F0V/Reaction.FV_Unit.value*R0*T0/P0
    Reaction.F0_Volume.value=F0V/Reaction.FV_Unit.value*R0*T0/P0
  end if
  if Reaction.AP_Unit.value<>0 then
    Reaction.A0_Pressure.value=A0P/Reaction.AP_Unit.value*R0*T0/V0
  end if
  if Reaction.BP_Unit.value<>0 then
    Reaction.B0_Pressure.value=B0P/Reaction.BP_Unit.value*R0*T0/V0
  end if
  if Reaction.CP_Unit.value<>0 then
    Reaction.C0_Pressure.value=C0P/Reaction.CP_Unit.value*R0*T0/V0
  end if
  if Reaction.DP_Unit.value<>0 then
    Reaction.D0_Pressure.value=D0P/Reaction.DP_Unit.value*R0*T0/V0
  end if
  if Reaction.EP_Unit.value<>0 then
    Reaction.E0_Pressure.value=E0P/Reaction.EP_Unit.value*R0*T0/V0
  end if
  if Reaction.FP_Unit.value<>0 then
    Reaction.F0_Pressure.value=F0P/Reaction.FP_Unit.value*R0*T0/V0
  end if
  Calc
  Calc_Total
end sub
end sub

sub T_Unit_onChange
  Reaction.Temperature.value=T0-Reaction.T_Unit.value
end sub

sub A_Name_onChange
  Reaction.A_Name_Volume.value=Reaction.A_Name.value
  Reaction.A_Name_Pressure.value=Reaction.A_Name.value
end sub

sub B_Name_onChange
  Reaction.B_Name_Volume.value=Reaction.B_Name.value
  Reaction.B_Name_Pressure.value=Reaction.B_Name.value
end sub

sub C_Name_onChange
  Reaction.C_Name_Volume.value=Reaction.C_Name.value
  Reaction.C_Name_Pressure.value=Reaction.C_Name.value
end sub

sub D_Name_onChange
  Reaction.D_Name_Volume.value=Reaction.D_Name.value
  Reaction.D_Name_Volume.value=Reaction.D_Name.value
  Reaction.D_Name_Pressure.value=Reaction.D_Name.value
end sub

sub E_Name_onChange
  Reaction.E_Name_Volume.value=Reaction.E_Name.value
  Reaction.E_Name_Pressure.value=Reaction.E_Name.value
end sub

sub F_Name_onChange
  Reaction.F_Name_Volume.value=Reaction.F_Name.value
  Reaction.F_Name_Pressure.value=Reaction.F_Name.value
end sub

sub A_Name_Pressure_onChange
  Reaction.A_Name.value=Reaction.A_Name_Pressure.value
  Reaction.A_Name_Volume.value=Reaction.A_Name_Pressure.value
end sub

sub B_Name_Pressure_onChange
  Reaction.B_Name.value=Reaction.B_Name_Pressure.value
  Reaction.B_Name_Volume.value=Reaction.B_Name_Pressure.value
end sub
end sub

sub C_Name_Pressure_onChange
  Reaction.C_Name.value=Reaction.C_Name_Pressure.value
  Reaction.C_Name_Volume.value=Reaction.C_Name_Pressure.value
end sub

sub E_Name_Pressure_onChange
  Reaction.E_Name.value=Reaction.E_Name_Pressure.value
  Reaction.E_Name_Volume.value=Reaction.E_Name_Pressure.value
end sub

sub F_Name_Pressure_onChange
  Reaction.F_Name.value=Reaction.F_Name_Pressure.value
  Reaction.F_Name_Volume.value=Reaction.F_Name_Pressure.value
end sub

sub A_Name_Volume_onChange
  Reaction.A_Name.value=Reaction.A_Name_Volume.value
  Reaction.A_Name_Pressure.value=Reaction.A_Name_Volume.value
end sub

sub B_Name_Volume_onChange
sub B_Name_Volume_onChange
  Reaction.B_Name.value=Reaction.B_Name_Volume.value
  Reaction.B_Name_Pressure.value=Reaction.B_Name_Volume.value
end sub

sub C_Name_Volume_onChange
  Reaction.C_Name.value=Reaction.C_Name_Volume.value
  Reaction.C_Name_Pressure.value=Reaction.C_Name_Volume.value
end sub

sub D_Name_Volume_onChange
  Reaction.D_Name.value=Reaction.D_Name_Volume.value
  Reaction.D_Name_Pressure.value=Reaction.D_Name_Volume.value
end sub

sub E_Name_Volume_onChange
  Reaction.E_Name.value=Reaction.E_Name_Volume.value
  Reaction.E_Name_Pressure.value=Reaction.E_Name_Volume.value
end sub

sub F_Name_Volume_onChange
  Reaction.F_Name.value=Reaction.F_Name_Volume.value
  Reaction.F_Name_Pressure.value=Reaction.F_Name_Volume.value
  Reaction.F_Name_Pressure.value=Reaction.F_Name_Volume.value
end sub

sub A_Mol_onChange
  AMol=Reaction.A_Mol.value
  Calc
end sub

sub B_Mol_onChange
  BMol=Reaction.B_Mol.value
  Calc
end sub

sub C_Mol_onChange
  CMol=Reaction.C_Mol.value
  Calc
end sub

sub D_Mol_onChange
  DMol=Reaction.D_Mol.value
  Calc
end sub


sub E_Mol_onChange
  EMol=Reaction.E_Mol.value
  Calc
end sub

sub F_Mol_onChange
  FMol=Reaction.F_Mol.value
  Calc
end sub

sub Pressure_React_onChange
  P0=Reaction.Pressure_React.value*Reaction.Pressure_Unit.value
  if Reaction.AV_Unit.value<>0 then
    Reaction.A0_Volume.value=A0V/Reaction.AV_Unit.value*R0*T0/P0
  end if
  if Reaction.BV_Unit.value<>0 then
    Reaction.B0_Volume.value=B0V/Reaction.BV_Unit.value*R0*T0/P0
  end if
  if Reaction.CV_Unit.value<>0 then
    Reaction.C0_Volume.value=C0V/Reaction.CV_Unit.value*R0*T0/P0
  end if
  if Reaction.DV_Unit.value<>0 then
  if Reaction.DV_Unit.value<>0 then
    Reaction.D0_Volume.value=D0V/Reaction.DV_Unit.value*R0*T0/P0
  end if
  if Reaction.EV_Unit.value<>0 then
    Reaction.E0_Volume.value=E0V/Reaction.EV_Unit.value*R0*T0/P0
  end if
  if Reaction.FV_Unit.value<>0 then
    Reaction.F0_Volume.value=F0V/Reaction.FV_Unit.value*R0*T0/P0
  end if
  Calc_Total
end sub

sub Pressure_Unit_onChange
  Reaction.Pressure_React.value=P0/Reaction.Pressure_Unit.value
end sub

sub Volume_React_onChange
  V0=Reaction.Volume_React.value*Reaction.Volume_Unit.value
  if Reaction.AP_Unit.value<>0 then
    MsgBox "OK!"
    Reaction.A0_Pressure.value=A0P/Reaction.AP_Unit.value*R0*T0/V0
  end if
  if Reaction.BP_Unit.value<>0 then
  if Reaction.BP_Unit.value<>0 then
    Reaction.B0_Pressure.value=B0P/Reaction.BP_Unit.value*R0*T0/V0
  end if
  if Reaction.CP_Unit.value<>0 then
    Reaction.C0_Pressure.value=C0P/Reaction.CP_Unit.value*R0*T0/V0
  end if
  if Reaction.DP_Unit.value<>0 then
    Reaction.D0_Pressure.value=D0P/Reaction.DP_Unit.value*R0*T0/V0
  end if
  if Reaction.EP_Unit.value<>0 then
    Reaction.E0_Pressure.value=E0P/Reaction.EP_Unit.value*R0*T0/V0
  end if
  if Reaction.FP_Unit.value<>0 then
    Reaction.F0_Pressure.value=F0P/Reaction.FP_Unit.value*R0*T0/V0
  end if
  Calc_Total
end sub

sub Volume_Unit_onChange
  Reaction.Volume_React.value=V0/Reaction.Volume_Unit.value
end sub

sub A0_Volume_onChange
sub A0_Volume_onChange
  if Reaction.AV_Unit.value=0 then
    A0V=Reaction.A0_Volume.value
  else
    A0V=Reaction.A0_Volume.value*Reaction.AV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub

sub B0_Volume_onChange
  if Reaction.BV_Unit.value=0 then
    B0V=Reaction.B0_Volume.value
  else
    B0V=Reaction.B0_Volume.value*Reaction.BV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub

sub C0_Volume_onChange
  if Reaction.CV_Unit.value=0 then
    C0V=Reaction.C0_Volume.value
  else
    C0V=Reaction.C0_Volume.value*Reaction.CV_Unit.value*P0/R0/T0
    C0V=Reaction.C0_Volume.value*Reaction.CV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub

sub D0_Volume_onChange
  if Reaction.DV_Unit.value=0 then
    D0V=Reaction.D0_Volume.value
  else
    D0V=Reaction.D0_Volume.value*Reaction.DV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub

sub E0_Volume_onChange
  if Reaction.EV_Unit.value=0 then
    E0V=Reaction.E0_Volume.value
  else
    E0V=Reaction.E0_Volume.value*Reaction.EV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub


sub F0_Volume_onChange
  if Reaction.FV_Unit.value=0 then
    F0V=Reaction.F0_Volume.value
  else
    F0V=Reaction.F0_Volume.value*Reaction.FV_Unit.value*P0/R0/T0
  end if
  Calc_Total
end sub

sub A0_Pressure_onChange
  if Reaction.AP_Unit.value=0 then
    A0P=Reaction.A0_Pressure.value
  else
    A0P=Reaction.A0_Pressure.value*Reaction.AP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub

sub B0_Pressure_onChange
  if Reaction.BP_Unit.value=0 then
    B0P=Reaction.B0_Pressure.value
  else
  else
    B0P=Reaction.B0_Pressure.value*Reaction.BP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub

sub C0_Pressure_onChange
  if Reaction.CP_Unit.value=0 then
    C0P=Reaction.C0_Pressure.value
  else
    C0P=Reaction.C0_Pressure.value*Reaction.CP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub

sub D0_Pressure_onChange
  if Reaction.DP_Unit.value=0 then
    D0P=Reaction.D0_Pressure.value
  else
    D0P=Reaction.D0_Pressure.value*Reaction.DP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub
end sub

sub E0_Pressure_onChange
  if Reaction.EP_Unit.value=0 then
    E0P=Reaction.E0_Pressure.value
  else
    E0P=Reaction.E0_Pressure.value*Reaction.EP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub

sub F0_Pressure_onChange
  if Reaction.FP_Unit.value=0 then
    F0P=Reaction.F0_Pressure.value
  else
    F0P=Reaction.F0_Pressure.value*Reaction.FP_Unit.value*V0/R0/T0
  end if
  Calc_Total
end sub

sub AV_Unit_onChange
  if Reaction.AV_Unit.value=0 then
    Reaction.A0_Volume.value=A0V
    Reaction.A0_Volume.value=A0V
    Reaction.A_Volume.value=AV
  else
    Reaction.A0_Volume.value=A0V/Reaction.AV_Unit.value*R0*T0/P0
    Reaction.A_Volume.value=AV/Reaction.AV_Unit.value*R0*T0/P0
  end if
end sub

sub BV_Unit_onChange
  if Reaction.BV_Unit.value=0 then
    Reaction.B0_Volume.value=B0V
    Reaction.B_Volume.value=BV
  else
    Reaction.B0_Volume.value=B0V/Reaction.BV_Unit.value*R0*T0/P0
    Reaction.B_Volume.value=BV/Reaction.BV_Unit.value*R0*T0/P0
  end if
end sub

sub CV_Unit_onChange
  if Reaction.CV_Unit.value=0 then
    Reaction.C0_Volume.value=C0V
    Reaction.C_Volume.value=CV
  else
  else
    Reaction.C0_Volume.value=C0V/Reaction.CV_Unit.value*R0*T0/P0
    Reaction.C_Volume.value=CV/Reaction.CV_Unit.value*R0*T0/P0
  end if
end sub

sub DV_Unit_onChange
  if Reaction.DV_Unit.value=0 then
    Reaction.D0_Volume.value=D0V
    Reaction.D_Volume.value=DV
  else
    Reaction.D0_Volume.value=D0V/Reaction.DV_Unit.value*R0*T0/P0
    Reaction.D_Volume.value=DV/Reaction.DV_Unit.value*R0*T0/P0
  end if
end sub

sub EV_Unit_onChange
  if Reaction.EV_Unit.value=0 then
    Reaction.E0_Volume.value=E0V
    Reaction.E_Volume.value=EV
  else
    Reaction.E0_Volume.value=E0V/Reaction.EV_Unit.value*R0*T0/P0
    Reaction.E_Volume.value=EV/Reaction.EV_Unit.value*R0*T0/P0
    Reaction.E_Volume.value=EV/Reaction.EV_Unit.value*R0*T0/P0
  end if
end sub

sub FV_Unit_onChange
  if Reaction.FV_Unit.value=0 then
    Reaction.F0_Volume.value=F0V
    Reaction.F_Volume.value=FV
  else
    Reaction.F0_Volume.value=F0V/Reaction.FV_Unit.value*R0*T0/P0
    Reaction.F_Volume.value=FV/Reaction.FV_Unit.value*R0*T0/P0
  end if
end sub

sub AP_Unit_onChange
  if Reaction.AP_Unit.value=0 then
    Reaction.A0_Pressure.value=A0P
    Reaction.A_Pressure.value=AP
  else
    Reaction.A0_Pressure.value=A0P/Reaction.AP_Unit.value*R0*T0/V0
    Reaction.A_Pressure.value=AP/Reaction.AP_Unit.value*R0*T0/V0
  end if
end sub
end sub

sub BP_Unit_onChange
  if Reaction.BP_Unit.value=0 then
    Reaction.B0_Pressure.value=B0P
    Reaction.B_Pressure.value=BP
  else
    Reaction.B0_Pressure.value=B0P/Reaction.BP_Unit.value*R0*T0/V0
    Reaction.B_Pressure.value=BP/Reaction.BP_Unit.value*R0*T0/V0
  end if
end sub

sub CP_Unit_onChange
  if Reaction.CP_Unit.value=0 then
    Reaction.C0_Pressure.value=C0P
    Reaction.C_Pressure.value=CP
  else
    Reaction.C0_Pressure.value=C0P/Reaction.CP_Unit.value*R0*T0/V0
    Reaction.C_Pressure.value=CP/Reaction.CP_Unit.value*R0*T0/V0
  end if
end sub

sub DP_Unit_onChange
sub DP_Unit_onChange
  if Reaction.DP_Unit.value=0 then
    Reaction.D0_Pressure.value=D0P
    Reaction.D_Pressure.value=DP
  else
    Reaction.D0_Pressure.value=D0P/Reaction.DP_Unit.value*R0*T0/V0
    Reaction.D_Pressure.value=DP/Reaction.DP_Unit.value*R0*T0/V0
  end if
end sub

sub EP_Unit_onChange
  if Reaction.EP_Unit.value=0 then
    Reaction.E0_Pressure.value=E0P
    Reaction.E_Pressure.value=EP
  else
    Reaction.E0_Pressure.value=E0P/Reaction.EP_Unit.value*R0*T0/V0
    Reaction.E_Pressure.value=EP/Reaction.EP_Unit.value*R0*T0/V0
  end if
end sub

sub FP_Unit_onChange
  if Reaction.FP_Unit.value=0 then
    Reaction.F0_Pressure.value=F0P
    Reaction.F0_Pressure.value=F0P
    Reaction.F_Pressure.value=FP
  else
    Reaction.F0_Pressure.value=F0P/Reaction.FP_Unit.value*R0*T0/V0
    Reaction.F_Pressure.value=FP/Reaction.FP_Unit.value*R0*T0/V0
  end if
end sub

sub K_onChange
  LogK=log(Reaction.K.value)
  Reaction.pK.value=-LogK/Log(10)
  MsgBox "Balance Constant is now independent to Free Energy."
end sub

sub pK_onChange
  LogK=-Reaction.pK.value*Log(10)
  Reaction.K.value=exp(LogK)
  MsgBox "Balance Constant is now independent to Free Energy."
end sub

sub H_Mol_onChange
  MsgBox "Access Denied!"
  Reaction.H_Mol.value=DH
  Reaction.H_Mol.value=DH
end sub

sub S_Mol_onChange
  MsgBox "Access Denied!"
  Reaction.S_Mol.value=DS
end sub

sub G_Mol_onChange
  MsgBox "Access Denied!"
  Reaction.G_Mol.value=DG
end sub

sub Reaction_Mol_onChange
  MsgBox "Access Denied!"
  Reaction.Reaction_Mol.value=XX
end sub

sub H_Reaction_onChange
  MsgBox "Access Denied!"
  Reaction.H_Reaction.value=XX*DH
end sub


sub S_Reaction_onChange
  MsgBox "Access Denied!"
  Reaction.S_Reaction.value=XX*DS
end sub

sub G_Reaction_onChange
  MsgBox "Access Denied!"
  Reaction.G_Reaction.value=XX*DG
end sub

sub A_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.AV_Unit.value=0 then
    Reaction.A_Volume.value=AV
  else
    Reaction.A_Volume.value=AV/Reaction.AV_Unit.value*R0*T0/P0
  end if
end sub

sub B_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.BV_Unit.value=0 then
  if Reaction.BV_Unit.value=0 then
    Reaction.B_Volume.value=BV
  else
    Reaction.B_Volume.value=BV/Reaction.BV_Unit.value*R0*T0/P0
  end if
end sub

sub C_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.CV_Unit.value=0 then
    Reaction.C_Volume.value=CV
  else
    Reaction.C_Volume.value=CV/Reaction.CV_Unit.value*R0*T0/P0
  end if
end sub

sub D_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.DV_Unit.value=0 then
    Reaction.D_Volume.value=DV
  else
    Reaction.D_Volume.value=DV/Reaction.DV_Unit.value*R0*T0/P0
  end if
  end if
end sub

sub E_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.EV_Unit.value=0 then
    Reaction.E_Volume.value=EV
  else
    Reaction.E_Volume.value=EV/Reaction.EV_Unit.value*R0*T0/P0
  end if
end sub

sub F_Volume_onChange
  MsgBox "Access Denied!"
  if Reaction.FV_Unit.value=0 then
    Reaction.F_Volume.value=FV
  else
    Reaction.F_Volume.value=FV/Reaction.FV_Unit.value*R0*T0/P0
  end if
end sub

sub A_Pressure_onChange
  MsgBox "Access Denied!"
  MsgBox "Access Denied!"
  if Reaction.AP_Unit.value=0 then
    Reaction.A_Pressure.value=AP
  else
    Reaction.A_Pressure.value=AP/Reaction.AP_Unit.value*R0*T0/V0
  end if
end sub

sub B_Pressure_onChange
  MsgBox "Access Denied!"
  if Reaction.BP_Unit.value=0 then
    Reaction.B_Pressure.value=BP
  else
    Reaction.B_Pressure.value=BP/Reaction.BP_Unit.value*R0*T0/V0
  end if
end sub

sub C_Pressure_onChange
  MsgBox "Access Denied!"
  if Reaction.CP_Unit.value=0 then
    Reaction.C_Pressure.value=CP
  else
    Reaction.C_Pressure.value=CP/Reaction.CP_Unit.value*R0*T0/V0
    Reaction.C_Pressure.value=CP/Reaction.CP_Unit.value*R0*T0/V0
  end if
end sub

sub D_Pressure_onChange
  MsgBox "Access Denied!"
  if Reaction.DP_Unit.value=0 then
    Reaction.D_Pressure.value=DP
  else
    Reaction.D_Pressure.value=DP/Reaction.DP_Unit.value*R0*T0/V0
  end if
end sub

sub E_Pressure_onChange
  MsgBox "Access Denied!"
  if Reaction.EP_Unit.value=0 then
    Reaction.E_Pressure.value=EP
  else
    Reaction.E_Pressure.value=EP/Reaction.EP_Unit.value*R0*T0/V0
  end if
end sub

sub F_Pressure_onChange
sub F_Pressure_onChange
  MsgBox "Access Denied!"
  if Reaction.FP_Unit.value=0 then
    Reaction.F_Pressure.value=FP
  else
    Reaction.F_Pressure.value=FP/Reaction.FP_Unit.value*R0*T0/V0
  end if
end sub

sub Calc

DH=DMol*Reaction.D_Hf.value+EMol*Reaction.E_Hf.value+FMol*Reaction.F_Hf.value



DH=DH-AMol*Reaction.A_Hf.value-BMol*Reaction.B_Hf.value-CMol*Reaction.C_Hf.va

lue
  Reaction.H_Mol.value=DH
  DS=DMol*Reaction.D_S.value+EMol*Reaction.E_S.value+FMol*Reaction.F_S.value

DS=DS-AMol*Reaction.A_S.value-BMol*Reaction.B_S.value-CMol*Reaction.C_S.value


  Reaction.S_Mol.value=DS
  DG=DH-T0*DS/1000
  DG=DH-T0*DS/1000
  Reaction.G_Mol.value=DG
  LogK=-DG*1000/R0/T0
  Reaction.K.value=exp(LogK)
  Reaction.pK.value=-LogK/log(10)
end sub

sub Calc_Total
  T0V=0
  TV=0
  T0P=0
  TP=0
  if Reaction.A_Gas.Checked then
    T0V=T0V+A0V
    TV=TV+AV
    T0P=T0P+A0P
    TP=TP+AP
  end if
  if Reaction.B_Gas.Checked then
    T0V=T0V+B0V
    TV=TV+BV
    T0P=T0P+B0P
    TP=TP+BP
    TP=TP+BP
  end if
  if Reaction.C_Gas.Checked then
    T0V=T0V+C0V
    TV=TV+CV
    T0P=T0P+C0P
    TP=TP+CP
  end if
  if Reaction.D_Gas.Checked then
    T0V=T0V+D0V
    TV=TV+DV
    T0P=T0P+D0P
    TP=TP+DP
  end if
  if Reaction.E_Gas.Checked then
    T0V=T0V+E0V
    TV=TV+EV
    T0P=T0P+E0P
    TP=TP+EP
  end if
  if Reaction.F_Gas.Checked then
    T0V=T0V+F0V
    TV=TV+FV
    TV=TV+FV
    T0P=T0P+F0P
    TP=TP+FP
  end if
  if Reaction.TV_Unit.value=0 then
    Reaction.T0_Volume.value=T0V
    Reaction.T_Volume.value=TV
  else
    Reaction.T0_Volume.value=T0V/Reaction.TV_Unit.value*R0*T0/P0
    Reaction.T_Volume.value=TV/Reaction.TV_Unit.value*R0*T0/P0
  end if
  if Reaction.TP_Unit.value=0 then
    Reaction.T0_Pressure.value=T0P
    Reaction.T_Pressure.value=TP
  else
    Reaction.T0_Pressure.value=T0P/Reaction.TP_Unit.value*R0*T0/V0
    Reaction.T_Pressure.value=TP/Reaction.TP_Unit.value*R0*T0/V0
  end if
end sub

sub LogQ_Volume
  LogQ=0
  AAV=A0V-XX*AMol
  AAV=A0V-XX*AMol
  BBV=B0V-XX*BMol
  CCV=C0V-XX*CMol
  DDV=D0V+XX*DMol
  EEV=E0V+XX*EMol
  FFV=F0V+XX*FMol
  if (AAV=0 and Reaction.A_Gas.checked) or (BBV=0 and
Reaction.B_Gas.checked) or (CCV=0 and Reaction.C_Gas.checked) then
     if (DDV=0 and Reaction.D_Gas.checked) or (EEV=0 and
Reaction.E_Gas.checked) or (FFV=0 and Reaction.F_Gas.checked) then
       LogQ=LogK
     else
       LogQ=LogK+1
     end if
  elseif (DDV=0 and Reaction.D_Gas.checked) or (EEV=0 and
Reaction.E_Gas.checked) or (FFV=0 and Reaction.F_Gas.checked) then
     if (AAV=0 and Reaction.A_Gas.checked) or (BBV=0 and
Reaction.B_Gas.checked) or (CCV=0 and Reaction.C_Gas.checked) then
       LogQ=LogK
     else
       LogQ=LogK-1
     end if
  else
  else
    TTV=0
    if Reaction.A_Gas.Checked then
      TTV=TTV+AAV
    end if
    if Reaction.B_Gas.Checked then
      TTV=TTV+BBV
    end if
    if Reaction.C_Gas.Checked then
      TTV=TTV+CCV
    end if
    if Reaction.D_Gas.Checked then
      TTV=TTV+DDV
    end if
    if Reaction.E_Gas.Checked then
      TTV=TTV+EEV
    end if
    if Reaction.F_Gas.Checked then
      TTV=TTV+FFV
    end if
    if Reaction.A_Gas.Checked then
      LogQ=LogQ-AMol*log(AAV/TTV*P0/101325)
    end if
    end if
    if Reaction.B_Gas.Checked then
      LogQ=LogQ-BMol*log(BBV/TTV*P0/101325)
    end if
    if Reaction.C_Gas.Checked then
      LogQ=LogQ-CMol*log(CCV/TTV*P0/101325)
    end if
    if Reaction.D_Gas.Checked then
      LogQ=LogQ+DMol*log(DDV/TTV*P0/101325)
    end if
    if Reaction.E_Gas.Checked then
      LogQ=LogQ+EMol*log(EEV/TTV*P0/101325)
    end if
    if Reaction.F_Gas.Checked then
      LogQ=LogQ+FMol*log(FFV/TTV*P0/101325)
    end if
  end if
end sub

sub Calc_Volume
  XX=0
  LogQ_Volume
  if LogQ<LogK then
  if LogQ<LogK then
    if AMol=0 and BMol=0 and CMol=0 then
      if DMol=0 then
        if EMol=0 then
          X=F0V/FMol
        elseif FMol=0 then
          X=E0V/EMol
        elseif E0V/EMol>F0V/FMol then
          X=F0V/FMol
        else
          X=E0V/EMol
        end if
      elseif EMol=0 then
        if DMol=0 then
          X=F0V/FMol
        elseif FMol=0 then
          X=D0V/DMol
        elseif D0V/DMol>F0V/FMol then
          X=F0V/FMol
        else
          X=D0V/DMol
        end if
      elseif FMol=0 then
      elseif FMol=0 then
        if DMol=0 then
          X=E0V/EMol
        elseif EMol=0 then
          X=D0V/DMol
        elseif D0V/DMol>E0V/EMol then
          X=E0V/EMol
        else
          X=D0V/DMol
        end if
      elseif D0V/DMol>=F0V/FMol and E0V/EMol>=F0V/FMol then
        X=F0V/FMol
      elseif D0V/DMol>=E0V/EMol and F0V/FMol>=E0V/EMol then
        X=E0V/EMol
      else
        X=D0V/DMol
      end if
    else
      if AMol=0 then
        if BMol=0 then
          X=C0V/CMol
        elseif CMol=0 then
          X=B0V/BMol
          X=B0V/BMol
        elseif B0V/BMol>C0V/CMol then
          X=C0V/CMol
        else
          X=B0V/BMol
        end if
      elseif BMol=0 then
        if AMol=0 then
          X=C0V/CMol
        elseif CMol=0 then
          X=A0V/AMol
        elseif A0V/AMol>C0V/CMol then
          X=C0V/CMol
        else
          X=A0V/AMol
        end if
      elseif CMol=0 then
        if AMol=0 then
          X=B0V/BMol
        elseif BMol=0 then
          X=A0V/AMol
        elseif A0V/AMol>B0V/BMol then
          X=B0V/BMol
          X=B0V/BMol
        else
          X=A0V/AMol
        end if
      elseif A0V/AMol>=C0V/CMol and B0V/BMol>=C0V/CMol then
        X=C0V/CMol
      elseif A0V/AMol>=B0V/BMol and C0V/CMol>=B0V/BMol then
        X=B0V/BMol
      else
        X=A0V/AMol
      end if
    end if
  else
    if DMol=0 and EMol=0 and FMol=0 then
      if AMol=0 then
        if BMol=0 then
          X=-C0V/CMol
        elseif CMol=0 then
          X=-B0V/BMol
        elseif B0V/BMol>C0V/CMol then
          X=-C0V/CMol
        else
          X=-B0V/BMol
          X=-B0V/BMol
        end if
      elseif BMol=0 then
        if AMol=0 then
          X=-C0V/CMol
        elseif CMol=0 then
          X=-A0V/AMol
        elseif A0V/AMol>C0V/CMol then
          X=-C0V/CMol
        else
          X=-A0V/AMol
        end if
      elseif CMol=0 then
        if AMol=0 then
          X=-B0V/BMol
        elseif BMol=0 then
          X=-A0V/AMol
        elseif A0V/AMol>B0V/BMol then
          X=-B0V/BMol
        else
          X=-A0V/AMol
        end if
      elseif A0V/AMol>=C0V/CMol and B0V/BMol>=C0V/CMol then
      elseif A0V/AMol>=C0V/CMol and B0V/BMol>=C0V/CMol then
        X=-C0V/CMol
      elseif A0V/AMol>=B0V/BMol and C0V/CMol>=B0V/BMol then
        X=-B0V/BMol
      else
        X=-A0V/AMol
      end if
    else
      if DMol=0 then
        if EMol=0 then
          X=-F0V/FMol
        elseif FMol=0 then
          X=-E0V/EMol
        elseif E0V/EMol>F0V/FMol then
          X=-F0V/FMol
        else
          X=-E0V/EMol
        end if
      elseif EMol=0 then
        if DMol=0 then
          X=-F0V/FMol
        elseif FMol=0 then
          X=-D0V/DMol
          X=-D0V/DMol
        elseif D0V/DMol>F0V/FMol then
          X=-F0V/FMol
        else
          X=-D0V/DMol
        end if
      elseif FMol=0 then
        if DMol=0 then
          X=-E0V/EMol
        elseif EMol=0 then
          X=-D0V/DMol
        elseif D0V/DMol>E0V/EMol then
          X=-E0V/EMol
        else
          X=-D0V/DMol
        end if
      elseif D0V/DMol>=F0V/FMol and E0V/EMol>=F0V/FMol then
        X=-F0V/FMol
      elseif D0V/DMol>=E0V/EMol and F0V/FMol>=E0V/EMol then
        X=-E0V/EMol
      else
        X=-D0V/DMol
      end if
      end if
    end if
  end if
  Log0=LogQ
  do while abs(LogQ-LogK)>10E-10 and abs(X)>10E-10
    if (Log0-LogK)*(LogQ-LogK)<0 then
      X=-X/2
    else
      X=X/2
    end if
    XX=XX+X
    Log0=LogQ
    LogQ_Volume
  loop
  Reaction.Reaction_Mol.value=XX
  Reaction.H_Reaction.value=XX*DH
  Reaction.S_Reaction.value=XX*SH
  Reaction.G_Reaction.value=XX*GH
  AV=A0V-XX*AMol
  if Reaction.AV_Unit.value=0 then
    Reaction.A_Volume.value=AV
  else
    Reaction.A_Volume.value=AV/Reaction.AV_Unit.value*R0*T0/P0
    Reaction.A_Volume.value=AV/Reaction.AV_Unit.value*R0*T0/P0
  end if
  BV=B0V-XX*BMol
  if Reaction.BV_Unit.Value=0 then
    Reaction.B_Volume.value=BV
  else
    Reaction.B_Volume.value=BV/Reaction.BV_Unit.value*R0*T0/P0
  end if
  CV=C0V-XX*CMol
  if Reaction.CV_Unit.value=0 then
    Reaction.C_Volume.value=CV
  else
    Reaction.C_Volume.value=CV/Reaction.CV_Unit.value*R0*T0/P0
  end if
  DV=D0V+XX*DMol
  if Reaction.DV_Unit.value=0 then
    Reaction.D_Volume.value=DV
  else
    Reaction.D_Volume.value=DV/Reaction.DV_Unit.value*R0*T0/P0
  end if
  EV=E0V+XX*EMol
  if Reaction.EV_Unit.value=0 then
    Reaction.E_Volume.value=EV
    Reaction.E_Volume.value=EV
  else
    Reaction.E_Volume.value=EV/Reaction.EV_Unit.value*R0*T0/P0
  end if
  FV=F0V+XX*FMol
  if Reaction.FV_Unit.value=0 then
    Reaction.F_Volume.value=FV
  else
    Reaction.F_Volume.value=FV/Reaction.FV_Unit.value*R0*T0/P0
  end if
  Calc_Total
end sub

sub LogQ_Pressure
  LogQ=0
  AAP=A0P-XX*AMol
  BBP=B0P-XX*BMol
  CCP=C0P-XX*CMol
  DDP=D0P+XX*DMol
  EEP=E0P+XX*EMol
  FFP=F0P+XX*FMol
  if (AAP=0 and Reaction.A_Gas.checked) or (BBP=0 and
Reaction.B_Gas.checked) or (CCP=0 and Reaction.C_Gas.checked) then
Reaction.B_Gas.checked) or (CCP=0 and Reaction.C_Gas.checked) then
    if (DDP=0 and Reaction.D_Gas.checked) or (EEP=0 and
Reaction.E_Gas.checked) or (FFP=0 and Reaction.F_Gas.checked) then
      LogQ=LogK
    else
      LogQ=LogK+1
    end if
  elseif (DDP=0 and Reaction.D_Gas.checked) or (EEP=0 and
Reaction.E_Gas.checked) or (FFP=0 and Reaction.F_Gas.checked) then
    if (AAP=0 and Reaction.A_Gas.checked) or (BBP=0 and
Reaction.B_Gas.checked) or (CCP=0 and Reaction.C_Gas.checked) then
      LogQ=LogK
    else
      LogQ=LogK-1
    end if
  else
    if Reaction.A_Gas.Checked then
      LogQ=LogQ-AMol*log(AAP*R0*T0/V0/101325)
    end if
    if Reaction.B_Gas.Checked then
      LogQ=LogQ-BMol*log(BBP*R0*T0/V0/101325)
    end if
    if Reaction.C_Gas.Checked then
    if Reaction.C_Gas.Checked then
      LogQ=LogQ-CMol*log(CCP*R0*T0/V0/101325)
    end if
    if Reaction.D_Gas.Checked then
      LogQ=LogQ+DMol*log(DDP*R0*T0/V0/101325)
    end if
    if Reaction.E_Gas.Checked then
      LogQ=LogQ+EMol*log(EEP*R0*T0/V0/101325)
    end if
    if Reaction.F_Gas.Checked then
      LogQ=LogQ+FMol*log(FFP*R0*T0/V0/101325)
    end if
  end if
end sub

sub Calc_Pressure
  XX=0
  LogQ_Pressure
  if LogQ<LogK then
    if AMol=0 and BMol=0 and CMol=0 then
      if DMol=0 then
        if EMol=0 then
          X=F0P/FMol
          X=F0P/FMol
        elseif FMol=0 then
          X=E0P/EMol
        elseif E0P/EMol>F0P/FMol then
          X=F0P/FMol
        else
          X=E0P/EMol
        end if
      elseif EMol=0 then
        if DMol=0 then
          X=F0P/FMol
        elseif FMol=0 then
          X=D0P/DMol
        elseif D0P/DMol>F0P/FMol then
          X=F0P/FMol
        else
          X=D0P/DMol
        end if
      elseif FMol=0 then
        if DMol=0 then
          X=E0P/EMol
        elseif EMol=0 then
          X=D0P/DMol
          X=D0P/DMol
        elseif D0P/DMol>E0P/EMol then
          X=E0P/EMol
        else
          X=D0P/DMol
        end if
      elseif D0P/DMol>=F0P/FMol and E0P/EMol>=F0P/FMol then
        X=F0P/FMol
      elseif D0P/DMol>=E0P/EMol and F0P/FMol>=E0P/EMol then
        X=E0P/EMol
      else
        X=D0P/DMol
      end if
    else
      if AMol=0 then
        if BMol=0 then
          X=C0P/CMol
        elseif CMol=0 then
          X=B0P/BMol
        elseif B0P/BMol>C0P/CMol then
          X=C0P/CMol
        else
          X=B0P/BMol
          X=B0P/BMol
        end if
      elseif BMol=0 then
        if AMol=0 then
          X=C0P/CMol
        elseif CMol=0 then
          X=A0P/AMol
        elseif A0P/AMol>C0P/CMol then
          X=C0P/CMol
        else
          X=A0P/AMol
        end if
      elseif CMol=0 then
        if AMol=0 then
          X=B0P/BMol
        elseif BMol=0 then
          X=A0P/AMol
        elseif A0P/AMol>B0P/BMol then
          X=B0P/BMol
        else
          X=A0P/AMol
        end if
      elseif A0P/AMol>=C0P/CMol and B0P/BMol>=C0P/CMol then
      elseif A0P/AMol>=C0P/CMol and B0P/BMol>=C0P/CMol then
        X=C0P/CMol
      elseif A0P/AMol>=B0P/BMol and C0P/CMol>=B0P/BMol then
        X=B0P/BMol
      else
        X=A0P/AMol
      end if
    end if
  else
    if DMol=0 and EMol=0 and FMol=0 then
      if AMol=0 then
        if BMol=0 then
          X=-C0P/CMol
        elseif CMol=0 then
          X=-B0P/BMol
        elseif B0P/BMol>C0P/CMol then
          X=-C0P/CMol
        else
          X=-B0P/BMol
        end if
      elseif BMol=0 then
        if AMol=0 then
          X=-C0P/CMol
          X=-C0P/CMol
        elseif CMol=0 then
          X=-A0P/AMol
        elseif A0P/AMol>C0P/CMol then
          X=-C0P/CMol
        else
          X=-A0P/AMol
        end if
      elseif CMol=0 then
        if AMol=0 then
          X=-B0P/BMol
        elseif BMol=0 then
          X=-A0P/AMol
        elseif A0P/AMol>B0P/BMol then
          X=-B0P/BMol
        else
          X=-A0P/AMol
        end if
      elseif A0P/AMol>=C0P/CMol and B0P/BMol>=C0P/CMol then
        X=-C0P/CMol
      elseif A0P/AMol>=B0P/BMol and C0P/CMol>=B0P/BMol then
        X=-B0P/BMol
      else
      else
        X=-A0P/AMol
      end if
    else
      if DMol=0 then
        if EMol=0 then
          X=-F0P/FMol
        elseif FMol=0 then
          X=-E0P/EMol
        elseif E0P/EMol>F0P/FMol then
          X=-F0P/FMol
        else
          X=-E0P/EMol
        end if
      elseif EMol=0 then
        if DMol=0 then
          X=-F0P/FMol
        elseif FMol=0 then
          X=-D0P/DMol
        elseif D0P/DMol>F0P/FMol then
          X=-F0P/FMol
        else
          X=-D0P/DMol
          X=-D0P/DMol
        end if
      elseif FMol=0 then
        if DMol=0 then
          X=-E0P/EMol
        elseif EMol=0 then
          X=-D0P/DMol
        elseif D0P/DMol>E0P/EMol then
          X=-E0P/EMol
        else
          X=-D0P/DMol
        end if
      elseif D0P/DMol>=F0P/FMol and E0P/EMol>=F0P/FMol then
        X=-F0P/FMol
      elseif D0P/DMol>=E0P/EMol and F0P/FMol>=E0P/EMol then
        X=-E0P/EMol
      else
        X=-D0P/DMol
      end if
    end if
  end if
  Log0=LogQ
  do while abs(LogQ-LogK)>10E-10 and abs(X)>10E-10
  do while abs(LogQ-LogK)>10E-10 and abs(X)>10E-10
    if (Log0-LogK)*(LogQ-LogK)<0 then
      X=-X/2
    else
      X=X/2
    end if
    XX=XX+X
    Log0=LogQ
    LogQ_Pressure
  loop
  Reaction.Reaction_Mol.value=XX
  Reaction.H_Reaction.value=XX*DH
  Reaction.S_Reaction.value=XX*SH
  Reaction.G_Reaction.value=XX*GH
  AP=A0P-XX*AMol
  if Reaction.AP_Unit.value=0 then
    Reaction.A_Pressure.value=AP
  else
    Reaction.A_Pressure.value=AP/Reaction.AP_Unit.value*R0*T0/V0
  end if
  BP=B0P-XX*BMol
  if Reaction.BP_Unit.value=0 then
    Reaction.B_Pressure.value=BP
    Reaction.B_Pressure.value=BP
  else
    Reaction.B_Pressure.value=BP/Reaction.BP_Unit.value*R0*T0/V0
  end if
  CP=C0P-XX*CMol
  if Reaction.CP_Unit.value=0 then
    Reaction.C_Pressure.value=CP
  else
    Reaction.C_Pressure.value=CP/Reaction.CP_Unit.value*R0*T0/V0
  end if
  DP=D0P+XX*DMol
  if Reaction.DP_Unit.value=0 then
    Reaction.D_Pressure.value=DP
  else
    Reaction.D_Pressure.value=DP/Reaction.DP_Unit.value*R0*T0/V0
  end if
  EP=E0P+XX*EMol
  if Reaction.EP_Unit.value=0 then
    Reaction.E_Pressure.value=EP
  else
    Reaction.E_Pressure.value=EP/Reaction.EP_Unit.value*R0*T0/V0
  end if
  FP=F0P+XX*FMol
  FP=F0P+XX*FMol
  if Reaction.FP_Unit.value=0 then
    Reaction.F_Pressure.value=FP
  else
    Reaction.F_Pressure.value=FP/Reaction.FP_Unit.value*R0*T0/V0
  end if
  Calc_Total
end sub

--></script><em>Chemical
Balance of Gases</em></h1>

<form method="POST" name="Reaction">
    <table border="1" width="100%">
        <tr>
            <td align="center"><table border="1">
                <tr>
                    <td><p align="left">Gas Constant:</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="Gas_Constant" value="8.31441"></p>
                    </td>
                    <td><p align="left"><select name="R_Unit"
                    <td><p align="left"><select name="R_Unit"
                    size="1">
                        <option value="101.325">atmL/molK</option>
                        <option selected value="1">J/molK</option>
                    </select></p>
                    </td>
                </tr>
                <tr>
                    <td><p align="left">Temperature:</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="Temperature" value="25"></p>
                    </td>
                    <td><p align="left"><select name="T_Unit"
                    size="1">
                        <option value="0">K</option>
                        <option selected value="273.15">`C</option>
                    </select></p>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
        </tr>
        <tr>
            <td align="center"><table border="1">
                <tr>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="3" name="A_Mol" value="0"> <input
                    type="text" size="5" name="A_Name"><input
                    type="checkbox" name="A_Gas" value="ON"
                    onclick="Calc_Total"></p>
                    </td>
                    <td align="center"><p align="left">+</p>
                    </td>
                    <td align="center"><p align="left"><input
                    type="text" size="3" name="B_Mol" value="0"> <input
                    type="text" size="5" name="B_Name"><input
                    type="checkbox" name="B_Gas" value="ON"
                    onclick="Calc_Total"></p>
                    </td>
                    <td align="center"><p align="left">+</p>
                    </td>
                    <td align="center"><p align="left"><input
                    type="text" size="3" name="C_Mol" value="0"> <input
                    type="text" size="3" name="C_Mol" value="0"> <input
                    type="text" size="5" name="C_Name"><input
                    type="checkbox" name="C_Gas" value="ON"
                    onclick="Calc_Total"></p>
                    </td>
                    <td align="center"><p align="left">=</p>
                    </td>
                    <td align="center"><p align="left"><input
                    type="text" size="3" name="D_Mol" value="0"> <input
                    type="text" size="5" name="D_Name"><input
                    type="checkbox" name="D_Gas" value="ON"
                    onclick="Calc_Total"></p>
                    </td>
                    <td>+</td>
                    <td><input type="text" size="3" name="E_Mol"
                    value="0"><input type="text" size="5"
                    name="E_Name"><input type="checkbox"
                    name="E_Gas" value="ON" onclick="Calc_Total"></td>
                    <td>+</td>
                    <td><input type="text" size="3" name="F_Mol"
                    value="0"><input type="text" size="5"
                    name="F_Name"><input type="checkbox"
                    name="F_Gas" value="ON" onclick="Calc_Total"></td>
                    name="F_Gas" value="ON" onclick="Calc_Total"></td>
                </tr>
                <tr>
                    <td align="center"><p align="left">Enthalpy (<font
                    face="Symbol">D</font>H<sub>f</sub><sup>0</sup>)</p>
                    </td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="A_Hf" value="0"
                    onchange="Calc">kJ/mol</p>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="B_Hf" value="0"
                    onchange="Calc">kJ/mol</p>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="C_Hf" value="0"
                    onchange="Calc">kJ/mol</p>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="D_Hf" value="0"
                    type="text" size="10" name="D_Hf" value="0"
                    onchange="Calc">kJ/mol</p>
                    </td>
                    <td>&nbsp;</td>
                    <td><input type="text" size="10" name="E_Hf"
                    value="0" onchange="Calc">kJ/mol</td>
                    <td>&nbsp;</td>
                    <td><input type="text" size="10" name="F_Hf"
                    value="0" onchange="Calc">kJ/mol</td>
                </tr>
                <tr>
                    <td align="center"><p align="left">Entropy
(S<sup>0</sup>)</p>
                    </td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="A_S" value="0"
                    onchange="Calc">J/molK</p>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="B_S" value="0"
                    onchange="Calc">J/molK</p>
                    </td>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="C_S" value="0"
                    onchange="Calc">J/molK</p>
                    </td>
                    <td align="center">&nbsp;</td>
                    <td align="center"><p align="left"><input
                    type="text" size="10" name="D_S" value="0"
                    onchange="Calc">J/molK</p>
                    </td>
                    <td>&nbsp;</td>
                    <td><input type="text" size="10" name="E_S"
                    value="0" onchange="Calc">J/molK</td>
                    <td>&nbsp;</td>
                    <td><input type="text" size="10" name="F_S"
                    value="0" onchange="Calc">J/molK</td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td align="center"><table border="1">
            <td align="center"><table border="1">
                <tr>
                    <td><p align="left">Amount of Reaction</p>
                    </td>
                    <td><p align="left">Enthalpy Change(<font
                    face="Symbol">D</font>H<sup>0</sup>)</p>
                    </td>
                    <td><p align="left">Entropy Change(<font
                    face="Symbol">D</font>S<sup>0</sup>)</p>
                    </td>
                    <td><p align="left">Free Energy Change(<font
                    face="Symbol">D</font>G<sup>0</sup>)</p>
                    </td>
                    <td><p align="left">Balance Constant</p>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td><p align="left"><input type="text"
                    size="10" name="H_Mol" value="0">kJ/mol</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="S_Mol" value="0">J/molK</p>
                    size="10" name="S_Mol" value="0">J/molK</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="G_Mol" value="0"
                    onchange="G_Mol">kJ/mol</p>
                    </td>
                    <td><p align="left">K=<input type="text"
                    size="10" name="K" value="1"></p>
                    </td>
                </tr>
                <tr>
                    <td><p align="left"><input type="text"
                    size="10" name="Reaction_Mol" value="0">mol</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="H_Reaction" value="0">kJ</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="S_Reaction" value="0">J/K</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="G_Reaction" value="0">kJ</p>
                    </td>
                    </td>
                    <td>pK=<input type="text" size="10" name="pK"
                    value="0"></td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td align="center"><table border="1">
                <tr>
                    <td colspan="8"><p align="left">Reaction
                    under Constant Pressure: <input type="text"
                    size="10" name="Pressure_React"
                    value="101325"><select name="Pressure_Unit"
                    size="1">
                        <option selected value="1">Pa</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                    </select></p>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td><p align="left"><input type="text"
                    size="5" name="A_Name_Volume"><select
                    name="AV_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="5" name="B_Name_Volume"><select
                    name="BV_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="5" name="C_Name_Volume"><select
                    name="CV_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="5" name="D_Name_Volume"><select
                    name="DV_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></p>
                    </td>
                    <td><input type="text" size="5"
                    name="E_Name_Volume"><select name="EV_Unit"
                    size="1">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></td>
                    </select></td>
                    <td><input type="text" size="5"
                    name="F_Name_Volume"><select name="FV_Unit"
                    size="1">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></td>
                    <td>Total:<font face="Times New Roman"> </font><select
                    name="TV_Unit" size="1" onchange="Calc_Total">
                        <option selected value="0">mol</option>
                        <option value="1">m^3</option>
                        <option value="0.001">L</option>
                        <option value="0.000001">mL</option>
                    </select></td>
                </tr>
                <tr>
                    <td><p align="left">Volume</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="A0_Volume" value="0"></p>
                    </td>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="B0_Volume" value="0"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="C0_Volume" value="0"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="D0_Volume" value="0"></p>
                    </td>
                    <td><input type="text" size="10"
                    name="E0_Volume" value="0"></td>
                    <td><input type="text" size="10"
                    name="F0_Volume" value="0"></td>
                    <td><input type="text" size="10"
                    name="T0_Volume" value="0"
                    onchange="Calc_Total"></td>
                </tr>
                <tr>
                    <td><p align="left"><input type="button"
                    name="React_Volume" value="React"
                    onclick="Calc_Volume"></p>
                    </td>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="A_Volume" value="0"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="B_Volume" value="0"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="C_Volume" value="0"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="D_Volume" value="0"></p>
                    </td>
                    <td><input type="text" size="10"
                    name="E_Volume" value="0"></td>
                    <td><input type="text" size="10"
                    name="F_Volume" value="0"></td>
                    <td><input type="text" size="10"
                    name="T_Volume" value="0"
                    onchange="Calc_Total"></td>
                </tr>
            </table>
            </td>
            </td>
        </tr>
        <tr>
            <td align="center"><table border="1">
                <tr>
                    <td colspan="8"><p align="left">Reaction
                    under Constant Volume: <input type="text"
                    size="10" name="Volume_React" value="24.465">
                    <select name="Volume_Unit" size="1">
                        <option selected value="0.001">L</option>
                        <option value="1">m^3</option>
                        <option value="0.000001">mL</option>
                    </select></p>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td><p align="left"><input type="text"
                    size="5" name="A_Name_Pressure"><select
                    name="AP_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="5" name="B_Name_Pressure"><select
                    name="BP_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="5" name="C_Name_Pressure"><select
                    name="CP_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></p>
                    </td>
                    <td><p align="left"><input type="text"
                    <td><p align="left"><input type="text"
                    size="5" name="D_Name_Pressure"><select
                    name="DP_Unit" size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></p>
                    </td>
                    <td><input type="text" size="5"
                    name="E_Name_Pressure"><select name="EP_Unit"
                    size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></td>
                    <td><input type="text" size="5"
                    name="F_Name_Pressure"><select name="FP_Unit"
                    size="1">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></td>
                    <td>Total: <select name="TP_Unit" size="1"
                    onchange="Calc_Total">
                        <option selected value="0">mol</option>
                        <option value="101325">atm</option>
                        <option value="133.322">mmHg</option>
                        <option value="1">Pa</option>
                    </select></td>
                </tr>
                <tr>
                    <td><p align="left">Pressure</p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="A0_Pressure"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="B0_Pressure"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="C0_Pressure"></p>
                    </td>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="D0_Pressure"></p>
                    </td>
                    <td><input type="text" size="10"
                    name="E0_Pressure"></td>
                    <td><input type="text" size="10"
                    name="F0_Pressure" value="0"></td>
                    <td><input type="text" size="10"
                    name="T0_Pressure" value="0"
                    onchange="Calc_Total"></td>
                </tr>
                <tr>
                    <td><p align="left"><input type="button"
                    name="React_Pressure" value="React"
                    onclick="Calc_Pressure"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="A_Pressure"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="B_Pressure"></p>
                    </td>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="C_Pressure"></p>
                    </td>
                    <td><p align="left"><input type="text"
                    size="10" name="D_Pressure"></p>
                    </td>
                    <td><input type="text" size="10"
                    name="E_Pressure" value="0"></td>
                    <td><input type="text" size="10"
                    name="F_Pressure" value="0"></td>
                    <td><input type="text" size="10"
                    name="T_Pressure" value="0"
                    onchange="Calc_Total"></td>
                </tr>
            </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>

                    size="10" name="D_Pressure"></p>
 

--
╔═══════════════════╗
║★★★★★友谊第一  比赛第二★★★★★║
╚═══════════════════╝


※ 来源:·哈工大紫丁香 http://bbs.hit.edu.cn·[FROM: 219.147.183.*]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:843.644毫秒