{"text_format":"1","workbook":"xlsx","n_sheets":3,"sheets":["Main","SourceB","SourceP"],"not_rendered":{"charts":0,"images":2,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"Main","index":0,"n_rows":15,"n_cols":4,"rows_kept":15,"cut":false,"hidden":false,"merged":[]}
["VBA to Python"]
["2023/7/15"]
[]
["1. Copy Source of VBA to 'SourceB' sheet from cell (A,1)."]
["2. Push 'Trans' button."]
["3. Source of Python will be generated to 'SourceP' sheet."]
[]
["Note1. In case code covers over 1 line, combine to 1 line."]
[]
[null,"line:",2030,2030]
[null,"Sub:",0,10]
[null,"Fun:",0,37]
[null,"If:",-1,62]
[null,"For:",0,1]
[null,"Do:",0,14]

{"sheet":"SourceB","index":1,"n_rows":2030,"n_cols":1,"rows_kept":2030,"cut":false,"hidden":false,"merged":[]}
["'□□□□□□□□□□"]
["'変数の宣言"]
["'□□□□□□□□□□"]
["Option Explicit"]
[]
["'単位系"]
["'重力単位系で計算し、SI単位系と変換する"]
["Public Const flg_uni As String = \"S\" 'G(重力) or S(SI)"]
[]
["'熱量"]
["'1[J] = 1[Ws], 3600[kJ] =1[kWh] =  860[kcal]"]
["Public Const HQw_n As String = \"kWh\""]
["Public Const HQw_d As Double = 1#"]
["Public Const HQw_u As String = \"[kWh]\""]
[]
["Public Const HQc_n As String = \"kcal\""]
["Public Const HQc_d As Double = 860#"]
["Public Const HQc_u As String = \"[kcal]\""]
[]
["Public Const HQj_n As String = \"kJ\""]
["Public Const HQj_d As Double = 3600#"]
["Public Const HQj_u As String = \"[kJ]\""]
[]
["'物理定数等"]
["Public Const GA_n As String = \"重力加速度\" '変数名"]
["Public Const GA_d As Double = 9.80665 '変数値"]
["Public Const GA_u As String = \"[m/s2]\" '単位"]
[]
["Public Const AT0_n As String = \"摂氏0度の絶対温度\""]
["Public Const AT0_d As Double = 273.15"]
["Public Const AT0_u As String = \"[degK]\""]
[]
["Public Const MA_n As String = \"乾き空気の分子量\""]
["Public Const MA_d As Double = 28.964 '545"]
["Public Const MA_u As String = \"[kg/kmol]\""]
[]
["Public Const MW_n As String = \"水蒸気の分子量\""]
["Public Const MW_d As Double = 18.015 '3"]
["Public Const MW_u As String = \"[kg/kmol]\""]
[]
["Public Const CPA_n As String = \"乾き空気の定圧比熱\""]
["Public Const CPA_d As Double = 0.24"]
["Public Const CPA_u As String = \"[kcal/kg℃]\""]
["'0.24[kcal/kg℃] * 4.186[kJ/kcal] = 1.0046 =1.006[kJ/kg℃]"]
[]
["Public Const CPW_n As String = \"水蒸気の定圧比熱\""]
["Public Const CPW_d As Double = 0.441"]
["Public Const CPW_u As String = \"[kcal/kg℃]\""]
["'0.441[kcal/kg℃] * 4.186[kJ/kcal] = 1.846 =1.86[kJ/kg℃]"]
[]
["Public Const LH_n As String = \"摂氏0度での水の蒸発潜熱\""]
["Public Const LH_d As Double = 597.3"]
["Public Const LH_u As String = \"[kcal/kg]\""]
["'597.3[kcal/kg] * 4.186[kJ/kcal] = 2500.3 = 2501[kJ/kg]"]
[]
["Public Const WRA_n As String = \"乾き空気の比重量\""]
["Public Const WRA_d As Double = 1.2"]
["Public Const WRA_u As String = \"[kg/m3]\""]
[]
["Public Const WRW_n As String = \"水の比重量\""]
["Public Const WRW_d As Double = 1000#"]
["Public Const WRW_u As String = \"[kg/m3]\""]
[]
["'湿り空気に関する状態値"]
["Public Const PA_n As String = \"大気圧\""]
["Public PA_s As String"]
["Public PA_d As Double"]
["Public PA0_d As Double '標準大気圧"]
["Public Const PA0_dg As Double = 760#"]
["Public Const PA0_ds As Double = 101.325 'XU_P(PA0_dg, \"GS\")"]
["Public PA_f As Integer '小数桁"]
["Public Const PA_f0g As Integer = 1"]
["Public Const PA_f0s As Integer = 3"]
["Public PA_u As String"]
["Public Const PA_ug As String = \"[mmHg]\""]
["Public Const PA_us As String = \"[kPa]\""]
[]
["Public Const HT_n As String = \"海抜高度\""]
["Public HT_s As String"]
["Public HT_d As Double"]
["Public Const HT0_d As Double = 0#"]
["Public HT_f As Integer"]
["Public Const HT_f0 As Integer = 0"]
["Public Const HT_u As String = \"[m]\""]
[]
["Public Const DB_n As String = \"乾球温度\""]
["Public DB_s As String"]
["Public DB_d As Double"]
["Public Const DB0_d As Double = 24#"]
["Public DB_f As Integer"]
["Public Const DB_f0 As Integer = 1"]
["Public Const DB_u As String = \"[℃]\""]
["  "]
["Public Const WB_n As String = \"湿球温度\""]
["Public WB_s As String"]
["Public WB_d As Double"]
["Public WB_f As Integer"]
["Public Const WB_f0 As Integer = 1"]
["Public Const WB_u As String = \"[℃]\""]
[]
["Public Const RH_n As String = \"相対湿度\""]
["Public RH_s As String"]
["Public RH_d As Double"]
["Public Const RH0_d As Double = 50#"]
["Public RH_f As Integer"]
["Public Const RH_f0 As Integer = 1"]
["Public Const RH_u As String = \"[%]\""]
[]
["Public Const AH_n As String = \"絶対湿度\""]
["Public AH_s As String"]
["Public AH_d As Double"]
["Public AH_f As Integer"]
["Public Const AH_f0 As Integer = 6 '5 '4"]
["Public Const AH_u As String = \"[kg/kg']\""]
[]
["Public Const ET_n As String = \"比エンタルピ\""]
["Public ET_s As String"]
["Public ET_d As Double"]
["Public ET_f As Integer"]
["Public Const ET_f0g As Integer = 1"]
["Public Const ET_f0s As Integer = 1"]
["Public ET_u As String"]
["Public Const ET_ug As String = \"[kcal/kg]\" '\"[kcal/kgf]\""]
["Public Const ET_us As String = \"[kJ/kg]\""]
[]
["Public Const SV_n As String = \"比容積\""]
["Public SV_s As String"]
["Public SV_d As Double"]
["Public SV_f As Integer"]
["Public Const SV_f0 As Integer = 3"]
["Public Const SV_u As String = \"[m3/kg']\""]
[]
["Public Const DP_n As String = \"露点温度\""]
["Public DP_s As String"]
["Public DP_d As Double"]
["Public DP_f As Integer"]
["Public Const DP_f0 As Integer = 1"]
["Public Const DP_u As String = \"[℃]\""]
[]
["Public Const PW_n As String = \"水蒸気圧\""]
["Public PW_s As Double"]
["Public PW_d As Double"]
["Public PW_f As Integer"]
["Public Const PW_f0g As Integer = 1"]
["Public Const PW_f0s As Integer = 3"]
["Public PW_u As String"]
["Public Const PW_ug As String = \"[mmHg]\""]
["Public Const PW_us As String = \"[kPa]\""]
[]
["Public Const PWS_n As String = \"飽和水蒸気圧\""]
["Public PWS_s As Double"]
["Public PWS_d As Double"]
[]
["Public Const XH_n As String = \"飽和度\""]
["Public XH_s As Double"]
["Public XH_d As Double"]
["Public XH_f As Integer"]
["Public Const XH_f0 As Integer = 1"]
["Public Const XH_u As String = \"[%]\""]
[]
["Public Const SH_n As String = \"顕熱比\""]
["Public SH_s As Double"]
["Public SH_d As Double"]
["Public SH_f As Integer"]
["Public Const SH0_f As Integer = 3"]
["Public Const SH_u As String = \"[-]\""]
[]
["Public Const UR_n As String = \"熱水分比\""]
["Public UR_s As Double"]
["Public UR_d As Double"]
["Public UR_f As Integer"]
["Public Const UR_f0g As Integer = 3"]
["Public Const UR_f0s As Integer = 3"]
["Public UR_u As String"]
["Public Const UR_ug As String = \"[kcal/kg]\""]
["Public Const UR_us As String = \"[kJ/kg]\""]
[]
["'水蒸気圧計算方法"]
["Public Const flgP_n As String = \"水蒸気圧計算方法\""]
["Public flgP_s As String"]
["Public flgP_d As String"]
["Public Const flgPg_d As String = \"ゴフ・グラッチ\""]
["Public Const flgPw_d As String = \"ウェクスラー・ハイランド\""]
["Public Const flgPt_d As String = \"テーテンス\""]
["Public Const flgP0_d As String = flgPw_d '\"ウェクスラー・ハイランド\""]
["Public Const flgP_u As String = \"[-]\""]
[]
["'2分法計算条件"]
["Public Const TLow_n As String = \"温度下限\""]
["Public Const TLow_d As Double = -100#"]
["Public Const TUpp_n As String = \"温度上限\""]
["Public Const TUpp_d As Double = 200#"]
["Public Const TErr_n As String = \"許容誤差\""]
["Public Const TErr_d As Double = 0.01"]
[]
["'セル座標"]
["Public Const sheet_n As String = \"Main\""]
["Public Const name_col As Integer = 2"]
["Public Const data_col As Integer = 3"]
["Public Const unit_col As Integer = 4"]
["Public Const fnum_col As Integer = 5 '20230531追加"]
["Public Const PA_row As Integer = 5"]
["Public Const HT_row As Integer = 6"]
["Public Const DB_row As Integer = 7"]
["Public Const WB_row As Integer = 8"]
["Public Const RH_row As Integer = 9"]
["Public Const AH_row As Integer = 10"]
["Public Const ET_row As Integer = 11"]
["Public Const SV_row As Integer = 12"]
["Public Const DP_row As Integer = 13"]
["Public Const flgP_row As Integer = 14"]
["Public Const PWS_row As Integer = 15"]
["Public Const PW_row As Integer = 16"]
["Public Const XH_row As Integer = 17"]
[]
["Public Const sheet2_n As String = \"Check\""]
["Public Const Check_row As Integer = 1"]
["Public Const HT_PA_col As Integer = 1"]
["Public Const PA_HT_col As Integer = 4"]
["Public Const PWS_DB_col As Integer = 7"]
[]
["'計算結果"]
["Public ary_tmp(0 To 9) As Double"]
[]
["'□□□□□□□□□□"]
["'単位、小数桁などを初期化する"]
["'□□□□□□□□□□"]
["Sub IniVal()"]
["'Public Const flg_uni As String = \"S\" 'G(重力) or S(SI)"]
[]
["'Public PA0_d As Double"]
["'Public Const PA0_dg As Double = 760#"]
["'Public Const PA0_ds As Double = 101.325 'XU_P(PA0_dg, \"GS\")"]
["'Public PA_f As Integer '小数点以下の丸め桁数"]
["'Public Const PA_f0g As Integer = 1"]
["'Public Const PA_f0s As Integer = 3"]
["'Public PA_u As String"]
["'Public Const PA_ug As String = \"[mmHg]\""]
["'Public Const PA_us As String = \"[kPa]\""]
["If flg_uni = \"G\" Then"]
["  PA0_d = PA0_dg"]
["  PA_f = PA_f0g"]
["  PA_u = PA_ug"]
["ElseIf flg_uni = \"S\" Then"]
["  PA0_d = PA0_ds"]
["  PA_f = PA_f0s"]
["  PA_u = PA_us"]
["End If"]
[]
["'Public HT_f As Integer"]
["'Public Const HT_f0 As Integer = 0"]
["  HT_f = HT_f0"]
[]
["'Public DB_f As Integer"]
["'Public Const DB_f0 As Integer = 1"]
["  DB_f = DB_f0"]
["  "]
["'Public WB_f As Integer"]
["'Public Const WB_f0 As Integer = 3 '1"]
["  WB_f = WB_f0"]
["  "]
["'Public RH_f As Integer"]
["'Public Const RH_f0 As Integer = 1"]
["  RH_f = RH_f0"]
["  "]
["'Public AH_f As Integer"]
["'Public Const AH_f0 As Integer = 8 '5 '4"]
["  AH_f = AH_f0"]
["  "]
["'Public ET_f As Integer"]
["'Public Const ET_f0g As Integer = 1"]
["'Public Const ET_f0s As Integer = 1"]
["'Public ET_u As String"]
["'Public Const ET_ug As String = \"[kcal/kg]\" '\"[kcal/kgf]\""]
["'Public Const ET_us As String = \"[kJ/kg]\""]
["If flg_uni = \"G\" Then"]
["  ET_f = ET_f0g"]
["  ET_u = ET_ug"]
["ElseIf flg_uni = \"S\" Then"]
["  ET_f = ET_f0s"]
["  ET_u = ET_us"]
["End If"]
[]
["'Public SV_f As Integer"]
["'Public Const SV_f0 As Integer = 3"]
["  SV_f = SV_f0"]
[]
["'Public DP_f As Integer"]
["'Public Const DP_f0 As Integer = 1"]
["  DP_f = DP_f0"]
["  "]
["'Public PW_f As Integer"]
["'Public Const PW_f0g As Integer = 1"]
["'Public Const PW_f0s As Integer = 3"]
["'Public PW_u As String"]
["'Public Const PW_ug As String = \"[mmHg]\""]
["'Public Const PW_us As String = \"[kPa]\""]
["If flg_uni = \"G\" Then"]
["  PW_f = PW_f0g"]
["  PW_u = PW_ug"]
["ElseIf flg_uni = \"S\" Then"]
["  PW_f = PW_f0s"]
["  PW_u = PW_us"]
["End If"]
["  "]
["'Public XH_f As Integer"]
["'Public Const XH_f0 As Integer = 1"]
["  XH_f = XH_f0"]
[]
["'Public UR_f As Integer"]
["'Public Const UR_f0g As Integer = 3"]
["'Public Const UR_f0s As Integer = 3"]
["'Public UR_u As String"]
["'Public Const UR_ug As String = \"[kcal/kg]\""]
["'Public Const UR_us As String = \"[kJ/kg]\""]
["If flg_uni = \"G\" Then"]
["  UR_f = UR_f0g"]
["  UR_u = UR_ug"]
["ElseIf flg_uni = \"S\" Then"]
["  UR_f = UR_f0s"]
["  UR_u = UR_us"]
["End If"]
[]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'状態値を初期化する"]
["'□□□□□□□□□□"]
["Sub ResetAP()"]
["'Public sheet_n As String"]
["'Public name_col As Integer"]
["'Public data_col As Integer"]
["'Public unit_col As Integer"]
["'Public fnum_col As Integer"]
["'Public PA_row As Integer"]
["'Public DB_row As Integer"]
["'Public WB_row As Integer"]
["'Public RH_row As Integer"]
["'Public AH_row As Integer"]
["'Public ET_row As Integer"]
["'Public SV_row As Integer"]
["'Public DP_row As Integer"]
["'Public flgP_row As Integer"]
["'Public PWS_row As Integer"]
["'Public PW_row As Integer"]
["'Public XH_row As Integer"]
["  "]
["'単位、小数桁などを初期化する"]
["  Call IniVal"]
["  "]
["'名前"]
["  Worksheets(sheet_n).Cells(PA_row, name_col).Value = PA_n"]
["  Worksheets(sheet_n).Cells(HT_row, name_col).Value = HT_n"]
["  Worksheets(sheet_n).Cells(DB_row, name_col).Value = DB_n"]
["  Worksheets(sheet_n).Cells(WB_row, name_col).Value = WB_n"]
["  Worksheets(sheet_n).Cells(RH_row, name_col).Value = RH_n"]
["  Worksheets(sheet_n).Cells(AH_row, name_col).Value = AH_n"]
["  Worksheets(sheet_n).Cells(ET_row, name_col).Value = ET_n"]
["  Worksheets(sheet_n).Cells(SV_row, name_col).Value = SV_n"]
["  Worksheets(sheet_n).Cells(DP_row, name_col).Value = DP_n"]
["  Worksheets(sheet_n).Cells(flgP_row, name_col).Value = flgP_n"]
["  Worksheets(sheet_n).Cells(PWS_row, name_col).Value = PWS_n"]
["  Worksheets(sheet_n).Cells(PW_row, name_col).Value = PW_n"]
["  Worksheets(sheet_n).Cells(XH_row, name_col).Value = XH_n"]
["  "]
["'単位"]
["  Worksheets(sheet_n).Cells(PA_row, unit_col).Value = PA_u"]
["  Worksheets(sheet_n).Cells(HT_row, unit_col).Value = HT_u"]
["  Worksheets(sheet_n).Cells(DB_row, unit_col).Value = DB_u"]
["  Worksheets(sheet_n).Cells(WB_row, unit_col).Value = WB_u"]
["  Worksheets(sheet_n).Cells(RH_row, unit_col).Value = RH_u"]
["  Worksheets(sheet_n).Cells(AH_row, unit_col).Value = AH_u"]
["  Worksheets(sheet_n).Cells(ET_row, unit_col).Value = ET_u"]
["  Worksheets(sheet_n).Cells(SV_row, unit_col).Value = SV_u"]
["  Worksheets(sheet_n).Cells(DP_row, unit_col).Value = DP_u"]
["  Worksheets(sheet_n).Cells(flgP_row, unit_col).Value = flgP_u"]
["  Worksheets(sheet_n).Cells(PWS_row, unit_col).Value = PW_u"]
["  Worksheets(sheet_n).Cells(PW_row, unit_col).Value = PW_u"]
["  Worksheets(sheet_n).Cells(XH_row, unit_col).Value = XH_u"]
["  "]
["'小数桁"]
["  Worksheets(sheet_n).Cells(PA_row, fnum_col).Value = PA_f"]
["  Worksheets(sheet_n).Cells(HT_row, fnum_col).Value = HT_f"]
["  Worksheets(sheet_n).Cells(DB_row, fnum_col).Value = DB_f"]
["  Worksheets(sheet_n).Cells(WB_row, fnum_col).Value = WB_f"]
["  Worksheets(sheet_n).Cells(RH_row, fnum_col).Value = RH_f"]
["  Worksheets(sheet_n).Cells(AH_row, fnum_col).Value = AH_f"]
["  Worksheets(sheet_n).Cells(ET_row, fnum_col).Value = ET_f"]
["  Worksheets(sheet_n).Cells(SV_row, fnum_col).Value = SV_f"]
["  Worksheets(sheet_n).Cells(DP_row, fnum_col).Value = DP_f"]
["  Worksheets(sheet_n).Cells(PWS_row, fnum_col).Value = PW_f"]
["  Worksheets(sheet_n).Cells(PW_row, fnum_col).Value = PW_f"]
["  Worksheets(sheet_n).Cells(XH_row, fnum_col).Value = XH_f"]
["  "]
["'状態値(初期値)"]
["  Worksheets(sheet_n).Cells(PA_row, data_col).Value = CStr(Round(PA0_d, PA_f))"]
["  Worksheets(sheet_n).Cells(HT_row, data_col).Value = \"\" 'CStr(Round(HT0_d, HT_f))"]
["  Worksheets(sheet_n).Cells(DB_row, data_col).Value = CStr(Round(DB0_d, DB_f))"]
["  Worksheets(sheet_n).Cells(WB_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(RH_row, data_col).Value = CStr(Round(RH0_d, RH_f))"]
["  Worksheets(sheet_n).Cells(AH_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(ET_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(SV_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(DP_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(flgP_row, data_col).Value = flgP0_d"]
["  Worksheets(sheet_n).Cells(PWS_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(PW_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(XH_row, data_col).Value = \"\""]
["  "]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'入力値(状態値と小数桁)を取得する"]
["'□□□□□□□□□□"]
["Sub InAP()"]
["'Public sheet_n As String"]
["'Public data_col As Integer"]
["'Public fnum_col As Integer"]
["'Public PA_row As Integer"]
["'Public DB_row As Integer"]
["'Public WB_row As Integer"]
["'Public RH_row As Integer"]
["'Public AH_row As Integer"]
["'Public ET_row As Integer"]
["'Public SV_row As Integer"]
["'Public DP_row As Integer"]
["'Public flgP_row As Integer"]
["'Public PWS_row As Integer"]
["'Public PW_row As Integer"]
["'Public XH_row As Integer"]
[]
["'状態値"]
["'自由入力のため、入力の有無を判定するため文字列で取得する"]
["'Public PA_s As Double"]
["'Public HT_s As Double"]
["'Public DB_s As Double"]
["'Public WB_s As Double"]
["'Public RH_s As Double"]
["'Public AH_s As Double"]
["'Public ET_s As Double"]
["'Public SV_s As Double"]
["'Public DP_s As Double"]
["'Public flgP_s As String"]
["  PA_s = Worksheets(sheet_n).Cells(PA_row, data_col).Text"]
["  HT_s = Worksheets(sheet_n).Cells(HT_row, data_col).Text"]
["  DB_s = Worksheets(sheet_n).Cells(DB_row, data_col).Text"]
["  WB_s = Worksheets(sheet_n).Cells(WB_row, data_col).Text"]
["  RH_s = Worksheets(sheet_n).Cells(RH_row, data_col).Text"]
["  AH_s = Worksheets(sheet_n).Cells(AH_row, data_col).Text"]
["  ET_s = Worksheets(sheet_n).Cells(ET_row, data_col).Text"]
["  SV_s = Worksheets(sheet_n).Cells(SV_row, data_col).Text"]
["  DP_s = Worksheets(sheet_n).Cells(DP_row, data_col).Text"]
["  flgP_s = Worksheets(sheet_n).Cells(flgP_row, data_col).Text"]
[]
["'小数桁"]
["'Public PA_f As Integer"]
["'Public HT_f As Integer"]
["'Public DB_f As Integer"]
["'Public WB_f As Integer"]
["'Public RH_f As Integer"]
["'Public AH_f As Integer"]
["'Public ET_f As Integer"]
["'Public SV_f As Integer"]
["'Public DP_f As Integer"]
["'Public PW_f As Integer"]
["'Public XH_f As Integer"]
["  PA_f = Worksheets(sheet_n).Cells(PA_row, fnum_col).Value"]
["  HT_f = Worksheets(sheet_n).Cells(HT_row, fnum_col).Value"]
["  DB_f = Worksheets(sheet_n).Cells(DB_row, fnum_col).Value"]
["  WB_f = Worksheets(sheet_n).Cells(WB_row, fnum_col).Value"]
["  RH_f = Worksheets(sheet_n).Cells(RH_row, fnum_col).Value"]
["  AH_f = Worksheets(sheet_n).Cells(AH_row, fnum_col).Value"]
["  ET_f = Worksheets(sheet_n).Cells(ET_row, fnum_col).Value"]
["  SV_f = Worksheets(sheet_n).Cells(SV_row, fnum_col).Value"]
["  DP_f = Worksheets(sheet_n).Cells(DP_row, fnum_col).Value"]
["  PW_f = Worksheets(sheet_n).Cells(PW_row, fnum_col).Value"]
["  XH_f = Worksheets(sheet_n).Cells(XH_row, fnum_col).Value"]
[]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'状態値(入力値以外の計算値)を消去する"]
["'□□□□□□□□□□"]
["Sub ClearAP()"]
["'Public sheet_n As String"]
["'Public data_col As Integer"]
["'Public PA_row As Integer"]
["'Public HT_row As Integer"]
["'Public DB_row As Integer"]
["'Public WB_row As Integer"]
["'Public RH_row As Integer"]
["'Public AH_row As Integer"]
["'Public ET_row As Integer"]
["'Public SV_row As Integer"]
["'Public DP_row As Integer"]
["'Public flgP_row As Integer"]
["'Public PWS_row As Integer"]
["'Public PW_row As Integer"]
["'Public XH_row As Integer"]
["  "]
["'単位、小数桁などを初期化する"]
["  Call IniVal"]
["  "]
["'状態値(入力値以外を消す)"]
["If PA_s = \"\" Then Worksheets(sheet_n).Cells(PA_row, data_col).Value = \"\""]
["If HT_s = \"\" Then Worksheets(sheet_n).Cells(HT_row, data_col).Value = \"\""]
["If DB_s = \"\" Then Worksheets(sheet_n).Cells(DB_row, data_col).Value = \"\""]
["If WB_s = \"\" Then Worksheets(sheet_n).Cells(WB_row, data_col).Value = \"\""]
["If RH_s = \"\" Then Worksheets(sheet_n).Cells(RH_row, data_col).Value = \"\""]
["If AH_s = \"\" Then Worksheets(sheet_n).Cells(AH_row, data_col).Value = \"\""]
["If ET_s = \"\" Then Worksheets(sheet_n).Cells(ET_row, data_col).Value = \"\""]
["If SV_s = \"\" Then Worksheets(sheet_n).Cells(SV_row, data_col).Value = \"\""]
["If DP_s = \"\" Then Worksheets(sheet_n).Cells(DP_row, data_col).Value = \"\""]
["If flgP_s = \"\" Then Worksheets(sheet_n).Cells(flgP_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(PWS_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(PW_row, data_col).Value = \"\""]
["  Worksheets(sheet_n).Cells(XH_row, data_col).Value = \"\""]
["  "]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'状態値(計算値)を出力する"]
["'□□□□□□□□□□"]
["Sub OutAP()"]
["'Public sheet_n As String"]
["'Public data_col As Integer"]
["'Public PA_row As Integer"]
["'Public HT_row As Integer"]
["'Public DB_row As Integer"]
["'Public WB_row As Integer"]
["'Public RH_row As Integer"]
["'Public AH_row As Integer"]
["'Public ET_row As Integer"]
["'Public SV_row As Integer"]
["'Public DP_row As Integer"]
["'Public PWS_row As Integer"]
["'Public PW_row As Integer"]
["'Public XH_row As Integer"]
[]
["'状態値(計算値)"]
["'数値→文字"]
["  Worksheets(sheet_n).Cells(PA_row, data_col).Value = CStr(Round(PA_d, PA_f))"]
["  Worksheets(sheet_n).Cells(HT_row, data_col).Value = CStr(Round(HT_d, HT_f))"]
["  Worksheets(sheet_n).Cells(DB_row, data_col).Value = CStr(Round(DB_d, DB_f))"]
["  Worksheets(sheet_n).Cells(WB_row, data_col).Value = CStr(Round(WB_d, WB_f))"]
["  Worksheets(sheet_n).Cells(RH_row, data_col).Value = CStr(Round(RH_d, RH_f))"]
["  Worksheets(sheet_n).Cells(AH_row, data_col).Value = CStr(Round(AH_d, AH_f))"]
["  Worksheets(sheet_n).Cells(ET_row, data_col).Value = CStr(Round(ET_d, ET_f))"]
["  Worksheets(sheet_n).Cells(SV_row, data_col).Value = CStr(Round(SV_d, SV_f))"]
["  Worksheets(sheet_n).Cells(DP_row, data_col).Value = CStr(Round(DP_d, DP_f))"]
["  Worksheets(sheet_n).Cells(flgP_row, data_col).Value = flgP_s"]
["  Worksheets(sheet_n).Cells(PWS_row, data_col).Value = CStr(Round(PWS_d, PW_f))"]
["  Worksheets(sheet_n).Cells(PW_row, data_col).Value = CStr(Round(PW_d, PW_f))"]
["  Worksheets(sheet_n).Cells(XH_row, data_col).Value = CStr(Round(XH_d, XH_f))"]
[]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'入力値を取得し、計算し、出力する"]
["'□□□□□□□□□□"]
["Sub ShowAP()"]
["'Public Const flg_uni As String = \"S\" 'G(重力) or S(SI)"]
["'Public PA_s As String"]
["'Public HT_s As String"]
["'Public DB_s As String"]
["'Public WB_s As String"]
["'Public RH_s As String"]
["'Public AH_s As String"]
["'Public XH_s As String"]
["'Public ET_s As String"]
["'Public SV_s As String"]
["'Public DP_s As String"]
["'Public flgP_s As String"]
[]
["'Public PA_d As String"]
["'Public PA0_d As String"]
["'Public flgP_d As string"]
["'Public flgP0_d As string"]
[]
["'Public sheet_n As String"]
["'Public data_col As Integer"]
["'Public PA_row As Integer"]
["'Public DB_row As Integer"]
["'Public WB_row As Integer"]
["'Public RH_row As Integer"]
["'Public AH_row As Integer"]
["'Public XH_row As Integer"]
["'Public ET_row As Integer"]
["'Public SV_row As Integer"]
["'Public DP_row As Integer"]
["'Public flgP_row As Integer"]
["'Public PWS_row As Integer"]
["'Public PW_row As Integer"]
["  "]
["'変数を初期化"]
["  Call IniVal"]
["  "]
["  Call HT_PA_Check"]
["  Call PA_HT_Check"]
["  Call PWS_DB_Check"]
[]
["'値と小数桁の入力値を取得"]
["  Call InAP"]
[]
["'大気圧を確認する"]
["If PA_s = \"\" And HT_s = \"\" Then"]
["  PA_d = PA0_d"]
["ElseIf PA_s <> \"\" Then"]
["  PA_d = CDbl(PA_s) 'PA_dはS単位"]
["  HT_d = HT_PA(PA_d)"]
["ElseIf HT_s <> \"\" Then"]
["  HT_d = CDbl(HT_s)"]
["  PA_d = PA_HT(HT_d) 'PA_dはS単位"]
["End If"]
[]
["'水蒸気圧計算方法を確認する"]
["If flgP_s = \"\" Then"]
["  flgP_d = flgP0_d"]
["Else"]
["  flgP_d = flgP_s"]
["End If"]
[]
["'S->G"]
["If flg_uni = \"S\" Then"]
["  PA0_d = XU_P(PA0_d, \"SG\")"]
["  PA_d = XU_P(PA_d, \"SG\")"]
["End If"]
[]
["'状態値を計算"]
["'Public ary_tmp(0 To 9) As Double"]
["  Call GetAP(DB_s, WB_s, RH_s, AH_s, ET_s, SV_s, DP_s)"]
["  DB_d = ary_tmp(0)"]
["  WB_d = ary_tmp(1)"]
["  RH_d = ary_tmp(2)"]
["  AH_d = ary_tmp(3)"]
["  ET_d = ary_tmp(4)"]
["  SV_d = ary_tmp(5)"]
["  PWS_d = ary_tmp(6)"]
["  PW_d = ary_tmp(7)"]
["  DP_d = ary_tmp(8)"]
["  XH_d = ary_tmp(9)"]
[]
["'G->S"]
["If flg_uni = \"S\" Then"]
["  PA0_d = XU_P(PA0_d, \"GS\")"]
["  PA_d = XU_P(PA_d, \"GS\")"]
["End If"]
[]
["'結果を表示"]
["  Call OutAP"]
["  "]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'乾球温度、湿球温度、相対湿度、絶対湿度、比エンタルピ、比容積を相互変換する"]
["'□□□□□□□□□□"]
["Sub GetAP(DB_s As String, WB_s As String, RH_s As String, AH_s As String, ET_s As String, SV_s As String, DP_s As String)"]
["'Public PA_s As String, PA_d As Double, PA_f As Integer"]
["'Public DB_s As String, DB_d As Double, DB_f As Integer"]
["'Public WB_s As String, WB_d As Double, WB_f As Integer"]
["'Public RH_s As String, RH_d As Double, RH_f As Integer"]
["'Public AH_s As String, AH_d As Double, AH_f As Integer"]
["'Public ET_s As String, ET_d As Double, ET_f As Integer"]
["'Public SV_s As String, SV_d As Double, SV_f As Integer"]
["'Public DP_s As String, DP_d as Double, DP_f As Integer"]
["'Public PWS_s As String, PWS_d As Double, PWS_f As Integer"]
["'Public PW_s As String, PW_d As Double, PW_f As Double"]
["'Public XH_s As String, XH_d As Double, XH_f As Integer"]
[]
["'文字->数値"]
["If DB_s <> \"\" Then DB_d = CDbl(DB_s)"]
["If WB_s <> \"\" Then WB_d = CDbl(WB_s)"]
["If RH_s <> \"\" Then RH_d = CDbl(RH_s)"]
["If AH_s <> \"\" Then AH_d = CDbl(AH_s)"]
["If ET_s <> \"\" Then ET_d = CDbl(ET_s)"]
["If SV_s <> \"\" Then SV_d = CDbl(SV_s)"]
["If DP_s <> \"\" Then"]
["  DP_d = CDbl(DP_s)"]
["  AH_s = CStr(AH_DP(DP_d)) '露点温度->絶対湿度"]
["End If"]
[]
["'S->G"]
["If flg_uni = \"S\" Then"]
["'  PA0_d = XU_P(PA0_d, \"SG\")"]
["'  PA_s = XU_P(PA_d, \"SG\")"]
["If ET_s <> \"\" Then"]
["  ET_d = XU_H(ET_d, \"SG\")"]
["End If"]
["End If"]
[]
["'状態値を計算する"]
["If DB_s <> \"\" And WB_s <> \"\" Then"]
["  RH_s = \"\": AH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  AH_d = AH_DBWB(DB_d, WB_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf DB_s <> \"\" And RH_s <> \"\" Then"]
["  WB_s = \"\": AH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_PWSRH(PWS_d, RH_d) '水蒸気圧"]
["  AH_d = AH_PW(PW_d)           '絶対湿度"]
["'20230131  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf DB_s <> \"\" And AH_s <> \"\" Then"]
["  WB_s = \"\": RH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf DB_s <> \"\" And ET_s <> \"\" Then"]
["  WB_s = \"\": RH_s = \"\": AH_s = \"\": SV_s = \"\": DP_s = \"\""]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  AH_d = AH_DBET(DB_d, ET_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf DB_s <> \"\" And SV_s <> \"\" Then"]
["  WB_s = \"\": RH_s = \"\": AH_s = \"\": ET_s = \"\": DP_s = \"\""]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  AH_d = AH_DBSV(DB_d, SV_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf WB_s <> \"\" And RH_s <> \"\" Then"]
["  DB_s = \"\": AH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = DB_WBRH(WB_d, RH_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_PWSRH(PWS_d, RH_d) '水蒸気圧"]
["  AH_d = AH_PW(PW_d)           '絶対湿度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf WB_s <> \"\" And AH_s <> \"\" Then"]
["  DB_s = \"\": RH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = DB_WBAH(WB_d, AH_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf WB_s <> \"\" And ET_s <> \"\" Then"]
["  DB_s = \"\": RH_s = \"\": AH_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = DB_WBET(WB_d, ET_d)   '乾球温度"]
["  AH_d = AH_DBET(DB_d, ET_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf WB_s <> \"\" And SV_s <> \"\" Then"]
["  DB_s = \"\": RH_s = \"\": AH_s = \"\": ET_s = \"\": DP_s = \"\""]
["  DB_d = DB_WBSV(WB_d, SV_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  AH_d = AH_DBWB(DB_d, WB_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf RH_s <> \"\" And AH_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  PWS_d = PWS_PWRH(PW_d, RH_d) '飽和水蒸気圧"]
["  DB_d = DB_PS(PWS_d)          '乾球温度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf RH_s <> \"\" And ET_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": AH_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = DB_RHET(RH_d, ET_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_PWSRH(PWS_d, RH_d) '水蒸気圧"]
["  AH_d = AH_PW(PW_d)           '絶対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf RH_s <> \"\" And SV_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": AH_s = \"\": ET_s = \"\": DP_s = \"\""]
["  DB_d = DB_RHSV(RH_d, SV_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_PWSRH(PWS_d, RH_d) '水蒸気圧"]
["  AH_d = AH_PW(PW_d)           '絶対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf AH_s <> \"\" And ET_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": RH_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = DB_AHET(AH_d, ET_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  SV_d = SV_DBAH(DB_d, AH_d)   '比容積"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf AH_s <> \"\" And SV_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": RH_s = \"\": ET_s = \"\": DP_s = \"\""]
["  DB_d = DB_AHSV(AH_d, SV_d)   '乾球温度"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  ET_d = ET_DBAH(DB_d, AH_d)   '比エンタルピ"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["ElseIf ET_s <> \"\" And SV_s <> \"\" Then"]
["  DB_s = \"\": WB_s = \"\": RH_s = \"\": AH_s = \"\": DP_s = \"\""]
["  DB_d = DB_ETSV(ET_d, SV_d)   '乾球温度"]
["  AH_d = AH_DBSV(DB_d, SV_d)   '絶対湿度"]
["  PW_d = PW_AH(AH_d)           '水蒸気圧"]
["  PWS_d = PWS_DB(DB_d)         '飽和水蒸気圧"]
["  RH_d = RH_PWSPW(PWS_d, PW_d) '相対湿度"]
["'20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["  WB_d = WB_DBRH(DB_d, RH_d)   '湿球温度"]
["  DP_d = DB_PS(PW_d)           '露点温度"]
["Else"]
["  DB_s = \"\": WB_s = \"\": RH_s = \"\": AH_s = \"\": ET_s = \"\": SV_s = \"\": DP_s = \"\""]
["  DB_d = 0#"]
["  WB_d = 0#"]
["  RH_d = 0#"]
["  AH_d = 0#"]
["  ET_d = 0#"]
["  SV_d = 0#"]
["  PWS_d = 0#"]
["  PW_d = 0#"]
["  DP_d = 0#"]
["  XH_d = 0#"]
["End If"]
[]
["  XH_d = XH_PWSPW(PWS_d, PW_d)"]
[]
["'G->S"]
["If flg_uni = \"S\" Then"]
["'  PA0_d = XU_P(PA0_d, \"GS\")"]
["'  PA_d = XU_P(PA_d, \"GS\")"]
["  ET_d = XU_H(ET_d, \"GS\")"]
["  PWS_d = XU_P(PWS_d, \"GS\")"]
["  PW_d = XU_P(PW_d, \"GS\")"]
["End If"]
["  "]
["'Public ary_tmp(0 To 9) As Double"]
["  ary_tmp(0) = DB_d"]
["  ary_tmp(1) = WB_d"]
["  ary_tmp(2) = RH_d"]
["  ary_tmp(3) = AH_d"]
["  ary_tmp(4) = ET_d"]
["  ary_tmp(5) = SV_d"]
["  ary_tmp(6) = PWS_d"]
["  ary_tmp(7) = PW_d"]
["  ary_tmp(8) = DP_d"]
["  ary_tmp(9) = XH_d"]
["  "]
["End Sub"]
[]
["'□□□□□□□□□□"]
["'常用対数を計算する"]
["'□□□□□□□□□□"]
["Function Log10(x As Double) As Double"]
["'VBAのLogは自然対数を返す"]
["Dim y As Double"]
[]
["  y = Log(x) / Log(10#)"]
["  "]
["Log10 = y"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'単位を換算する"]
["'□□□□□□□□□□"]
[]
["'圧力(大気圧、水蒸気圧)[kPa←→mmHg]"]
["Function XU_P(val_1 As Double, flg_tmp As String) As Double"]
["'Public Const PA0_dg As Double = 760#"]
["'Public Const PA0_ds As Double = 101.325 'XU_P(PA0_dg, \"GS\")"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
[]
["  val_2 = PA0_ds / PA0_dg"]
["If flg_tmp = \"GS\" Then"]
["  val_3 = val_1 * val_2"]
["ElseIf flg_tmp = \"SG\" Then"]
["  val_3 = val_1 / val_2"]
["End If"]
[]
["XU_P = val_3"]
["End Function"]
[]
["'熱量(比エンタルピ、熱水分比)[kJ←→kcal]"]
["Function XU_H(val_1 As Double, flg_tmp As String) As Double"]
["'Public Const HQw_d As Double = 1#"]
["'Public Const HQw_u As String = \"[kWh]\""]
["'Public Const HQc_d As Double = 860#"]
["'Public Const HQc_u As String = \"[kcal]\""]
["'Public Const HQj_d As Double = 3600#"]
["'Public Const HQj_u As String = \"[kJ]\""]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
[]
["'1[kWh] = 3600[kJ] = 860[kcal]"]
["  val_2 = HQj_d / HQc_d '4.186"]
["If flg_tmp = \"GS\" Then"]
["  val_3 = val_1 * val_2"]
["ElseIf flg_tmp = \"SG\" Then"]
["  val_3 = val_1 / val_2"]
["End If"]
["  "]
["XU_H = val_3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'海抜高さと大気圧の関係"]
["'□□□□□□□□□□"]
[]
["'大気圧→海抜高さ"]
["Function HT_PA(PA_d As Double) As Double"]
["'Public PA0_ds As Double"]
["Dim val_1 As Double"]
[]
["'S単位"]
["'海抜高度HT[m]、海抜0mでの気圧PA0[hPa]、海抜HTmでの気圧PA[hPa]"]
["'HT= 18410.0 * (Log10(PA0) - Log10(PA))"]
[]
["  val_1 = 18410# * (Log10(PA0_ds) - Log10(PA_d))"]
["  "]
["  HT_PA = val_1"]
["End Function"]
[]
["'試算"]
["Sub HT_PA_Check()"]
["'Public Const Check_row As Integer = 1"]
["'Public Const HT_PA_col As Integer = 1"]
["'Public PA0_ds As Double"]
["Dim PA_d As Double"]
["Dim PA_d_max As Double"]
["Dim PA_d_step As Double"]
["Dim HT_d As Double"]
["Dim i_row As Integer"]
["Dim i_col As Integer"]
[]
["  PA_d = PA0_ds"]
["  PA_d_max = 0#"]
["  PA_d_step = (PA_d_max - PA_d) / 20#"]
["  i_row = Check_row"]
["  i_col = HT_PA_col"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = PA_n"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_n"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = HT_n"]
["  i_row = i_row + 1"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = PA_us"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_ug"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = HT_u"]
["  i_row = i_row + 1"]
["Do While (PA_d >= PA_d_max)"]
["  HT_d = HT_PA(PA_d)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = Round(PA_d, PA_f0s)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = Round(XU_P(PA_d, \"SG\"), PA_f0g)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = Round(HT_d, HT_f)"]
["  PA_d = PA_d + PA_d_step"]
["  i_row = i_row + 1"]
["Loop"]
[]
["End Sub"]
[]
["'海抜高さ→大気圧"]
["Function PA_HT(HT_d As Double) As Double"]
["'Public PA0_ds As Double"]
["Dim val_1 As Double"]
[]
["'S単位"]
["'海抜高度HT[m]、海抜0mでの気圧PA0[hPa]、海抜HTmでの気圧PA[hPa]"]
["'HT= 18410.0 * (Log10(PA0) - Log10(PA))"]
["'Log10(PA)= Log10(PA0) - (HT / 18410.0)"]
[]
["  val_1 = Log10(PA0_ds) - (HT_d / 18410#)"]
["  val_1 = 10# ^ val_1"]
[]
["  PA_HT = val_1"]
["End Function"]
[]
["'試算"]
["Sub PA_HT_Check()"]
["'Public Const Check_row As Integer = 1"]
["'Public Const PA_HT_col As Integer = 4"]
["'Public HT0_d As Double"]
["Dim HT_d As Double"]
["Dim HT_d_max As Double"]
["Dim HT_d_step As Double"]
["Dim PA_d As Double"]
["Dim i_row As Integer"]
["Dim i_col As Integer"]
[]
["  HT_d = HT0_d"]
["  HT_d_max = 10000#"]
["  HT_d_step = (HT_d_max - HT_d) / 20#"]
["  i_row = Check_row"]
["  i_col = PA_HT_col"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = HT_n"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_n"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PA_n"]
["  i_row = i_row + 1"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = HT_u"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_us"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PA_ug"]
["  i_row = i_row + 1"]
["Do While (HT_d <= HT_d_max)"]
["  PA_d = PA_HT(HT_d)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = Round(HT_d, HT_f)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = Round(PA_d, PA_f0s)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = Round(XU_P(PA_d, \"SG\"), PA_f0g)"]
["  HT_d = HT_d + HT_d_step"]
["  i_row = i_row + 1"]
["Loop"]
[]
["End Sub"]
[]
["'海抜高さ、乾球温度→大気圧"]
["Function PA_HTDB(HT_d As Double, DB_d As Double) As Double"]
["'Public AT0_d As Double"]
["'Public PA0_ds As Double"]
["Dim val_1 As Double"]
[]
["'S単位"]
["'海抜高度HT[m]、海抜0mの気圧PA0[hPa]、海抜HTmの絶対温度AT[degK]、海抜HTmの気圧PA[hPa]"]
["'PA= PA0 * (1 - ((0.0065 * HT) / ((0.0065 * HT) + AT))))^5.257"]
[]
["  val_1 = (1 - ((0.0065 * HT_d) / ((0.0065 * HT_d) + (DB_d + AT0_d)))) ^ 5.257"]
["  val_1 = PA0_ds * val_1"]
[]
["  PA_HTDB = val_1"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と飽和水蒸気圧の関係"]
["'□□□□□□□□□□"]
[]
["'乾球温度→飽和水蒸気圧"]
["Function PWS_DB(DB_d As Double) As Double"]
["'Public PA_d As Double"]
["'Public PA0_d As Double"]
["'Public flgP_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
[]
["'下記の3式は標準大気圧下の値"]
["If flgP_d = flgPg_d Then 'ゴフ・グラッチ"]
["  val_1 = PWS_DB_byGG(DB_d)"]
["ElseIf flgP_d = flgPw_d Then 'ウェクスラー・ハイランド"]
["  val_1 = PWS_DB_byWH(DB_d)"]
["ElseIf flgP_d = flgPt_d Then 'テーテンス"]
["  val_1 = PWS_DB_byT(DB_d)"]
["End If"]
[]
["  val_2 = PA_d / PA0_d '圧力による飽和水蒸気圧の補正"]
["  val_1 = val_1 * val_2"]
["'S->G変換"]
["  val_3 = XU_P(val_1, \"SG\")"]
[]
["  PWS_DB = val_3"]
["End Function"]
[]
["'試算"]
["Sub PWS_DB_Check()"]
["'Public Const Check_row As Integer = 1"]
["'Public Const PWS_DB_col As Integer = 7"]
["'Public HT0_d As Double"]
["Dim DB_d As Double"]
["Dim DB_d_max As Double"]
["Dim DB_d_step As Double"]
["Dim PWS_d As Double"]
["Dim i_row As Integer"]
["Dim i_col As Integer"]
["Dim i As Integer"]
["  "]
["For i = 1 To 3"]
["If i = 1 Then"]
["  flgP_d = flgPg_d 'ゴフ・グラッチ"]
["ElseIf i = 2 Then"]
["  flgP_d = flgPw_d 'ウェクスラー・ハイランド"]
["ElseIf i = 3 Then"]
["  flgP_d = flgPt_d 'テーテンス"]
["End If"]
["  "]
["  DB_d = 0#"]
["  DB_d_max = 100#"]
["  DB_d_step = (DB_d_max - DB_d) / 20#"]
["  i_row = Check_row"]
["  i_col = PWS_DB_col + (i - 1) * 3"]
["  "]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = DB_n"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PWS_n & \" by \" & flgP_d"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PWS_n & \" by \" & flgP_d"]
["  i_row = i_row + 1"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = DB_u"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PW_us"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PW_ug"]
["  i_row = i_row + 1"]
["Do While (DB_d <= DB_d_max)"]
["  PWS_d = PWS_DB(DB_d)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col).Value = Round(DB_d, DB_f)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = Round(XU_P(PWS_d, \"GS\"), PW_f0s)"]
["  Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = Round(PWS_d, PW_f0g)"]
["  DB_d = DB_d + DB_d_step"]
["  i_row = i_row + 1"]
["Loop"]
["Next i"]
[]
["End Sub"]
[]
["'乾球温度→飽和水蒸気圧/ゴフ・グラッチ(Goff-Gratch)の式"]
["Function PWS_DB_byGG(DB_d As Double) As Double"]
["'Public AT0_d As Double"]
["'Public PA0_dg As Double"]
["Dim AT_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["Dim val_4 As Double"]
["Dim val_5 As Double"]
["Dim val_6 As Double"]
["Dim val_7 As Double"]
["  "]
["'S単位"]
["'PWS:飽和水蒸気圧[hPa]、AT[度K] = 273.15[度K] + DB、DB:乾球温度[度C]"]
["'DB > 0 :"]
["'Log10(PWS)"]
["'= -7.90298 * (373.16 / AT - 1)"]
["'+  5.02808 * Log(373.16 / AT)"]
["'-  1.3816  * 10^-7 * (10^ (11.344 * (1 - AT / 373.16)) -1)"]
["'+  8.1328  * 10^-3 * (10^ (- 3.49149 * (373.16 / AT -1)) -1)"]
["'+  Log(1013.246)"]
["'DB <=0 :"]
["'Log10(PWS)"]
["'= -9.09718  * (273.16 / AT - 1)"]
["'-  3.56654  * Log(273.16 / AT)"]
["'+  0.876793 * (1 - AT / 273.16)"]
["'+  Log(6.1071)"]
["  "]
["'S単位"]
["  AT_d = AT0_d + DB_d"]
["If DB_d > 0# Then"]
["  val_1 = 373.16 / AT_d"]
["  val_2 = -7.90298 * (val_1 - 1#)"]
["  val_3 = 5.02808 * Log10(val_1)"]
["  val_4 = -1.3816 * 10# ^ -7# * (10# ^ (11.344 * (1 - 1# / val_1)) - 1#)"]
["  val_5 = 8.1328 * 10# ^ -3# * (10# ^ (-3.49149 * (val_1 - 1#)) - 1#)"]
["  val_6 = Log10(1013.246)"]
["Else"]
["  val_1 = 273.16 / AT_d"]
["  val_2 = -9.09718 * (val_1 - 1#)"]
["  val_3 = -3.56654 * Log10(val_1)"]
["  val_4 = 0.876793 * (1# - 1# / val_1)"]
["  val_5 = 0#"]
["  val_6 = Log10(6.1071)"]
["End If"]
["  val_7 = val_2 + val_3 + val_4 + val_5 + val_6"]
["  val_7 = 10# ^ val_7"]
["  val_7 = val_7 / 10# '[kPa]"]
[]
["  PWS_DB_byGG = val_7"]
["End Function"]
[]
["'乾球温度→飽和水蒸気圧/ウェクスラー・ハイランド(Wexler-Hyland)の式"]
["Function PWS_DB_byWH(DB_d As Double) As Double"]
["'Public AT0_d As Double"]
["Dim AT_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["Dim val_4 As Double"]
["Dim val_5 As Double"]
["Dim val_6 As Double"]
["Dim val_7 As Double"]
["Dim val_8 As Double"]
["  "]
["'S単位"]
["'PWS:飽和水蒸気圧[Pa]、AT[度K] = 273.15[度K] + DB、DB:乾球温度[度C]"]
["'水と接する(乾球温度が0.01℃以上)時:"]
["'DB >= 0.01 :"]
["'LogE(PWS)"]
["'= -0.58002206 * 10^4   / AT"]
["'+  0.13914993 * 10"]
["'-  0.48640239 * 10^-1  * AT"]
["'+  0.41764768 * 10^-4  * AT^2"]
["'-  0.14452093 * 10^-7  * AT^3"]
["'+  0.65459673 * 10     * ln(AT)"]
["'DB < 0.01(氷と接する時):"]
["'LogE(PWS)"]
["'= -0.56745359 * 10^4   / AT"]
["'+  0.63925247 * 10"]
["'-  0.96778430 * 10^-2  * AT"]
["'+  0.62215701 * 10^-6  * AT^2"]
["'+  0.20747825 * 10^-8  * AT^3"]
["'-  0.94840240 * 10^-12 * AT^4"]
["'+  0.41635019 * 10     * ln(AT)"]
["  "]
["'S単位"]
["  AT_d = AT0_d + DB_d"]
["If DB_d >= 0.01 Then"]
["  val_1 = -0.58002206 * 10# ^ 4 / AT_d"]
["  val_2 = 0.13914993 * 10#"]
["  val_3 = -0.48640239 * 10# ^ -1 * AT_d"]
["  val_4 = 0.41764768 * 10# ^ -4 * AT_d ^ 2"]
["  val_5 = -0.14452093 * 10# ^ -7 * AT_d ^ 3"]
["  val_6 = 0#"]
["  val_7 = 0.65459673 * 10# * Log(AT_d)"]
["Else"]
["  val_1 = -0.56745359 * 10# ^ 4 / AT_d"]
["  val_2 = 0.63925247 * 10#"]
["  val_3 = -0.9677843 * 10# ^ -2 * AT_d"]
["  val_4 = 0.62215701 * 10# ^ -6 * AT_d ^ 2"]
["  val_5 = 0.20747825 * 10# ^ -8 * AT_d ^ 3"]
["  val_6 = -0.9484024 * 10# ^ -12 * AT_d ^ 4"]
["  val_7 = 0.41635019 * 10# * Log(AT_d)"]
["End If"]
["  val_8 = val_1 + val_2 + val_3 + val_4 + val_5 + val_6 + val_7"]
["  val_8 = Exp(val_8)"]
["  val_8 = val_8 / 1000# '[kPa]"]
["  "]
["  PWS_DB_byWH = val_8"]
["End Function"]
[]
["'乾球温度→飽和水蒸気圧/テーテンス(Tetens)の式"]
["Function PWS_DB_byT(DB_d As Double) As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
[]
["'S単位"]
["'PWS:飽和水蒸気圧[hPa]、DB:乾球温度[度C]"]
["'DB[℃] > 0 :"]
["'Log10(PWS)"]
["'= 7.5 * DB / (DB + 237.3) + 0.7858"]
["'DB[℃] < 0 :"]
["'Log10(PWS)"]
["'= 9.5 * DB / (DB + 265.5) + 0.7858"]
["        "]
["'S単位"]
["If DB_d >= 0# Then"]
["  val_1 = 7.5 * DB_d / (DB_d + 237.3) + 0.7858 '[hPa]"]
["Else"]
["  val_1 = 9.5 * DB_d / (DB_d + 265.5) + 0.7858 '[hPa]"]
["End If"]
["  val_2 = 10# ^ val_1"]
["  val_2 = val_2 / 10# '[kPa]"]
["    "]
["  PWS_DB_byT = val_2"]
["End Function"]
[]
["'飽和水蒸気圧→乾球温度(2分法)"]
["Function DB_PS(PWS_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = PWS_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
[]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = PWS_DB(val_x1)"]
["  val_y2 = PWS_DB(val_x2)"]
["  val_y3 = PWS_DB(val_x3)"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
[]
["  DB_PS = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'水蒸気圧と相対湿度の関係"]
["'□□□□□□□□□□"]
[]
["'飽和水蒸気圧、水蒸気圧→相対湿度"]
["Function RH_PWSPW(PWS_d As Double, PW_d As Double) As Double"]
["Dim val_1 As Double"]
["  "]
["  val_1 = 100# * PW_d / PWS_d"]
["  "]
["  RH_PWSPW = val_1"]
["End Function"]
[]
["'飽和水蒸気圧、相対湿度→水蒸気圧"]
["Function PW_PWSRH(PWS_d As Double, RH_d As Double) As Double"]
["Dim val_1 As Double"]
["  "]
["  val_1 = PWS_d * RH_d / 100#"]
[]
["  PW_PWSRH = val_1"]
["End Function"]
["'水蒸気圧、相対湿度→飽和水蒸気圧"]
["Function PWS_PWRH(PW_d As Double, RH_d As Double) As Double"]
["Dim val_1 As Double"]
["  "]
["  val_1 = PW_d * 100# / RH_d"]
["  "]
["  PWS_PWRH = val_1"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'水蒸気圧と絶対湿度の関係"]
["'□□□□□□□□□□"]
[]
["'水蒸気圧→絶対湿度"]
["Function AH_PW(PW_d As Double) As Double"]
["'Public MA_d As Double"]
["'Public MW_d As Double"]
["'Public PA_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["  "]
["'AH =MW / MA * PW / (PA -PW)"]
["  val_1 = MW_d / MA_d '0.622"]
["  val_2 = val_1 * PW_d / (PA_d - PW_d)"]
[]
["  AH_PW = val_2"]
["End Function"]
[]
["'絶対湿度→水蒸気圧"]
["Function PW_AH(AH_d As Double) As Double"]
["'Public MA_d As Double"]
["'Public MW_d As Double"]
["'Public PA_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
[]
["'PW =PA * AH / (MW / MA + AH)"]
["  val_1 = MW_d / MA_d '0.622"]
["  val_2 = PA_d * AH_d / (val_1 + AH_d)"]
["  "]
["  PW_AH = val_2"]
["End Function"]
[]
["'飽和水蒸気圧、水蒸気圧→飽和度"]
["Function XH_PWSPW(PWS_d As Double, PW_d As Double) As Double"]
["'Public PA_d As Double"]
["'Public XH_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
[]
["  val_1 = PW_d / (PA_d - PW_d) 'AH"]
["  val_2 = PWS_d / (PA_d - PWS_d) 'AHS"]
["  val_3 = (val_1 / val_2) * 100#"]
["  "]
["  XH_PWSPW = val_3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と相対湿度と露点温度の関係"]
["'□□□□□□□□□□"]
[]
["'乾球温度、相対湿度→露点温度(2分法)"]
["Function DP_DBRH(DB_d As Double, RH_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = PW_PWSRH(PWS_DB(DB_d), RH_d)"]
["  val_x1 = TLow_d"]
["  val_x2 = DB_d 'TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = PW_PWSRH(PWS_DB(val_x1), 100#)"]
["  val_y2 = PW_PWSRH(PWS_DB(val_x2), 100#)"]
["  val_y3 = PW_PWSRH(PWS_DB(val_x3), 100#)"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DP_DBRH = val_x3"]
["End Function"]
[]
["'露点温度→絶対湿度"]
["Function AH_DP(DP_d As Double) As Double"]
[]
["  AH_DP = AH_PW(PWS_DB(DP_d))"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と絶対湿度と比エンタルピの関係"]
["'□□□□□□□□□□"]
[]
["'乾球温度、絶対湿度→比エンタルピ"]
["Function ET_DBAH(DB_d As Double, AH_d As Double) As Double"]
["'Public CPA_d As Double"]
["'Public CPW_d As Double"]
["'Public LH_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
[]
["'ET:比エンタルピ[kJ/kg']、DB:乾球温度[degC]、AH:絶対湿度[kg/kg']"]
["'ET= CPA * DB + (CPW * DB + LH) * AH"]
["'ET= 0.24 * DB + (0.441 * DB + 597.3) * AH 'G"]
["'ET= 1.006 * DB + (1.86 * DB + 2501) * AH 'S"]
["  "]
["  val_1 = CPA_d * DB_d"]
["  val_2 = CPW_d * DB_d + LH_d"]
["  val_3 = val_1 + val_2 * AH_d"]
["  "]
["  ET_DBAH = val_3"]
["End Function"]
[]
["'乾球温度、比エンタルピ→絶対湿度"]
["Function AH_DBET(DB_d As Double, ET_d As Double) As Double"]
["'Public CPA_d As Double"]
["'Public CPW_d As Double"]
["'Public LH_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["  val_1 = CPA_d * DB_d"]
["  val_2 = CPW_d * DB_d + LH_d"]
["  val_3 = (ET_d - val_1) / val_2"]
["  "]
["  AH_DBET = val_3"]
["End Function"]
[]
["'絶対湿度、比エンタルピ→乾球温度"]
["Function DB_AHET(AH_d As Double, ET_d As Double) As Double"]
["'Public CPA_d As Double"]
["'Public CPW_d As Double"]
["'Public LH_d As Double"]
["Dim val_1 As Double"]
["  "]
["  val_1 = (ET_d - (LH_d * AH_d)) / (CPA_d + CPW_d * AH_d)"]
[]
["  DB_AHET = val_1"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と絶対湿度と比容積の関係"]
["'□□□□□□□□□□"]
[]
["'乾球温度、絶対湿度→比容積"]
["Function SV_DBAH(DB_d As Double, AH_d As Double) As Double"]
["'Public MW_d As Double"]
["'Public MA_d As Double"]
["'Public AT0_d As Double"]
["'Public PA_d As Double"]
["'Public PA0_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["  val_1 = MW_d / MA_d"]
["  val_2 = PA_d / PA0_d"]
["  val_3 = 0.004555 * (val_1 + AH_d) * (DB_d + AT0_d) / val_2"]
["  "]
["  SV_DBAH = val_3"]
["End Function"]
[]
["'絶対湿度、比容積→乾球温度"]
["Function DB_AHSV(AH_d As Double, SV_d As Double) As Double"]
["'Public MW_d As Double"]
["'Public MA_d As Double"]
["'Public AT0_d As Double"]
["'Public PA_d As Double"]
["'Public PA0_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["  val_1 = MW_d / MA_d"]
["  val_2 = PA_d / PA0_d"]
["  val_3 = SV_d * val_2 / (0.004555 * (val_1 + AH_d)) - AT0_d"]
["  "]
["  DB_AHSV = val_3"]
["End Function"]
[]
["'乾球温度、比容積→絶対湿度"]
["Function AH_DBSV(DB_d As Double, SV_d As Double) As Double"]
["'Public MW_d As Double"]
["'Public MA_d As Double"]
["'Public AT0_d As Double"]
["'Public PA_d As Double"]
["'Public PA0_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["  val_1 = MW_d / MA_d"]
["  val_2 = PA_d / PA0_d"]
["  val_3 = SV_d * val_2 / (0.004555 * (DB_d + AT0_d)) - val_1"]
["  "]
["  AH_DBSV = val_3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と相対湿度と湿球温度の関係"]
["'□□□□□□□□□□"]
[]
["'湿球温度、相対湿度→乾球温度(2分法)"]
["Function DB_WBRH(WB_d As Double, RH_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = RH_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = RH_PWSPW(PWS_DB(val_x1), PW_AH(AH_DBWB(val_x1, WB_d)))"]
["  val_y2 = RH_PWSPW(PWS_DB(val_x2), PW_AH(AH_DBWB(val_x2, WB_d)))"]
["  val_y3 = RH_PWSPW(PWS_DB(val_x3), PW_AH(AH_DBWB(val_x3, WB_d)))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_WBRH = val_x3"]
["End Function"]
[]
["'湿球温度、相対湿度→乾球温度(2分法)"]
["Function WB_DBRH(DB_d As Double, RH_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_p As Double"]
["Dim val_a1 As Double"]
["Dim val_a2 As Double"]
["Dim val_a3 As Double"]
["Dim val_b As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["  val_xe = TErr_d '* 0.01"]
["  val_x1 = DP_DBRH(DB_d, RH_d) 'TLow_d"]
["  val_x2 = DB_d 'TUpp_d"]
[]
["'PW(at DB) - PWS(at WB) = - A * PA * (DB-WB) by August"]
["'A=CPA * LH * (MW / MA) = 0.000646"]
["'A=0.000662(WB>=0.01) or 0.000583(WB<0.01) by Sprung"]
["'PWS(at WB) - PW(at DB) - A * PA * (DB-WB) = 0"]
["  val_a1 = 0.000662"]
["  val_a2 = 0.000583"]
["  val_b = 0.01"]
["  "]
["  val_p = PA_d 'Pの単位は同じであればSでもGでも可"]
["  val_1 = PW_PWSRH(PWS_DB(DB_d), RH_d) 'PW(at DB)"]
[]
["Do"]
["If Abs(val_x1 - val_x2) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If val_x3 >= 0.01 + val_b Then"]
["  val_a3 = val_a1"]
["ElseIf val_x3 < 0.01 - val_b Then"]
["  val_a3 = val_a2"]
["Else"]
["  val_a3 = val_a2 + (val_x3 - (0.01 - val_b)) * (val_a1 - val_a2) / (val_b) * 2#"]
["Stop"]
["End If 'val_3"]
[]
["  val_2 = PW_PWSRH(PWS_DB(val_x3), 100#) 'PWS(at WB)"]
["  val_3 = val_2 - val_1 - val_a3 * val_p * (DB_d - val_x3)"]
["If val_3 > 0# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If 'val_3"]
["End If 'Abs"]
["Loop"]
["  "]
["  WB_DBRH = val_x3"]
["End Function"]
[]
["'乾球温度、相対湿度→湿球温度(2分法)"]
["Function WB_DBRH2(DB_d As Double, RH_d As Double) As Double"]
["Dim val_xe As Double"]
["Dim val_p As Double"]
["Dim val_a As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["Dim val_4 As Double"]
["Dim val_5 As Double"]
["Dim i As Integer"]
["  "]
["'PW(at DB) - PWS(at WB) = - A * PA * (DB-WB) by August"]
["'A=CPA * LH * (MW / MA) = 0.000646"]
["'A=0.000662(WB>=0.01) or 0.000583(WB<0.01) by Sprung"]
["  val_xe = TErr_d"]
["  val_p = PA_d 'Pの単位は同じであればSでもGでも可"]
["  val_1 = PW_PWSRH(PWS_DB(DB_d), RH_d) 'PW(at DB)"]
["  val_2 = DB_d 'WB(1)"]
["  i = 0"]
[]
["Do"]
[]
["If val_2 >= 0.01 Then"]
["  val_a = 0.000662"]
["Else"]
["  val_a = 0.000583"]
["End If"]
[]
["'ew-p-0.000662*PA*(DB-WB)"]
["'PWS(at WB) - PW(at DB) - A * PA * (DB-WB) = 0"]
[]
["'PW(at DB) - PWS(at WB) = - A * PA * (DB-WB)"]
["'(PW(at DB) - PWS(at WB)) / (- A * PA) = DB-WB"]
["'WB = DB - (PW(at DB) - PWS(at WB)) / (- A * PA)"]
["'WB = DB + (PW(at DB) - PWS(at WB)) / (A * PA)"]
["  val_3 = PW_PWSRH(PWS_DB(val_2), 100#) 'PWS(at WB)"]
["  val_4 = DB_d + (val_1 - val_3) / (val_a * val_p) 'WB(2)"]
["  val_5 = PW_PWSRH(PWS_DB(val_4), 100#) 'PWS(at WB)"]
["If Abs(val_3 - val_5) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_2 = val_4"]
["  i = i + 1"]
["If i = 100 Then"]
["If MsgBox(\"100 times\", vbOKCancel) = 2 Then"]
["  Stop"]
["Else"]
["  i = 0"]
["End If"]
["End If"]
["End If"]
["Loop"]
["  "]
["  WB_DBRH = val_2"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'湿球温度と比エンタルピの関係"]
["'□□□□□□□□□□"]
[]
["'湿球温度→水または氷の比エンタルピ"]
["Function ET_WB(WB_d As Double) As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["  "]
["'h - hs' = (x - xs') * hc'"]
["'hs'= cpa * t' + (cpw * t' + r0) * x"]
["'hc'=k1 * t' + k2"]
["'h  = cpa * t + (cpw * t + r0) * x"]
[]
["'ET = CPA * DB + (CPW * DB + LH) * AH"]
["'WB > 0 : k1 = 1, k2 = 0"]
["'WB<= 0 : k1 = 0.5, k2 = 79.7"]
["If WB_d > 0# Then"]
["  val_1 = 1#"]
["  val_2 = 0#"]
["Else"]
["  val_1 = 0.5"]
["  val_2 = 79.7"]
["End If"]
["  val_3 = val_1 * WB_d + val_2"]
["  "]
["  ET_WB = val_3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と湿球温度と絶対湿度の関係"]
["'□□□□□□□□□□"]
[]
["'湿球温度、絶対湿度→乾球温度"]
["Function DB_WBAH(WB_d As Double, AH_d As Double) As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["Dim val_4 As Double"]
["  "]
["  val_1 = ET_WB(WB_d)"]
["  val_2 = AH_PW(PWS_DB(WB_d))"]
["  val_3 = ET_DBAH(WB_d, val_2)"]
["  val_4 = val_3 + (AH_d - val_2) * val_1"]
["  "]
["  DB_WBAH = DB_AHET(AH_d, val_4)"]
["End Function"]
[]
["'乾球温度、湿球温度→絶対湿度"]
["Function AH_DBWB(DB_d As Double, WB_d As Double) As Double"]
["'Public CPA_d As Double"]
["'Public CPW_d As Double"]
["'Public LH_d As Double"]
["Dim val_1 As Double"]
["Dim val_2 As Double"]
["Dim val_3 As Double"]
["Dim val_4 As Double"]
["Dim val_5 As Double"]
["  "]
["  val_1 = ET_WB(WB_d)"]
["  val_2 = AH_PW(PWS_DB(WB_d))"]
["  val_3 = CPA_d * (WB_d - DB_d) + (CPW_d * WB_d + LH_d) * val_2"]
["  val_4 = CPW_d * DB_d + LH_d"]
["  val_5 = (val_3 - val_2 * val_1) / (val_4 - val_1)"]
["  "]
["  AH_DBWB = val_5"]
["End Function"]
[]
["'乾球温度、絶対湿度→湿球温度(2分法)"]
["Function WB_DBAH(DB_d As Double, AH_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = DB_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = DB_WBAH(val_x1, AH_d)"]
["  val_y2 = DB_WBAH(val_x2, AH_d)"]
["  val_y3 = DB_WBAH(val_x3, AH_d)"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  WB_DBAH = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と湿球温度と比エンタルピの関係"]
["'□□□□□□□□□□"]
[]
["'湿球温度、比エンタルピ→乾球温度(2分法)"]
["Function DB_WBET(WB_d As Double, ET_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = ET_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = ET_DBAH(val_x1, AH_DBWB(val_x1, WB_d))"]
["  val_y2 = ET_DBAH(val_x2, AH_DBWB(val_x2, WB_d))"]
["  val_y3 = ET_DBAH(val_x3, AH_DBWB(val_x3, WB_d))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_WBET = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と湿球温度と比容積の関係"]
["'□□□□□□□□□□"]
[]
["'湿球温度、比容積→乾球温度(2分法)"]
["Function DB_WBSV(WB_d As Double, SV_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = SV_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = SV_DBAH(val_x1, AH_DBWB(val_x1, WB_d))"]
["  val_y2 = SV_DBAH(val_x2, AH_DBWB(val_x2, WB_d))"]
["  val_y3 = SV_DBAH(val_x3, AH_DBWB(val_x3, WB_d))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_WBSV = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と相対湿度と比エンタルピの関係"]
["'□□□□□□□□□□"]
[]
["'相対湿度、比エンタルピ→乾球温度(2分法)"]
["Function DB_RHET(RH_d As Double, ET_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
[]
["  val_xe = TErr_d"]
["  val_yt = ET_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = ET_DBAH(val_x1, AH_PW(PW_PWSRH(PWS_DB(val_x1), RH_d)))"]
["  val_y2 = ET_DBAH(val_x2, AH_PW(PW_PWSRH(PWS_DB(val_x2), RH_d)))"]
["  val_y3 = ET_DBAH(val_x3, AH_PW(PW_PWSRH(PWS_DB(val_x3), RH_d)))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_RHET = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と相対温度と比容積の関係"]
["'□□□□□□□□□□"]
[]
["'相対湿度、比容積→乾球温度(2分法)"]
["Function DB_RHSV(RH_d As Double, SV_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = SV_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = SV_DBAH(val_x1, AH_PW(PW_PWSRH(PWS_DB(val_x1), RH_d)))"]
["  val_y2 = SV_DBAH(val_x2, AH_PW(PW_PWSRH(PWS_DB(val_x2), RH_d)))"]
["  val_y3 = SV_DBAH(val_x3, AH_PW(PW_PWSRH(PWS_DB(val_x3), RH_d)))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_RHSV = val_x3"]
["End Function"]
[]
["'□□□□□□□□□□"]
["'乾球温度と比エンタルピと比容積の関係"]
["'□□□□□□□□□□"]
[]
["'比エンタルピ、比容積→乾球温度(2分法)"]
["Function DB_ETSV(ET_d As Double, SV_d As Double) As Double"]
["'Public TLow_d As Double"]
["'Public TUpp_d As Double"]
["'Public TErr_d As Double"]
["Dim val_xe As Double"]
["Dim val_yt As Double"]
["Dim val_x1 As Double"]
["Dim val_x2 As Double"]
["Dim val_x3 As Double"]
["Dim val_y1 As Double"]
["Dim val_y2 As Double"]
["Dim val_y3 As Double"]
["Dim val_k As Double"]
["  "]
["  val_xe = TErr_d"]
["  val_yt = ET_d"]
["  val_x1 = TLow_d"]
["  val_x2 = TUpp_d"]
["Do"]
["  val_x3 = (val_x1 + val_x2) * 0.5"]
["If Abs(val_x3 - val_x1) <= val_xe Then"]
["  Exit Do"]
["Else"]
["  val_y1 = ET_DBAH(val_x1, AH_DBSV(val_x1, SV_d))"]
["  val_y2 = ET_DBAH(val_x2, AH_DBSV(val_x2, SV_d))"]
["  val_y3 = ET_DBAH(val_x3, AH_DBSV(val_x3, SV_d))"]
["  val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["If val_k < 1# Then"]
["  val_x2 = val_x3"]
["Else"]
["  val_x1 = val_x3"]
["End If"]
["End If"]
["Loop"]
["  "]
["  DB_ETSV = val_x3"]
["End Function"]

{"sheet":"SourceP","index":2,"n_rows":2030,"n_cols":1,"rows_kept":2030,"cut":false,"hidden":false,"merged":[]}
["#□□□□□□□□□□"]
["#変数の宣言"]
["#□□□□□□□□□□"]
["#Option Explicit"]
[]
["#単位系"]
["#重力単位系で計算し、SI単位系と変換する"]
["flg_uni = 'S' #G(重力) or S(SI)"]
[]
["#熱量"]
["#1[J] = 1[Ws], 3600[kJ] =1[kWh] =  860[kcal]"]
["HQw_n = 'kWh'"]
["HQw_d = 1.0"]
["HQw_u = '[kWh]'"]
[]
["HQc_n = 'kcal'"]
["HQc_d = 860.0"]
["HQc_u = '[kcal]'"]
[]
["HQj_n = 'kJ'"]
["HQj_d = 3600.0"]
["HQj_u = '[kJ]'"]
[]
["#物理定数等"]
["GA_n = '重力加速度' #変数名"]
["GA_d = 9.80665 #変数値"]
["GA_u = '[m/s2]' #単位"]
[]
["AT0_n = '摂氏0度の絶対温度'"]
["AT0_d = 273.15"]
["AT0_u = '[degK]'"]
[]
["MA_n = '乾き空気の分子量'"]
["MA_d = 28.964 #545"]
["MA_u = '[kg/kmol]'"]
[]
["MW_n = '水蒸気の分子量'"]
["MW_d = 18.015 #3"]
["MW_u = '[kg/kmol]'"]
[]
["CPA_n = '乾き空気の定圧比熱'"]
["CPA_d = 0.24"]
["CPA_u = '[kcal/kg℃]'"]
["#0.24[kcal/kg℃] * 4.186[kJ/kcal] = 1.0046 =1.006[kJ/kg℃]"]
[]
["CPW_n = '水蒸気の定圧比熱'"]
["CPW_d = 0.441"]
["CPW_u = '[kcal/kg℃]'"]
["#0.441[kcal/kg℃] * 4.186[kJ/kcal] = 1.846 =1.86[kJ/kg℃]"]
[]
["LH_n = '摂氏0度での水の蒸発潜熱'"]
["LH_d = 597.3"]
["LH_u = '[kcal/kg]'"]
["#597.3[kcal/kg] * 4.186[kJ/kcal] = 2500.3 = 2501[kJ/kg]"]
[]
["WRA_n = '乾き空気の比重量'"]
["WRA_d = 1.2"]
["WRA_u = '[kg/m3]'"]
[]
["WRW_n = '水の比重量'"]
["WRW_d = 1000.0"]
["WRW_u = '[kg/m3]'"]
[]
["#湿り空気に関する状態値"]
["PA_n = '大気圧'"]
["PA_s= \"\""]
["PA_d= 0.0"]
["PA0_d= 0.0 #標準大気圧"]
["PA0_dg = 760.0"]
["PA0_ds = 101.325 #XU_P(PA0_dg, \"GS\")"]
["PA_f= 0 #小数桁"]
["PA_f0g = 1"]
["PA_f0s = 3"]
["PA_u= \"\""]
["PA_ug = '[mmHg]'"]
["PA_us = '[kPa]'"]
[]
["HT_n = '海抜高度'"]
["HT_s= \"\""]
["HT_d= 0.0"]
["HT0_d = 0.0"]
["HT_f= 0"]
["HT_f0 = 0"]
["HT_u = '[m]'"]
[]
["DB_n = '乾球温度'"]
["DB_s= \"\""]
["DB_d= 0.0"]
["DB0_d = 24.0"]
["DB_f= 0"]
["DB_f0 = 1"]
["DB_u = '[℃]'"]
[]
["WB_n = '湿球温度'"]
["WB_s= \"\""]
["WB_d= 0.0"]
["WB_f= 0"]
["WB_f0 = 1"]
["WB_u = '[℃]'"]
[]
["RH_n = '相対湿度'"]
["RH_s= \"\""]
["RH_d= 0.0"]
["RH0_d = 50.0"]
["RH_f= 0"]
["RH_f0 = 1"]
["RH_u = '[%]'"]
[]
["AH_n = '絶対湿度'"]
["AH_s= \"\""]
["AH_d= 0.0"]
["AH_f= 0"]
["AH_f0 = 6 #5 '4"]
["AH_u = '[kg/kg-dry]'"]
[]
["ET_n = '比エンタルピ'"]
["ET_s= \"\""]
["ET_d= 0.0"]
["ET_f= 0"]
["ET_f0g = 1"]
["ET_f0s = 1"]
["ET_u= \"\""]
["ET_ug = '[kcal/kg]' #\"[kcal/kgf]\""]
["ET_us = '[kJ/kg]'"]
[]
["SV_n = '比容積'"]
["SV_s= \"\""]
["SV_d= 0.0"]
["SV_f= 0"]
["SV_f0 = 3"]
["SV_u = '[m3/kg-dry]'"]
[]
["DP_n = '露点温度'"]
["DP_s= \"\""]
["DP_d= 0.0"]
["DP_f= 0"]
["DP_f0 = 1"]
["DP_u = '[℃]'"]
[]
["PW_n = '水蒸気圧'"]
["PW_s= 0.0"]
["PW_d= 0.0"]
["PW_f= 0"]
["PW_f0g = 1"]
["PW_f0s = 3"]
["PW_u= \"\""]
["PW_ug = '[mmHg]'"]
["PW_us = '[kPa]'"]
[]
["PWS_n = '飽和水蒸気圧'"]
["PWS_s= 0.0"]
["PWS_d= 0.0"]
[]
["XH_n = '飽和度'"]
["XH_s= 0.0"]
["XH_d= 0.0"]
["XH_f= 0"]
["XH_f0 = 1"]
["XH_u = '[%]'"]
[]
["SH_n = '顕熱比'"]
["SH_s= 0.0"]
["SH_d= 0.0"]
["SH_f= 0"]
["SH0_f = 3"]
["SH_u = '[-]'"]
[]
["UR_n = '熱水分比'"]
["UR_s= 0.0"]
["UR_d= 0.0"]
["UR_f= 0"]
["UR_f0g = 3"]
["UR_f0s = 3"]
["UR_u= \"\""]
["UR_ug = '[kcal/kg]'"]
["UR_us = '[kJ/kg]'"]
[]
["#水蒸気圧計算方法"]
["flgP_n = '水蒸気圧計算方法'"]
["flgP_s= \"\""]
["flgP_d= \"\""]
["flgPg_d = 'ゴフ・グラッチ'"]
["flgPw_d = 'ウェクスラー・ハイランド'"]
["flgPt_d = 'テーテンス'"]
["flgP0_d = flgPw_d #\"ウェクスラー・ハイランド\""]
["flgP_u = '[-]'"]
[]
["#2分法計算条件"]
["TLow_n = '温度下限'"]
["TLow_d = -100.0"]
["TUpp_n = '温度上限'"]
["TUpp_d = 200.0"]
["TErr_n = '許容誤差'"]
["TErr_d = 0.01"]
[]
["#セル座標"]
["sheet_n = 'Main'"]
["name_col = 2"]
["data_col = 3"]
["unit_col = 4"]
["fnum_col = 5 #20230531追加"]
["PA_row = 5"]
["HT_row = 6"]
["DB_row = 7"]
["WB_row = 8"]
["RH_row = 9"]
["AH_row = 10"]
["ET_row = 11"]
["SV_row = 12"]
["DP_row = 13"]
["flgP_row = 14"]
["PWS_row = 15"]
["PW_row = 16"]
["XH_row = 17"]
[]
["sheet2_n = 'Check'"]
["Check_row = 1"]
["HT_PA_col = 1"]
["PA_HT_col = 4"]
["PWS_DB_col = 7"]
[]
["#計算結果"]
["ary_tmp = list(range(0, 9))"]
[]
["#□□□□□□□□□□"]
["#単位、小数桁などを初期化する"]
["#□□□□□□□□□□"]
["def IniVal() :"]
["#Public Const flg_uni As String = \"S\" 'G(重力) or S(SI)"]
[]
["#Public PA0_d As Double"]
["#Public Const PA0_dg As Double = 760.0"]
["#Public Const PA0_ds As Double = 101.325 'XU_P(PA0_dg, \"GS\")"]
["#Public PA_f As Integer '小数点以下の丸め桁数"]
["#Public Const PA_f0g As Integer = 1"]
["#Public Const PA_f0s As Integer = 3"]
["#Public PA_u As String"]
["#Public Const PA_ug As String = \"[mmHg]\""]
["#Public Const PA_us As String = \"[kPa]\""]
["    if flg_uni == 'G'  :"]
["        PA0_d = PA0_dg"]
["        PA_f = PA_f0g"]
["        PA_u = PA_ug"]
["    elif flg_uni == 'S'  :"]
["        PA0_d = PA0_ds"]
["        PA_f = PA_f0s"]
["        PA_u = PA_us"]
["    #end if"]
[]
["#Public HT_f As Integer"]
["#Public Const HT_f0 As Integer = 0"]
["    HT_f = HT_f0"]
[]
["#Public DB_f As Integer"]
["#Public Const DB_f0 As Integer = 1"]
["    DB_f = DB_f0"]
[]
["#Public WB_f As Integer"]
["#Public Const WB_f0 As Integer = 3 '1"]
["    WB_f = WB_f0"]
[]
["#Public RH_f As Integer"]
["#Public Const RH_f0 As Integer = 1"]
["    RH_f = RH_f0"]
[]
["#Public AH_f As Integer"]
["#Public Const AH_f0 As Integer = 8 '5 '4"]
["    AH_f = AH_f0"]
[]
["#Public ET_f As Integer"]
["#Public Const ET_f0g As Integer = 1"]
["#Public Const ET_f0s As Integer = 1"]
["#Public ET_u As String"]
["#Public Const ET_ug As String = \"[kcal/kg]\" '\"[kcal/kgf]\""]
["#Public Const ET_us As String = \"[kJ/kg]\""]
["    if flg_uni == 'G'  :"]
["        ET_f = ET_f0g"]
["        ET_u = ET_ug"]
["    elif flg_uni == 'S'  :"]
["        ET_f = ET_f0s"]
["        ET_u = ET_us"]
["    #end if"]
[]
["#Public SV_f As Integer"]
["#Public Const SV_f0 As Integer = 3"]
["    SV_f = SV_f0"]
[]
["#Public DP_f As Integer"]
["#Public Const DP_f0 As Integer = 1"]
["    DP_f = DP_f0"]
[]
["#Public PW_f As Integer"]
["#Public Const PW_f0g As Integer = 1"]
["#Public Const PW_f0s As Integer = 3"]
["#Public PW_u As String"]
["#Public Const PW_ug As String = \"[mmHg]\""]
["#Public Const PW_us As String = \"[kPa]\""]
["    if flg_uni == 'G'  :"]
["        PW_f = PW_f0g"]
["        PW_u = PW_ug"]
["    elif flg_uni == 'S'  :"]
["        PW_f = PW_f0s"]
["        PW_u = PW_us"]
["    #end if"]
[]
["#Public XH_f As Integer"]
["#Public Const XH_f0 As Integer = 1"]
["    XH_f = XH_f0"]
[]
["#Public UR_f As Integer"]
["#Public Const UR_f0g As Integer = 3"]
["#Public Const UR_f0s As Integer = 3"]
["#Public UR_u As String"]
["#Public Const UR_ug As String = \"[kcal/kg]\""]
["#Public Const UR_us As String = \"[kJ/kg]\""]
["    if flg_uni == 'G'  :"]
["        UR_f = UR_f0g"]
["        UR_u = UR_ug"]
["    elif flg_uni == 'S'  :"]
["        UR_f = UR_f0s"]
["        UR_u = UR_us"]
["    #end if"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#状態値を初期化する"]
["#□□□□□□□□□□"]
["def ResetAP() :"]
["#Public sheet_n As String"]
["#Public name_col As Integer"]
["#Public data_col As Integer"]
["#Public unit_col As Integer"]
["#Public fnum_col As Integer"]
["#Public PA_row As Integer"]
["#Public DB_row As Integer"]
["#Public WB_row As Integer"]
["#Public RH_row As Integer"]
["#Public AH_row As Integer"]
["#Public ET_row As Integer"]
["#Public SV_row As Integer"]
["#Public DP_row As Integer"]
["#Public flgP_row As Integer"]
["#Public PWS_row As Integer"]
["#Public PW_row As Integer"]
["#Public XH_row As Integer"]
[]
["#単位、小数桁などを初期化する"]
["    IniVal"]
[]
["#名前"]
["    Worksheets(sheet_n).Cells(PA_row, name_col).Value = PA_n"]
["    Worksheets(sheet_n).Cells(HT_row, name_col).Value = HT_n"]
["    Worksheets(sheet_n).Cells(DB_row, name_col).Value = DB_n"]
["    Worksheets(sheet_n).Cells(WB_row, name_col).Value = WB_n"]
["    Worksheets(sheet_n).Cells(RH_row, name_col).Value = RH_n"]
["    Worksheets(sheet_n).Cells(AH_row, name_col).Value = AH_n"]
["    Worksheets(sheet_n).Cells(ET_row, name_col).Value = ET_n"]
["    Worksheets(sheet_n).Cells(SV_row, name_col).Value = SV_n"]
["    Worksheets(sheet_n).Cells(DP_row, name_col).Value = DP_n"]
["    Worksheets(sheet_n).Cells(flgP_row, name_col).Value = flgP_n"]
["    Worksheets(sheet_n).Cells(PWS_row, name_col).Value = PWS_n"]
["    Worksheets(sheet_n).Cells(PW_row, name_col).Value = PW_n"]
["    Worksheets(sheet_n).Cells(XH_row, name_col).Value = XH_n"]
[]
["#単位"]
["    Worksheets(sheet_n).Cells(PA_row, unit_col).Value = PA_u"]
["    Worksheets(sheet_n).Cells(HT_row, unit_col).Value = HT_u"]
["    Worksheets(sheet_n).Cells(DB_row, unit_col).Value = DB_u"]
["    Worksheets(sheet_n).Cells(WB_row, unit_col).Value = WB_u"]
["    Worksheets(sheet_n).Cells(RH_row, unit_col).Value = RH_u"]
["    Worksheets(sheet_n).Cells(AH_row, unit_col).Value = AH_u"]
["    Worksheets(sheet_n).Cells(ET_row, unit_col).Value = ET_u"]
["    Worksheets(sheet_n).Cells(SV_row, unit_col).Value = SV_u"]
["    Worksheets(sheet_n).Cells(DP_row, unit_col).Value = DP_u"]
["    Worksheets(sheet_n).Cells(flgP_row, unit_col).Value = flgP_u"]
["    Worksheets(sheet_n).Cells(PWS_row, unit_col).Value = PW_u"]
["    Worksheets(sheet_n).Cells(PW_row, unit_col).Value = PW_u"]
["    Worksheets(sheet_n).Cells(XH_row, unit_col).Value = XH_u"]
[]
["#小数桁"]
["    Worksheets(sheet_n).Cells(PA_row, fnum_col).Value = PA_f"]
["    Worksheets(sheet_n).Cells(HT_row, fnum_col).Value = HT_f"]
["    Worksheets(sheet_n).Cells(DB_row, fnum_col).Value = DB_f"]
["    Worksheets(sheet_n).Cells(WB_row, fnum_col).Value = WB_f"]
["    Worksheets(sheet_n).Cells(RH_row, fnum_col).Value = RH_f"]
["    Worksheets(sheet_n).Cells(AH_row, fnum_col).Value = AH_f"]
["    Worksheets(sheet_n).Cells(ET_row, fnum_col).Value = ET_f"]
["    Worksheets(sheet_n).Cells(SV_row, fnum_col).Value = SV_f"]
["    Worksheets(sheet_n).Cells(DP_row, fnum_col).Value = DP_f"]
["    Worksheets(sheet_n).Cells(PWS_row, fnum_col).Value = PW_f"]
["    Worksheets(sheet_n).Cells(PW_row, fnum_col).Value = PW_f"]
["    Worksheets(sheet_n).Cells(XH_row, fnum_col).Value = XH_f"]
[]
["#状態値(初期値)"]
["    Worksheets(sheet_n).Cells(PA_row, data_col).Value = str(round(PA0_d, PA_f))"]
["    Worksheets(sheet_n).Cells(HT_row, data_col).Value = '' #CStr(Round(HT0_d, HT_f))"]
["    Worksheets(sheet_n).Cells(DB_row, data_col).Value = str(round(DB0_d, DB_f))"]
["    Worksheets(sheet_n).Cells(WB_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(RH_row, data_col).Value = str(round(RH0_d, RH_f))"]
["    Worksheets(sheet_n).Cells(AH_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(ET_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(SV_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(DP_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(flgP_row, data_col).Value = flgP0_d"]
["    Worksheets(sheet_n).Cells(PWS_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(PW_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(XH_row, data_col).Value = ''"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#入力値(状態値と小数桁)を取得する"]
["#□□□□□□□□□□"]
["def InAP() :"]
["#Public sheet_n As String"]
["#Public data_col As Integer"]
["#Public fnum_col As Integer"]
["#Public PA_row As Integer"]
["#Public DB_row As Integer"]
["#Public WB_row As Integer"]
["#Public RH_row As Integer"]
["#Public AH_row As Integer"]
["#Public ET_row As Integer"]
["#Public SV_row As Integer"]
["#Public DP_row As Integer"]
["#Public flgP_row As Integer"]
["#Public PWS_row As Integer"]
["#Public PW_row As Integer"]
["#Public XH_row As Integer"]
[]
["#状態値"]
["#自由入力のため、入力の有無を判定するため文字列で取得する"]
["#Public PA_s As Double"]
["#Public HT_s As Double"]
["#Public DB_s As Double"]
["#Public WB_s As Double"]
["#Public RH_s As Double"]
["#Public AH_s As Double"]
["#Public ET_s As Double"]
["#Public SV_s As Double"]
["#Public DP_s As Double"]
["#Public flgP_s As String"]
["    PA_s = Worksheets(sheet_n).Cells(PA_row, data_col).Text"]
["    HT_s = Worksheets(sheet_n).Cells(HT_row, data_col).Text"]
["    DB_s = Worksheets(sheet_n).Cells(DB_row, data_col).Text"]
["    WB_s = Worksheets(sheet_n).Cells(WB_row, data_col).Text"]
["    RH_s = Worksheets(sheet_n).Cells(RH_row, data_col).Text"]
["    AH_s = Worksheets(sheet_n).Cells(AH_row, data_col).Text"]
["    ET_s = Worksheets(sheet_n).Cells(ET_row, data_col).Text"]
["    SV_s = Worksheets(sheet_n).Cells(SV_row, data_col).Text"]
["    DP_s = Worksheets(sheet_n).Cells(DP_row, data_col).Text"]
["    flgP_s = Worksheets(sheet_n).Cells(flgP_row, data_col).Text"]
[]
["#小数桁"]
["#Public PA_f As Integer"]
["#Public HT_f As Integer"]
["#Public DB_f As Integer"]
["#Public WB_f As Integer"]
["#Public RH_f As Integer"]
["#Public AH_f As Integer"]
["#Public ET_f As Integer"]
["#Public SV_f As Integer"]
["#Public DP_f As Integer"]
["#Public PW_f As Integer"]
["#Public XH_f As Integer"]
["    PA_f = Worksheets(sheet_n).Cells(PA_row, fnum_col).Value"]
["    HT_f = Worksheets(sheet_n).Cells(HT_row, fnum_col).Value"]
["    DB_f = Worksheets(sheet_n).Cells(DB_row, fnum_col).Value"]
["    WB_f = Worksheets(sheet_n).Cells(WB_row, fnum_col).Value"]
["    RH_f = Worksheets(sheet_n).Cells(RH_row, fnum_col).Value"]
["    AH_f = Worksheets(sheet_n).Cells(AH_row, fnum_col).Value"]
["    ET_f = Worksheets(sheet_n).Cells(ET_row, fnum_col).Value"]
["    SV_f = Worksheets(sheet_n).Cells(SV_row, fnum_col).Value"]
["    DP_f = Worksheets(sheet_n).Cells(DP_row, fnum_col).Value"]
["    PW_f = Worksheets(sheet_n).Cells(PW_row, fnum_col).Value"]
["    XH_f = Worksheets(sheet_n).Cells(XH_row, fnum_col).Value"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#状態値(入力値以外の計算値)を消去する"]
["#□□□□□□□□□□"]
["def ClearAP() :"]
["#Public sheet_n As String"]
["#Public data_col As Integer"]
["#Public PA_row As Integer"]
["#Public HT_row As Integer"]
["#Public DB_row As Integer"]
["#Public WB_row As Integer"]
["#Public RH_row As Integer"]
["#Public AH_row As Integer"]
["#Public ET_row As Integer"]
["#Public SV_row As Integer"]
["#Public DP_row As Integer"]
["#Public flgP_row As Integer"]
["#Public PWS_row As Integer"]
["#Public PW_row As Integer"]
["#Public XH_row As Integer"]
[]
["#単位、小数桁などを初期化する"]
["    IniVal"]
[]
["#状態値(入力値以外を消す)"]
["    if PA_s == ''  : Worksheets(sheet_n).Cells(PA_row, data_col).Value = ''"]
["    if HT_s == ''  : Worksheets(sheet_n).Cells(HT_row, data_col).Value = ''"]
["    if DB_s == ''  : Worksheets(sheet_n).Cells(DB_row, data_col).Value = ''"]
["    if WB_s == ''  : Worksheets(sheet_n).Cells(WB_row, data_col).Value = ''"]
["    if RH_s == ''  : Worksheets(sheet_n).Cells(RH_row, data_col).Value = ''"]
["    if AH_s == ''  : Worksheets(sheet_n).Cells(AH_row, data_col).Value = ''"]
["    if ET_s == ''  : Worksheets(sheet_n).Cells(ET_row, data_col).Value = ''"]
["    if SV_s == ''  : Worksheets(sheet_n).Cells(SV_row, data_col).Value = ''"]
["    if DP_s == ''  : Worksheets(sheet_n).Cells(DP_row, data_col).Value = ''"]
["    if flgP_s == ''  : Worksheets(sheet_n).Cells(flgP_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(PWS_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(PW_row, data_col).Value = ''"]
["    Worksheets(sheet_n).Cells(XH_row, data_col).Value = ''"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#状態値(計算値)を出力する"]
["#□□□□□□□□□□"]
["def OutAP() :"]
["#Public sheet_n As String"]
["#Public data_col As Integer"]
["#Public PA_row As Integer"]
["#Public HT_row As Integer"]
["#Public DB_row As Integer"]
["#Public WB_row As Integer"]
["#Public RH_row As Integer"]
["#Public AH_row As Integer"]
["#Public ET_row As Integer"]
["#Public SV_row As Integer"]
["#Public DP_row As Integer"]
["#Public PWS_row As Integer"]
["#Public PW_row As Integer"]
["#Public XH_row As Integer"]
[]
["#状態値(計算値)"]
["#数値→文字"]
["    Worksheets(sheet_n).Cells(PA_row, data_col).Value = str(round(PA_d, PA_f))"]
["    Worksheets(sheet_n).Cells(HT_row, data_col).Value = str(round(HT_d, HT_f))"]
["    Worksheets(sheet_n).Cells(DB_row, data_col).Value = str(round(DB_d, DB_f))"]
["    Worksheets(sheet_n).Cells(WB_row, data_col).Value = str(round(WB_d, WB_f))"]
["    Worksheets(sheet_n).Cells(RH_row, data_col).Value = str(round(RH_d, RH_f))"]
["    Worksheets(sheet_n).Cells(AH_row, data_col).Value = str(round(AH_d, AH_f))"]
["    Worksheets(sheet_n).Cells(ET_row, data_col).Value = str(round(ET_d, ET_f))"]
["    Worksheets(sheet_n).Cells(SV_row, data_col).Value = str(round(SV_d, SV_f))"]
["    Worksheets(sheet_n).Cells(DP_row, data_col).Value = str(round(DP_d, DP_f))"]
["    Worksheets(sheet_n).Cells(flgP_row, data_col).Value = flgP_s"]
["    Worksheets(sheet_n).Cells(PWS_row, data_col).Value = str(round(PWS_d, PW_f))"]
["    Worksheets(sheet_n).Cells(PW_row, data_col).Value = str(round(PW_d, PW_f))"]
["    Worksheets(sheet_n).Cells(XH_row, data_col).Value = str(round(XH_d, XH_f))"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#入力値を取得し、計算し、出力する"]
["#□□□□□□□□□□"]
["def ShowAP() :"]
["#Public Const flg_uni As String = \"S\" 'G(重力) or S(SI)"]
["#Public PA_s As String"]
["#Public HT_s As String"]
["#Public DB_s As String"]
["#Public WB_s As String"]
["#Public RH_s As String"]
["#Public AH_s As String"]
["#Public XH_s As String"]
["#Public ET_s As String"]
["#Public SV_s As String"]
["#Public DP_s As String"]
["#Public flgP_s As String"]
[]
["#Public PA_d As String"]
["#Public PA0_d As String"]
["#Public flgP_d As string"]
["#Public flgP0_d As string"]
[]
["#Public sheet_n As String"]
["#Public data_col As Integer"]
["#Public PA_row As Integer"]
["#Public DB_row As Integer"]
["#Public WB_row As Integer"]
["#Public RH_row As Integer"]
["#Public AH_row As Integer"]
["#Public XH_row As Integer"]
["#Public ET_row As Integer"]
["#Public SV_row As Integer"]
["#Public DP_row As Integer"]
["#Public flgP_row As Integer"]
["#Public PWS_row As Integer"]
["#Public PW_row As Integer"]
[]
["#変数を初期化"]
["    IniVal"]
[]
["    HT_PA_Check"]
["    PA_HT_Check"]
["    PWS_DB_Check"]
[]
["#値と小数桁の入力値を取得"]
["    InAP"]
[]
["#大気圧を確認する"]
["    if PA_s == '' and HT_s == ''  :"]
["        PA_d = PA0_d"]
["    elif PA_s != ''  :"]
["        PA_d = float(PA_s) #PA_dはS単位"]
["        HT_d = HT_PA(PA_d)"]
["    elif HT_s != ''  :"]
["        HT_d = float(HT_s)"]
["        PA_d = PA_HT(HT_d) #PA_dはS単位"]
["    #end if"]
[]
["#水蒸気圧計算方法を確認する"]
["    if flgP_s == ''  :"]
["        flgP_d = flgP0_d"]
["    else :"]
["        flgP_d = flgP_s"]
["    #end if"]
[]
["#S->G"]
["    if flg_uni == 'S'  :"]
["        PA0_d = XU_P(PA0_d, 'SG')"]
["        PA_d = XU_P(PA_d, 'SG')"]
["    #end if"]
[]
["#状態値を計算"]
["#Public ary_tmp(0 To 9) As Double"]
["    GetAP(DB_s, WB_s, RH_s, AH_s, ET_s, SV_s, DP_s)"]
["    DB_d = ary_tmp(0)"]
["    WB_d = ary_tmp(1)"]
["    RH_d = ary_tmp(2)"]
["    AH_d = ary_tmp(3)"]
["    ET_d = ary_tmp(4)"]
["    SV_d = ary_tmp(5)"]
["    PWS_d = ary_tmp(6)"]
["    PW_d = ary_tmp(7)"]
["    DP_d = ary_tmp(8)"]
["    XH_d = ary_tmp(9)"]
[]
["#G->S"]
["    if flg_uni == 'S'  :"]
["        PA0_d = XU_P(PA0_d, 'GS')"]
["        PA_d = XU_P(PA_d, 'GS')"]
["    #end if"]
[]
["#結果を表示"]
["    OutAP"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度、湿球温度、相対湿度、絶対湿度、比エンタルピ、比容積を相互変換する"]
["#□□□□□□□□□□"]
["def GetAP(DB_s, WB_s, RH_s, AH_s, ET_s, SV_s, DP_s) :"]
["#Public PA_s As String, PA_d As Double, PA_f As Integer"]
["#Public DB_s As String, DB_d As Double, DB_f As Integer"]
["#Public WB_s As String, WB_d As Double, WB_f As Integer"]
["#Public RH_s As String, RH_d As Double, RH_f As Integer"]
["#Public AH_s As String, AH_d As Double, AH_f As Integer"]
["#Public ET_s As String, ET_d As Double, ET_f As Integer"]
["#Public SV_s As String, SV_d As Double, SV_f As Integer"]
["#Public DP_s As String, DP_d as Double, DP_f As Integer"]
["#Public PWS_s As String, PWS_d As Double, PWS_f As Integer"]
["#Public PW_s As String, PW_d As Double, PW_f As Double"]
["#Public XH_s As String, XH_d As Double, XH_f As Integer"]
[]
["#文字->数値"]
["    if DB_s != ''  : DB_d = float(DB_s)"]
["    if WB_s != ''  : WB_d = float(WB_s)"]
["    if RH_s != ''  : RH_d = float(RH_s)"]
["    if AH_s != ''  : AH_d = float(AH_s)"]
["    if ET_s != ''  : ET_d = float(ET_s)"]
["    if SV_s != ''  : SV_d = float(SV_s)"]
["    if DP_s != ''  :"]
["        DP_d = float(DP_s)"]
["        AH_s = str(AH_DP(DP_d)) #露点温度->絶対湿度"]
["    #end if"]
[]
["#S->G"]
["    if flg_uni == 'S'  :"]
["#  PA0_d = XU_P(PA0_d, \"SG\")"]
["#  PA_s = XU_P(PA_d, \"SG\")"]
["        if ET_s != ''  :"]
["            ET_d = XU_H(ET_d, 'SG')"]
["        #end if"]
["    #end if"]
[]
["#状態値を計算する"]
["    if DB_s != '' and WB_s != ''  :"]
["        RH_s = ''; AH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        AH_d = AH_DBWB(DB_d, WB_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif DB_s != '' and RH_s != ''  :"]
["        WB_s = ''; AH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_PWSRH(PWS_d, RH_d) #水蒸気圧"]
["        AH_d = AH_PW(PW_d)           #絶対湿度"]
["#20230131  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif DB_s != '' and AH_s != ''  :"]
["        WB_s = ''; RH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif DB_s != '' and ET_s != ''  :"]
["        WB_s = ''; RH_s = ''; AH_s = ''; SV_s = ''; DP_s = ''"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        AH_d = AH_DBET(DB_d, ET_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif DB_s != '' and SV_s != ''  :"]
["        WB_s = ''; RH_s = ''; AH_s = ''; ET_s = ''; DP_s = ''"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        AH_d = AH_DBSV(DB_d, SV_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif WB_s != '' and RH_s != ''  :"]
["        DB_s = ''; AH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = DB_WBRH(WB_d, RH_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_PWSRH(PWS_d, RH_d) #水蒸気圧"]
["        AH_d = AH_PW(PW_d)           #絶対湿度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif WB_s != '' and AH_s != ''  :"]
["        DB_s = ''; RH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = DB_WBAH(WB_d, AH_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif WB_s != '' and ET_s != ''  :"]
["        DB_s = ''; RH_s = ''; AH_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = DB_WBET(WB_d, ET_d)   #乾球温度"]
["        AH_d = AH_DBET(DB_d, ET_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif WB_s != '' and SV_s != ''  :"]
["        DB_s = ''; RH_s = ''; AH_s = ''; ET_s = ''; DP_s = ''"]
["        DB_d = DB_WBSV(WB_d, SV_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        AH_d = AH_DBWB(DB_d, WB_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif RH_s != '' and AH_s != ''  :"]
["        DB_s = ''; WB_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        PWS_d = PWS_PWRH(PW_d, RH_d) #飽和水蒸気圧"]
["        DB_d = DB_PS(PWS_d)          #乾球温度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif RH_s != '' and ET_s != ''  :"]
["        DB_s = ''; WB_s = ''; AH_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = DB_RHET(RH_d, ET_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_PWSRH(PWS_d, RH_d) #水蒸気圧"]
["        AH_d = AH_PW(PW_d)           #絶対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif RH_s != '' and SV_s != ''  :"]
["        DB_s = ''; WB_s = ''; AH_s = ''; ET_s = ''; DP_s = ''"]
["        DB_d = DB_RHSV(RH_d, SV_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_PWSRH(PWS_d, RH_d) #水蒸気圧"]
["        AH_d = AH_PW(PW_d)           #絶対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif AH_s != '' and ET_s != ''  :"]
["        DB_s = ''; WB_s = ''; RH_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = DB_AHET(AH_d, ET_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        SV_d = SV_DBAH(DB_d, AH_d)   #比容積"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif AH_s != '' and SV_s != ''  :"]
["        DB_s = ''; WB_s = ''; RH_s = ''; ET_s = ''; DP_s = ''"]
["        DB_d = DB_AHSV(AH_d, SV_d)   #乾球温度"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        ET_d = ET_DBAH(DB_d, AH_d)   #比エンタルピ"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    elif ET_s != '' and SV_s != ''  :"]
["        DB_s = ''; WB_s = ''; RH_s = ''; AH_s = ''; DP_s = ''"]
["        DB_d = DB_ETSV(ET_d, SV_d)   #乾球温度"]
["        AH_d = AH_DBSV(DB_d, SV_d)   #絶対湿度"]
["        PW_d = PW_AH(AH_d)           #水蒸気圧"]
["        PWS_d = PWS_DB(DB_d)         #飽和水蒸気圧"]
["        RH_d = RH_PWSPW(PWS_d, PW_d) #相対湿度"]
["#20230521  WB_d = WB_DBAH(DB_d, AH_d)   '湿球温度"]
["        WB_d = WB_DBRH(DB_d, RH_d)   #湿球温度"]
["        DP_d = DB_PS(PW_d)           #露点温度"]
["    else :"]
["        DB_s = ''; WB_s = ''; RH_s = ''; AH_s = ''; ET_s = ''; SV_s = ''; DP_s = ''"]
["        DB_d = 0.0"]
["        WB_d = 0.0"]
["        RH_d = 0.0"]
["        AH_d = 0.0"]
["        ET_d = 0.0"]
["        SV_d = 0.0"]
["        PWS_d = 0.0"]
["        PW_d = 0.0"]
["        DP_d = 0.0"]
["        XH_d = 0.0"]
["    #end if"]
[]
["    XH_d = XH_PWSPW(PWS_d, PW_d)"]
[]
["#G->S"]
["    if flg_uni == 'S'  :"]
["#  PA0_d = XU_P(PA0_d, \"GS\")"]
["#  PA_d = XU_P(PA_d, \"GS\")"]
["        ET_d = XU_H(ET_d, 'GS')"]
["        PWS_d = XU_P(PWS_d, 'GS')"]
["        PW_d = XU_P(PW_d, 'GS')"]
["    #end if"]
[]
["#Public ary_tmp(0 To 9) As Double"]
["    ary_tmp(0) = DB_d"]
["    ary_tmp(1) = WB_d"]
["    ary_tmp(2) = RH_d"]
["    ary_tmp(3) = AH_d"]
["    ary_tmp(4) = ET_d"]
["    ary_tmp(5) = SV_d"]
["    ary_tmp(6) = PWS_d"]
["    ary_tmp(7) = PW_d"]
["    ary_tmp(8) = DP_d"]
["    ary_tmp(9) = XH_d"]
[]
["#end def"]
[]
["#□□□□□□□□□□"]
["#常用対数を計算する"]
["#□□□□□□□□□□"]
["def Log10(x) :"]
["#VBAのLogは自然対数を返す"]
["    y= 0.0"]
[]
["    y = math.log(x) / math.log(10.0)"]
[]
["    return y"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#単位を換算する"]
["#□□□□□□□□□□"]
[]
["#圧力(大気圧、水蒸気圧)[kPa←→mmHg]"]
["def XU_P(val_1, flg_tmp) :"]
["#Public Const PA0_dg As Double = 760.0"]
["#Public Const PA0_ds As Double = 101.325 'XU_P(PA0_dg, \"GS\")"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_2 = PA0_ds / PA0_dg"]
["    if flg_tmp == 'GS'  :"]
["        val_3 = val_1 * val_2"]
["    elif flg_tmp == 'SG'  :"]
["        val_3 = val_1 / val_2"]
["    #end if"]
[]
["    return val_3"]
["#end def"]
[]
["#熱量(比エンタルピ、熱水分比)[kJ←→kcal]"]
["def XU_H(val_1, flg_tmp) :"]
["#Public Const HQw_d As Double = 1.0"]
["#Public Const HQw_u As String = \"[kWh]\""]
["#Public Const HQc_d As Double = 860.0"]
["#Public Const HQc_u As String = \"[kcal]\""]
["#Public Const HQj_d As Double = 3600.0"]
["#Public Const HQj_u As String = \"[kJ]\""]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["#1[kWh] = 3600[kJ] = 860[kcal]"]
["    val_2 = HQj_d / HQc_d #4.186"]
["    if flg_tmp == 'GS'  :"]
["        val_3 = val_1 * val_2"]
["    elif flg_tmp == 'SG'  :"]
["        val_3 = val_1 / val_2"]
["    #end if"]
[]
["    return val_3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#海抜高さと大気圧の関係"]
["#□□□□□□□□□□"]
[]
["#大気圧→海抜高さ"]
["def HT_PA(PA_d) :"]
["#Public PA0_ds As Double"]
["    val_1= 0.0"]
[]
["#S単位"]
["#海抜高度HT[m]、海抜0mでの気圧PA0[hPa]、海抜HTmでの気圧PA[hPa]"]
["#HT= 18410.0 * (Log10(PA0) - Log10(PA))"]
[]
["    val_1 = 18410.0 * (Log10(PA0_ds) - Log10(PA_d))"]
[]
["    return val_1"]
["#end def"]
[]
["#試算"]
["def HT_PA_Check() :"]
["#Public Const Check_row As Integer = 1"]
["#Public Const HT_PA_col As Integer = 1"]
["#Public PA0_ds As Double"]
["    PA_d= 0.0"]
["    PA_d_max= 0.0"]
["    PA_d_step= 0.0"]
["    HT_d= 0.0"]
["    i_row= 0"]
["    i_col= 0"]
[]
["    PA_d = PA0_ds"]
["    PA_d_max = 0.0"]
["    PA_d_step = (PA_d_max - PA_d) / 20.0"]
["    i_row = Check_row"]
["    i_col = HT_PA_col"]
["    Worksheets(sheet2_n).Cells(i_row, i_col).Value = PA_n"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_n"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = HT_n"]
["    i_row = i_row + 1"]
["    Worksheets(sheet2_n).Cells(i_row, i_col).Value = PA_us"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_ug"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = HT_u"]
["    i_row = i_row + 1"]
["    while (PA_d >= PA_d_max) :"]
["        HT_d = HT_PA(PA_d)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col).Value = round(PA_d, PA_f0s)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = round(XU_P(PA_d, 'SG'), PA_f0g)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = round(HT_d, HT_f)"]
["        PA_d = PA_d + PA_d_step"]
["        i_row = i_row + 1"]
["    #end while "]
[]
["#end def"]
[]
["#海抜高さ→大気圧"]
["def PA_HT(HT_d) :"]
["#Public PA0_ds As Double"]
["    val_1= 0.0"]
[]
["#S単位"]
["#海抜高度HT[m]、海抜0mでの気圧PA0[hPa]、海抜HTmでの気圧PA[hPa]"]
["#HT= 18410.0 * (Log10(PA0) - Log10(PA))"]
["#Log10(PA)= Log10(PA0) - (HT / 18410.0)"]
[]
["    val_1 = Log10(PA0_ds) - (HT_d / 18410.0)"]
["    val_1 = 10.0 ** val_1"]
[]
["    return val_1"]
["#end def"]
[]
["#試算"]
["def PA_HT_Check() :"]
["#Public Const Check_row As Integer = 1"]
["#Public Const PA_HT_col As Integer = 4"]
["#Public HT0_d As Double"]
["    HT_d= 0.0"]
["    HT_d_max= 0.0"]
["    HT_d_step= 0.0"]
["    PA_d= 0.0"]
["    i_row= 0"]
["    i_col= 0"]
[]
["    HT_d = HT0_d"]
["    HT_d_max = 10000.0"]
["    HT_d_step = (HT_d_max - HT_d) / 20.0"]
["    i_row = Check_row"]
["    i_col = PA_HT_col"]
["    Worksheets(sheet2_n).Cells(i_row, i_col).Value = HT_n"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_n"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PA_n"]
["    i_row = i_row + 1"]
["    Worksheets(sheet2_n).Cells(i_row, i_col).Value = HT_u"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PA_us"]
["    Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PA_ug"]
["    i_row = i_row + 1"]
["    while (HT_d <= HT_d_max) :"]
["        PA_d = PA_HT(HT_d)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col).Value = round(HT_d, HT_f)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = round(PA_d, PA_f0s)"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = round(XU_P(PA_d, 'SG'), PA_f0g)"]
["        HT_d = HT_d + HT_d_step"]
["        i_row = i_row + 1"]
["    #end while "]
[]
["#end def"]
[]
["#海抜高さ、乾球温度→大気圧"]
["def PA_HTDB(HT_d, DB_d) :"]
["#Public AT0_d As Double"]
["#Public PA0_ds As Double"]
["    val_1= 0.0"]
[]
["#S単位"]
["#海抜高度HT[m]、海抜0mの気圧PA0[hPa]、海抜HTmの絶対温度AT[degK]、海抜HTmの気圧PA[hPa]"]
["#PA= PA0 * (1 - ((0.0065 * HT) / ((0.0065 * HT) + AT))))^5.257"]
[]
["    val_1 = (1 - ((0.0065 * HT_d) / ((0.0065 * HT_d) + (DB_d + AT0_d)))) ** 5.257"]
["    val_1 = PA0_ds * val_1"]
[]
["    return val_1"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と飽和水蒸気圧の関係"]
["#□□□□□□□□□□"]
[]
["#乾球温度→飽和水蒸気圧"]
["def PWS_DB(DB_d) :"]
["#Public PA_d As Double"]
["#Public PA0_d As Double"]
["#Public flgP_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["#下記の3式は標準大気圧下の値"]
["    if flgP_d == flgPg_d  : #ゴフ・グラッチ"]
["    val_1 = PWS_DB_byGG(DB_d)"]
["elif flgP_d == flgPw_d   :#ウェクスラー・ハイランド"]
["    val_1 = PWS_DB_byWH(DB_d)"]
["elif flgP_d == flgPt_d   :#テーテンス"]
["    val_1 = PWS_DB_byT(DB_d)"]
["#end if"]
[]
["val_2 = PA_d / PA0_d #圧力による飽和水蒸気圧の補正"]
["val_1 = val_1 * val_2"]
["#S->G変換"]
["val_3 = XU_P(val_1, 'SG')"]
[]
["return val_3"]
["#end def"]
[]
["#試算"]
["def PWS_DB_Check() :"]
["#Public Const Check_row As Integer = 1"]
["#Public Const PWS_DB_col As Integer = 7"]
["#Public HT0_d As Double"]
["    DB_d= 0.0"]
["    DB_d_max= 0.0"]
["    DB_d_step= 0.0"]
["    PWS_d= 0.0"]
["    i_row= 0"]
["    i_col= 0"]
["    i= 0"]
[]
["    for i in range(1, 3) :"]
["        if i == 1  :"]
["            flgP_d = flgPg_d #ゴフ・グラッチ"]
["        elif i == 2  :"]
["            flgP_d = flgPw_d #ウェクスラー・ハイランド"]
["        elif i == 3  :"]
["            flgP_d = flgPt_d #テーテンス"]
["        #end if"]
[]
["        DB_d = 0.0"]
["        DB_d_max = 100.0"]
["        DB_d_step = (DB_d_max - DB_d) / 20.0"]
["        i_row = Check_row"]
["        i_col = PWS_DB_col + (i - 1) * 3"]
[]
["        Worksheets(sheet2_n).Cells(i_row, i_col).Value = DB_n"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PWS_n + ' by ' + flgP_d"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PWS_n + ' by ' + flgP_d"]
["        i_row = i_row + 1"]
["        Worksheets(sheet2_n).Cells(i_row, i_col).Value = DB_u"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = PW_us"]
["        Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = PW_ug"]
["        i_row = i_row + 1"]
["        while (DB_d <= DB_d_max) :"]
["            PWS_d = PWS_DB(DB_d)"]
["            Worksheets(sheet2_n).Cells(i_row, i_col).Value = round(DB_d, DB_f)"]
["            Worksheets(sheet2_n).Cells(i_row, i_col + 1).Value = round(XU_P(PWS_d, 'GS'), PW_f0s)"]
["            Worksheets(sheet2_n).Cells(i_row, i_col + 2).Value = round(PWS_d, PW_f0g)"]
["            DB_d = DB_d + DB_d_step"]
["            i_row = i_row + 1"]
["        #end while "]
["    #end for i"]
[]
["#end def"]
[]
["#乾球温度→飽和水蒸気圧/ゴフ・グラッチ(Goff-Gratch)の式"]
["def PWS_DB_byGG(DB_d) :"]
["#Public AT0_d As Double"]
["#Public PA0_dg As Double"]
["    AT_d= 0.0"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
["    val_4= 0.0"]
["    val_5= 0.0"]
["    val_6= 0.0"]
["    val_7= 0.0"]
[]
["#S単位"]
["#PWS:飽和水蒸気圧[hPa]、AT[度K] = 273.15[度K] + DB、DB:乾球温度[度C]"]
["#DB > 0 :"]
["#Log10(PWS)"]
["#= -7.90298 * (373.16 / AT - 1)"]
["#+  5.02808 * Log(373.16 / AT)"]
["#-  1.3816  * 10^-7 * (10^ (11.344 * (1 - AT / 373.16)) -1)"]
["#+  8.1328  * 10^-3 * (10^ (- 3.49149 * (373.16 / AT -1)) -1)"]
["#+  Log(1013.246)"]
["#DB <=0 :"]
["#Log10(PWS)"]
["#= -9.09718  * (273.16 / AT - 1)"]
["#-  3.56654  * Log(273.16 / AT)"]
["#+  0.876793 * (1 - AT / 273.16)"]
["#+  Log(6.1071)"]
[]
["#S単位"]
["    AT_d = AT0_d + DB_d"]
["    if DB_d > 0.0  :"]
["        val_1 = 373.16 / AT_d"]
["        val_2 = -7.90298 * (val_1 - 1.0)"]
["        val_3 = 5.02808 * Log10(val_1)"]
["        val_4 = -1.3816 * 10.0 ** -7.0 * (10.0 ** (11.344 * (1 - 1.0 / val_1)) - 1.0)"]
["        val_5 = 8.1328 * 10.0 ** -3.0 * (10.0 ** (-3.49149 * (val_1 - 1.0)) - 1.0)"]
["        val_6 = Log10(1013.246)"]
["    else :"]
["        val_1 = 273.16 / AT_d"]
["        val_2 = -9.09718 * (val_1 - 1.0)"]
["        val_3 = -3.56654 * Log10(val_1)"]
["        val_4 = 0.876793 * (1.0 - 1.0 / val_1)"]
["        val_5 = 0.0"]
["        val_6 = Log10(6.1071)"]
["    #end if"]
["    val_7 = val_2 + val_3 + val_4 + val_5 + val_6"]
["    val_7 = 10.0 ** val_7"]
["    val_7 = val_7 / 10.0 #[kPa]"]
[]
["    return val_7"]
["#end def"]
[]
["#乾球温度→飽和水蒸気圧/ウェクスラー・ハイランド(Wexler-Hyland)の式"]
["def PWS_DB_byWH(DB_d) :"]
["#Public AT0_d As Double"]
["    AT_d= 0.0"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
["    val_4= 0.0"]
["    val_5= 0.0"]
["    val_6= 0.0"]
["    val_7= 0.0"]
["    val_8= 0.0"]
[]
["#S単位"]
["#PWS:飽和水蒸気圧[Pa]、AT[度K] = 273.15[度K] + DB、DB:乾球温度[度C]"]
["#水と接する(乾球温度が0.01℃以上)時:"]
["#DB >= 0.01 :"]
["#LogE(PWS)"]
["#= -0.58002206 * 10^4   / AT"]
["#+  0.13914993 * 10"]
["#-  0.48640239 * 10^-1  * AT"]
["#+  0.41764768 * 10^-4  * AT^2"]
["#-  0.14452093 * 10^-7  * AT^3"]
["#+  0.65459673 * 10     * ln(AT)"]
["#DB < 0.01(氷と接する時):"]
["#LogE(PWS)"]
["#= -0.56745359 * 10^4   / AT"]
["#+  0.63925247 * 10"]
["#-  0.96778430 * 10^-2  * AT"]
["#+  0.62215701 * 10^-6  * AT^2"]
["#+  0.20747825 * 10^-8  * AT^3"]
["#-  0.94840240 * 10^-12 * AT^4"]
["#+  0.41635019 * 10     * ln(AT)"]
[]
["#S単位"]
["    AT_d = AT0_d + DB_d"]
["    if DB_d >= 0.01  :"]
["        val_1 = -0.58002206 * 10.0 ** 4 / AT_d"]
["        val_2 = 0.13914993 * 10.0"]
["        val_3 = -0.48640239 * 10.0 ** -1 * AT_d"]
["        val_4 = 0.41764768 * 10.0 ** -4 * AT_d ** 2"]
["        val_5 = -0.14452093 * 10.0 ** -7 * AT_d ** 3"]
["        val_6 = 0.0"]
["        val_7 = 0.65459673 * 10.0 * math.log(AT_d)"]
["    else :"]
["        val_1 = -0.56745359 * 10.0 ** 4 / AT_d"]
["        val_2 = 0.63925247 * 10.0"]
["        val_3 = -0.9677843 * 10.0 ** -2 * AT_d"]
["        val_4 = 0.62215701 * 10.0 ** -6 * AT_d ** 2"]
["        val_5 = 0.20747825 * 10.0 ** -8 * AT_d ** 3"]
["        val_6 = -0.9484024 * 10.0 ** -12 * AT_d ** 4"]
["        val_7 = 0.41635019 * 10.0 * math.log(AT_d)"]
["    #end if"]
["    val_8 = val_1 + val_2 + val_3 + val_4 + val_5 + val_6 + val_7"]
["    val_8 = math.exp(val_8)"]
["    val_8 = val_8 / 1000.0 #[kPa]"]
[]
["    return val_8"]
["#end def"]
[]
["#乾球温度→飽和水蒸気圧/テーテンス(Tetens)の式"]
["def PWS_DB_byT(DB_d) :"]
["    val_1= 0.0"]
["    val_2= 0.0"]
[]
["#S単位"]
["#PWS:飽和水蒸気圧[hPa]、DB:乾球温度[度C]"]
["#DB[℃] > 0 :"]
["#Log10(PWS)"]
["#= 7.5 * DB / (DB + 237.3) + 0.7858"]
["#DB[℃] < 0 :"]
["#Log10(PWS)"]
["#= 9.5 * DB / (DB + 265.5) + 0.7858"]
[]
["#S単位"]
["    if DB_d >= 0.0  :"]
["        val_1 = 7.5 * DB_d / (DB_d + 237.3) + 0.7858 #[hPa]"]
["    else :"]
["        val_1 = 9.5 * DB_d / (DB_d + 265.5) + 0.7858 #[hPa]"]
["    #end if"]
["    val_2 = 10.0 ** val_1"]
["    val_2 = val_2 / 10.0 #[kPa]"]
[]
["    return val_2"]
["#end def"]
[]
["#飽和水蒸気圧→乾球温度(2分法)"]
["def DB_PS(PWS_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = PWS_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
[]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = PWS_DB(val_x1)"]
["            val_y2 = PWS_DB(val_x2)"]
["            val_y3 = PWS_DB(val_x3)"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#水蒸気圧と相対湿度の関係"]
["#□□□□□□□□□□"]
[]
["#飽和水蒸気圧、水蒸気圧→相対湿度"]
["def RH_PWSPW(PWS_d, PW_d) :"]
["    val_1= 0.0"]
[]
["    val_1 = 100.0 * PW_d / PWS_d"]
[]
["    return val_1"]
["#end def"]
[]
["#飽和水蒸気圧、相対湿度→水蒸気圧"]
["def PW_PWSRH(PWS_d, RH_d) :"]
["    val_1= 0.0"]
[]
["    val_1 = PWS_d * RH_d / 100.0"]
[]
["    return val_1"]
["#end def"]
["#水蒸気圧、相対湿度→飽和水蒸気圧"]
["def PWS_PWRH(PW_d, RH_d) :"]
["    val_1= 0.0"]
[]
["    val_1 = PW_d * 100.0 / RH_d"]
[]
["    return val_1"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#水蒸気圧と絶対湿度の関係"]
["#□□□□□□□□□□"]
[]
["#水蒸気圧→絶対湿度"]
["def AH_PW(PW_d) :"]
["#Public MA_d As Double"]
["#Public MW_d As Double"]
["#Public PA_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
[]
["#AH =MW / MA * PW / (PA -PW)"]
["    val_1 = MW_d / MA_d #0.622"]
["    val_2 = val_1 * PW_d / (PA_d - PW_d)"]
[]
["    return val_2"]
["#end def"]
[]
["#絶対湿度→水蒸気圧"]
["def PW_AH(AH_d) :"]
["#Public MA_d As Double"]
["#Public MW_d As Double"]
["#Public PA_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
[]
["#PW =PA * AH / (MW / MA + AH)"]
["    val_1 = MW_d / MA_d #0.622"]
["    val_2 = PA_d * AH_d / (val_1 + AH_d)"]
[]
["    return val_2"]
["#end def"]
[]
["#飽和水蒸気圧、水蒸気圧→飽和度"]
["def XH_PWSPW(PWS_d, PW_d) :"]
["#Public PA_d As Double"]
["#Public XH_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_1 = PW_d / (PA_d - PW_d) #AH"]
["    val_2 = PWS_d / (PA_d - PWS_d) #AHS"]
["    val_3 = (val_1 / val_2) * 100.0"]
[]
["    return val_3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と相対湿度と露点温度の関係"]
["#□□□□□□□□□□"]
[]
["#乾球温度、相対湿度→露点温度(2分法)"]
["def DP_DBRH(DB_d, RH_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = PW_PWSRH(PWS_DB(DB_d), RH_d)"]
["    val_x1 = TLow_d"]
["    val_x2 = DB_d #TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = PW_PWSRH(PWS_DB(val_x1), 100.0)"]
["            val_y2 = PW_PWSRH(PWS_DB(val_x2), 100.0)"]
["            val_y3 = PW_PWSRH(PWS_DB(val_x3), 100.0)"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#露点温度→絶対湿度"]
["def AH_DP(DP_d) :"]
[]
["    return AH_PW(PWS_DB(DP_d))"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と絶対湿度と比エンタルピの関係"]
["#□□□□□□□□□□"]
[]
["#乾球温度、絶対湿度→比エンタルピ"]
["def ET_DBAH(DB_d, AH_d) :"]
["#Public CPA_d As Double"]
["#Public CPW_d As Double"]
["#Public LH_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["#ET:比エンタルピ[kJ/kg-dry]、DB:乾球温度[degC]、AH:絶対湿度[kg/kg-dry]"]
["#ET= CPA * DB + (CPW * DB + LH) * AH"]
["#ET= 0.24 * DB + (0.441 * DB + 597.3) * AH 'G"]
["#ET= 1.006 * DB + (1.86 * DB + 2501) * AH 'S"]
[]
["    val_1 = CPA_d * DB_d"]
["    val_2 = CPW_d * DB_d + LH_d"]
["    val_3 = val_1 + val_2 * AH_d"]
[]
["    return val_3"]
["#end def"]
[]
["#乾球温度、比エンタルピ→絶対湿度"]
["def AH_DBET(DB_d, ET_d) :"]
["#Public CPA_d As Double"]
["#Public CPW_d As Double"]
["#Public LH_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_1 = CPA_d * DB_d"]
["    val_2 = CPW_d * DB_d + LH_d"]
["    val_3 = (ET_d - val_1) / val_2"]
[]
["    return val_3"]
["#end def"]
[]
["#絶対湿度、比エンタルピ→乾球温度"]
["def DB_AHET(AH_d, ET_d) :"]
["#Public CPA_d As Double"]
["#Public CPW_d As Double"]
["#Public LH_d As Double"]
["    val_1= 0.0"]
[]
["    val_1 = (ET_d - (LH_d * AH_d)) / (CPA_d + CPW_d * AH_d)"]
[]
["    return val_1"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と絶対湿度と比容積の関係"]
["#□□□□□□□□□□"]
[]
["#乾球温度、絶対湿度→比容積"]
["def SV_DBAH(DB_d, AH_d) :"]
["#Public MW_d As Double"]
["#Public MA_d As Double"]
["#Public AT0_d As Double"]
["#Public PA_d As Double"]
["#Public PA0_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_1 = MW_d / MA_d"]
["    val_2 = PA_d / PA0_d"]
["    val_3 = 0.004555 * (val_1 + AH_d) * (DB_d + AT0_d) / val_2"]
[]
["    return val_3"]
["#end def"]
[]
["#絶対湿度、比容積→乾球温度"]
["def DB_AHSV(AH_d, SV_d) :"]
["#Public MW_d As Double"]
["#Public MA_d As Double"]
["#Public AT0_d As Double"]
["#Public PA_d As Double"]
["#Public PA0_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_1 = MW_d / MA_d"]
["    val_2 = PA_d / PA0_d"]
["    val_3 = SV_d * val_2 / (0.004555 * (val_1 + AH_d)) - AT0_d"]
[]
["    return val_3"]
["#end def"]
[]
["#乾球温度、比容積→絶対湿度"]
["def AH_DBSV(DB_d, SV_d) :"]
["#Public MW_d As Double"]
["#Public MA_d As Double"]
["#Public AT0_d As Double"]
["#Public PA_d As Double"]
["#Public PA0_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_1 = MW_d / MA_d"]
["    val_2 = PA_d / PA0_d"]
["    val_3 = SV_d * val_2 / (0.004555 * (DB_d + AT0_d)) - val_1"]
[]
["    return val_3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と相対湿度と湿球温度の関係"]
["#□□□□□□□□□□"]
[]
["#湿球温度、相対湿度→乾球温度(2分法)"]
["def DB_WBRH(WB_d, RH_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = RH_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = RH_PWSPW(PWS_DB(val_x1), PW_AH(AH_DBWB(val_x1, WB_d)))"]
["            val_y2 = RH_PWSPW(PWS_DB(val_x2), PW_AH(AH_DBWB(val_x2, WB_d)))"]
["            val_y3 = RH_PWSPW(PWS_DB(val_x3), PW_AH(AH_DBWB(val_x3, WB_d)))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#湿球温度、相対湿度→乾球温度(2分法)"]
["def WB_DBRH(DB_d, RH_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_p= 0.0"]
["    val_a1= 0.0"]
["    val_a2= 0.0"]
["    val_a3= 0.0"]
["    val_b= 0.0"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["    val_xe = TErr_d #* 0.01"]
["    val_x1 = DP_DBRH(DB_d, RH_d) #TLow_d"]
["    val_x2 = DB_d #TUpp_d"]
[]
["#PW(at DB) - PWS(at WB) = - A * PA * (DB-WB) by August"]
["#A=CPA * LH * (MW / MA) = 0.000646"]
["#A=0.000662(WB>=0.01) or 0.000583(WB<0.01) by Sprung"]
["#PWS(at WB) - PW(at DB) - A * PA * (DB-WB) = 0"]
["    val_a1 = 0.000662"]
["    val_a2 = 0.000583"]
["    val_b = 0.01"]
[]
["    val_p = PA_d #Pの単位は同じであればSでもGでも可"]
["    val_1 = PW_PWSRH(PWS_DB(DB_d), RH_d) #PW(at DB)"]
[]
["    while :"]
["        if abs(val_x1 - val_x2) <= val_xe  :"]
["            break"]
["        else :"]
["            val_x3 = (val_x1 + val_x2) * 0.5"]
["            if val_x3 >= 0.01 + val_b  :"]
["                val_a3 = val_a1"]
["            elif val_x3 < 0.01 - val_b  :"]
["                val_a3 = val_a2"]
["            else :"]
["                val_a3 = val_a2 + (val_x3 - (0.01 - val_b)) * (val_a1 - val_a2) / (val_b) * 2.0"]
["                Stop"]
["            #end if #val_3"]
[]
["            val_2 = PW_PWSRH(PWS_DB(val_x3), 100.0) #PWS(at WB)"]
["            val_3 = val_2 - val_1 - val_a3 * val_p * (DB_d - val_x3)"]
["            if val_3 > 0.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if #val_3"]
["        #end if #Abs"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#乾球温度、相対湿度→湿球温度(2分法)"]
["def WB_DBRH2(DB_d, RH_d) :"]
["    val_xe= 0.0"]
["    val_p= 0.0"]
["    val_a= 0.0"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
["    val_4= 0.0"]
["    val_5= 0.0"]
["    i= 0"]
[]
["#PW(at DB) - PWS(at WB) = - A * PA * (DB-WB) by August"]
["#A=CPA * LH * (MW / MA) = 0.000646"]
["#A=0.000662(WB>=0.01) or 0.000583(WB<0.01) by Sprung"]
["    val_xe = TErr_d"]
["    val_p = PA_d #Pの単位は同じであればSでもGでも可"]
["    val_1 = PW_PWSRH(PWS_DB(DB_d), RH_d) #PW(at DB)"]
["    val_2 = DB_d #WB(1)"]
["    i = 0"]
[]
["    while :"]
[]
["        if val_2 >= 0.01  :"]
["            val_a = 0.000662"]
["        else :"]
["            val_a = 0.000583"]
["        #end if"]
[]
["#ew-p-0.000662*PA*(DB-WB)"]
["#PWS(at WB) - PW(at DB) - A * PA * (DB-WB) = 0"]
[]
["#PW(at DB) - PWS(at WB) = - A * PA * (DB-WB)"]
["#(PW(at DB) - PWS(at WB)) / (- A * PA) = DB-WB"]
["#WB = DB - (PW(at DB) - PWS(at WB)) / (- A * PA)"]
["#WB = DB + (PW(at DB) - PWS(at WB)) / (A * PA)"]
["        val_3 = PW_PWSRH(PWS_DB(val_2), 100.0) #PWS(at WB)"]
["        val_4 = DB_d + (val_1 - val_3) / (val_a * val_p) #WB(2)"]
["        val_5 = PW_PWSRH(PWS_DB(val_4), 100.0) #PWS(at WB)"]
["        if abs(val_3 - val_5) <= val_xe  :"]
["            break"]
["        else :"]
["            val_2 = val_4"]
["            i = i + 1"]
["            if i == 100  :"]
["                if MsgBox('100 times', vbOKCancel) == 2  :"]
["                    Stop"]
["                else :"]
["                    i = 0"]
["                #end if"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    WB_DBRH = val_2"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#湿球温度と比エンタルピの関係"]
["#□□□□□□□□□□"]
[]
["#湿球温度→水または氷の比エンタルピ"]
["def ET_WB(WB_d) :"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
[]
["#h - hs' = (x - xs') * hc'"]
["#hs'= cpa * t' + (cpw * t' + r0) * x"]
["#hc'=k1 * t' + k2"]
["#h  = cpa * t + (cpw * t + r0) * x"]
[]
["#ET = CPA * DB + (CPW * DB + LH) * AH"]
["#WB > 0 : k1 = 1, k2 = 0"]
["#WB<= 0 : k1 = 0.5, k2 = 79.7"]
["    if WB_d > 0.0  :"]
["        val_1 = 1.0"]
["        val_2 = 0.0"]
["    else :"]
["        val_1 = 0.5"]
["        val_2 = 79.7"]
["    #end if"]
["    val_3 = val_1 * WB_d + val_2"]
[]
["    return val_3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と湿球温度と絶対湿度の関係"]
["#□□□□□□□□□□"]
[]
["#湿球温度、絶対湿度→乾球温度"]
["def DB_WBAH(WB_d, AH_d) :"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
["    val_4= 0.0"]
[]
["    val_1 = ET_WB(WB_d)"]
["    val_2 = AH_PW(PWS_DB(WB_d))"]
["    val_3 = ET_DBAH(WB_d, val_2)"]
["    val_4 = val_3 + (AH_d - val_2) * val_1"]
[]
["    return DB_AHET(AH_d, val_4)"]
["#end def"]
[]
["#乾球温度、湿球温度→絶対湿度"]
["def AH_DBWB(DB_d, WB_d) :"]
["#Public CPA_d As Double"]
["#Public CPW_d As Double"]
["#Public LH_d As Double"]
["    val_1= 0.0"]
["    val_2= 0.0"]
["    val_3= 0.0"]
["    val_4= 0.0"]
["    val_5= 0.0"]
[]
["    val_1 = ET_WB(WB_d)"]
["    val_2 = AH_PW(PWS_DB(WB_d))"]
["    val_3 = CPA_d * (WB_d - DB_d) + (CPW_d * WB_d + LH_d) * val_2"]
["    val_4 = CPW_d * DB_d + LH_d"]
["    val_5 = (val_3 - val_2 * val_1) / (val_4 - val_1)"]
[]
["    return val_5"]
["#end def"]
[]
["#乾球温度、絶対湿度→湿球温度(2分法)"]
["def WB_DBAH(DB_d, AH_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = DB_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = DB_WBAH(val_x1, AH_d)"]
["            val_y2 = DB_WBAH(val_x2, AH_d)"]
["            val_y3 = DB_WBAH(val_x3, AH_d)"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と湿球温度と比エンタルピの関係"]
["#□□□□□□□□□□"]
[]
["#湿球温度、比エンタルピ→乾球温度(2分法)"]
["def DB_WBET(WB_d, ET_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = ET_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = ET_DBAH(val_x1, AH_DBWB(val_x1, WB_d))"]
["            val_y2 = ET_DBAH(val_x2, AH_DBWB(val_x2, WB_d))"]
["            val_y3 = ET_DBAH(val_x3, AH_DBWB(val_x3, WB_d))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と湿球温度と比容積の関係"]
["#□□□□□□□□□□"]
[]
["#湿球温度、比容積→乾球温度(2分法)"]
["def DB_WBSV(WB_d, SV_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = SV_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = SV_DBAH(val_x1, AH_DBWB(val_x1, WB_d))"]
["            val_y2 = SV_DBAH(val_x2, AH_DBWB(val_x2, WB_d))"]
["            val_y3 = SV_DBAH(val_x3, AH_DBWB(val_x3, WB_d))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と相対湿度と比エンタルピの関係"]
["#□□□□□□□□□□"]
[]
["#相対湿度、比エンタルピ→乾球温度(2分法)"]
["def DB_RHET(RH_d, ET_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = ET_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = ET_DBAH(val_x1, AH_PW(PW_PWSRH(PWS_DB(val_x1), RH_d)))"]
["            val_y2 = ET_DBAH(val_x2, AH_PW(PW_PWSRH(PWS_DB(val_x2), RH_d)))"]
["            val_y3 = ET_DBAH(val_x3, AH_PW(PW_PWSRH(PWS_DB(val_x3), RH_d)))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と相対温度と比容積の関係"]
["#□□□□□□□□□□"]
[]
["#相対湿度、比容積→乾球温度(2分法)"]
["def DB_RHSV(RH_d, SV_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = SV_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = SV_DBAH(val_x1, AH_PW(PW_PWSRH(PWS_DB(val_x1), RH_d)))"]
["            val_y2 = SV_DBAH(val_x2, AH_PW(PW_PWSRH(PWS_DB(val_x2), RH_d)))"]
["            val_y3 = SV_DBAH(val_x3, AH_PW(PW_PWSRH(PWS_DB(val_x3), RH_d)))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]
[]
["#□□□□□□□□□□"]
["#乾球温度と比エンタルピと比容積の関係"]
["#□□□□□□□□□□"]
[]
["#比エンタルピ、比容積→乾球温度(2分法)"]
["def DB_ETSV(ET_d, SV_d) :"]
["#Public TLow_d As Double"]
["#Public TUpp_d As Double"]
["#Public TErr_d As Double"]
["    val_xe= 0.0"]
["    val_yt= 0.0"]
["    val_x1= 0.0"]
["    val_x2= 0.0"]
["    val_x3= 0.0"]
["    val_y1= 0.0"]
["    val_y2= 0.0"]
["    val_y3= 0.0"]
["    val_k= 0.0"]
[]
["    val_xe = TErr_d"]
["    val_yt = ET_d"]
["    val_x1 = TLow_d"]
["    val_x2 = TUpp_d"]
["    while :"]
["        val_x3 = (val_x1 + val_x2) * 0.5"]
["        if abs(val_x3 - val_x1) <= val_xe  :"]
["            break"]
["        else :"]
["            val_y1 = ET_DBAH(val_x1, AH_DBSV(val_x1, SV_d))"]
["            val_y2 = ET_DBAH(val_x2, AH_DBSV(val_x2, SV_d))"]
["            val_y3 = ET_DBAH(val_x3, AH_DBSV(val_x3, SV_d))"]
["            val_k = (val_yt - val_y1) / (val_y3 - val_y1)"]
["            if val_k < 1.0  :"]
["                val_x2 = val_x3"]
["            else :"]
["                val_x1 = val_x3"]
["            #end if"]
["        #end if"]
["    #end while "]
[]
["    return val_x3"]
["#end def"]