comparison src/p2_deco.c @ 33:5d4a4fb0e8a6

Bugfix: NOAA tables for CNS are in ATA, not bar
author heinrichsweikamp
date Sun, 04 Aug 2013 15:56:46 +0200
parents 11d4fc797f74
children d7e6dfd5b498
comparison
equal deleted inserted replaced
32:413a1aa23acd 33:5d4a4fb0e8a6
82 // 2012/02/25: [jDG] Looking for a more stable LOW grad factor reference. 82 // 2012/02/25: [jDG] Looking for a more stable LOW grad factor reference.
83 // 2012/09/10: [mH] Fill char_O_deco_time_for_log for logbook write 83 // 2012/09/10: [mH] Fill char_O_deco_time_for_log for logbook write
84 // 2012/10/05: [jDG] Better deco_gas_volumes accuracy (average depth, switch between stop). 84 // 2012/10/05: [jDG] Better deco_gas_volumes accuracy (average depth, switch between stop).
85 // 2013/03/05: [jDG] Should vault low_depth too. 85 // 2013/03/05: [jDG] Should vault low_depth too.
86 // 2013/03/05: [jDG] Wrobell remark: ascent_to_first_stop works better with finer steps (2sec). 86 // 2013/03/05: [jDG] Wrobell remark: ascent_to_first_stop works better with finer steps (2sec).
87 // 2013/05/08: [jDG] A. Salm remark: NOAA tables for CNS are in ATA, not bar.
87 // 88 //
88 // TODO: 89 // TODO:
89 // 90 //
90 // Literature: 91 // Literature:
91 // Bühlmann, Albert: Tauchmedizin; 4. Auflage [2002]; 92 // Bühlmann, Albert: Tauchmedizin; 4. Auflage [2002];
1925 1926
1926 if( char_I_step_is_1min == 1 ) 1927 if( char_I_step_is_1min == 1 )
1927 time_factor = 30.0f; 1928 time_factor = 30.0f;
1928 else if( char_I_step_is_1min == 2 ) 1929 else if( char_I_step_is_1min == 2 )
1929 time_factor = 300.0f; 1930 time_factor = 300.0f;
1930 1931 //------------------------------------------------------------------------
1932 // Don't increase CNS below 0.5 bar, but keep it steady.
1931 if (char_I_actual_ppO2 < 50) 1933 if (char_I_actual_ppO2 < 50)
1932 ; // no changes 1934 ; // no changes
1933 else if (char_I_actual_ppO2 < 60) 1935 //------------------------------------------------------------------------
1934 CNS_fraction += time_factor/(-540.0 * char_I_actual_ppO2 + 54000.0); 1936 // Below (and including) 1.60 bar
1935 else if (char_I_actual_ppO2 < 70) 1937 else if (char_I_actual_ppO2 < 61)
1936 CNS_fraction += time_factor/(-450.0 * char_I_actual_ppO2 + 48600.0); 1938 CNS_fraction += time_factor/(-533.07 * char_I_actual_ppO2 + 54000.0);
1937 else if (char_I_actual_ppO2 < 80) 1939 else if (char_I_actual_ppO2 < 71)
1938 CNS_fraction += time_factor/(-360.0 * char_I_actual_ppO2 + 42300.0); 1940 CNS_fraction += time_factor/(-444.22 * char_I_actual_ppO2 + 48600.0);
1939 else if (char_I_actual_ppO2 < 90) 1941 else if (char_I_actual_ppO2 < 81)
1940 CNS_fraction += time_factor/(-270.0 * char_I_actual_ppO2 + 35100.0); 1942 CNS_fraction += time_factor/(-355.38 * char_I_actual_ppO2 + 42300.0);
1941 else if (char_I_actual_ppO2 < 110) 1943 else if (char_I_actual_ppO2 < 91)
1942 CNS_fraction += time_factor/(-180.0 * char_I_actual_ppO2 + 27000.0); 1944 CNS_fraction += time_factor/(-266.53 * char_I_actual_ppO2 + 35100.0);
1943 else if (char_I_actual_ppO2 < 150) 1945 else if (char_I_actual_ppO2 < 111)
1944 CNS_fraction += time_factor/( -90.0 * char_I_actual_ppO2 + 17100.0); 1946 CNS_fraction += time_factor/(-177.69 * char_I_actual_ppO2 + 27000.0);
1945 else if (char_I_actual_ppO2 < 160) 1947 else if (char_I_actual_ppO2 < 152)
1946 CNS_fraction += time_factor/(-225.0 * char_I_actual_ppO2 + 37350.0); 1948 CNS_fraction += time_factor/( -88.84 * char_I_actual_ppO2 + 17100.0);
1947 else if (char_I_actual_ppO2 < 165) 1949 else if (char_I_actual_ppO2 < 167)
1948 CNS_fraction += time_factor*0.000755; // Arieli et all.(2002): Modeling pulmonary and CNS O2 toxicity... Formula (A1) based on value for 1.55 and c=20 1950 CNS_fraction += time_factor/(-222.11 * char_I_actual_ppO2 + 37350.0);
1949 else if (char_I_actual_ppO2 < 170) 1951 //------------------------------------------------------------------------
1950 CNS_fraction += time_factor*0.00102; // example calculation: Sqrt((1.7/1.55)^20)*0.000404 1952 // Arieli et all.(2002): Modeling pulmonary and CNS O2 toxicity:
1951 else if (char_I_actual_ppO2 < 175) 1953 // J Appl Physiol 92: 248–256, 2002, doi:10.1152/japplphysiol.00434.2001
1954 // Formula (A1) based on value for 1.55 and c=20
1955 // example calculation: Sqrt((1.7/1.55)^20)*0.000404
1956 else if (char_I_actual_ppO2 < 172)
1957 CNS_fraction += time_factor*0.00102;
1958 else if (char_I_actual_ppO2 < 177)
1952 CNS_fraction += time_factor*0.00136; 1959 CNS_fraction += time_factor*0.00136;
1953 else if (char_I_actual_ppO2 < 180) 1960 else if (char_I_actual_ppO2 < 182)
1954 CNS_fraction += time_factor*0.00180; 1961 CNS_fraction += time_factor*0.00180;
1955 else if (char_I_actual_ppO2 < 185) 1962 else if (char_I_actual_ppO2 < 187)
1956 CNS_fraction += time_factor*0.00237; 1963 CNS_fraction += time_factor*0.00237;
1957 else if (char_I_actual_ppO2 < 190) 1964 else if (char_I_actual_ppO2 < 192)
1958 CNS_fraction += time_factor*0.00310; 1965 CNS_fraction += time_factor*0.00310;
1959 else if (char_I_actual_ppO2 < 195) 1966 else if (char_I_actual_ppO2 < 198)
1960 CNS_fraction += time_factor*0.00401; 1967 CNS_fraction += time_factor*0.00401;
1961 else if (char_I_actual_ppO2 < 200) 1968 else if (char_I_actual_ppO2 < 203)
1962 CNS_fraction += time_factor*0.00517; 1969 CNS_fraction += time_factor*0.00517;
1963 else if (char_I_actual_ppO2 < 230) 1970 else if (char_I_actual_ppO2 < 233)
1964 CNS_fraction += time_factor*0.0209; 1971 CNS_fraction += time_factor*0.0209;
1965 else 1972 else
1966 CNS_fraction += time_factor*0.0482; // value for 2.5 1973 CNS_fraction += time_factor*0.0482; // value for 2.5
1967 1974
1968 if( CNS_fraction > 9.99) 1975 if( CNS_fraction > 9.99)