changeset 710:d36f060e8203

bugfix CNS compute: NOAA tables are in ATA, not bar.
author jDG
date Wed, 08 May 2013 12:41:28 +0200
parents 74878be38d4c
children f555590f1419
files code_part1/OSTC_code_c_part2/p2_deco.c
diffstat 1 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Wed May 08 11:33:26 2013 +0200
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Wed May 08 12:41:28 2013 +0200
@@ -2155,27 +2155,33 @@
         time_factor = 30.0f;
     else if( char_I_step_is_1min == 2  )
         time_factor = 300.0f;
-
+    //------------------------------------------------------------------------
+    // Don't increase CNS below 0.5 bar, but keep it steady.
     if (char_I_actual_ppO2 < 50)
         ;   // no changes
+    //------------------------------------------------------------------------
+    // Below (and including) 1.60 bar
     else if (char_I_actual_ppO2 < 60)
-        CNS_fraction += time_factor/(-540.0 * char_I_actual_ppO2 + 54000.0);
+        CNS_fraction += time_factor/(-533.07 * char_I_actual_ppO2 + 54000.0);
     else if (char_I_actual_ppO2 < 70)
-        CNS_fraction += time_factor/(-450.0 * char_I_actual_ppO2 + 48600.0);
+        CNS_fraction += time_factor/(-444.22 * char_I_actual_ppO2 + 48600.0);
     else if (char_I_actual_ppO2 < 80)
-        CNS_fraction += time_factor/(-360.0 * char_I_actual_ppO2 + 42300.0);
+        CNS_fraction += time_factor/(-355.38 * char_I_actual_ppO2 + 42300.0);
     else if (char_I_actual_ppO2 < 90)
-        CNS_fraction += time_factor/(-270.0 * char_I_actual_ppO2 + 35100.0);
+        CNS_fraction += time_factor/(-266.53 * char_I_actual_ppO2 + 35100.0);
     else if (char_I_actual_ppO2 < 110)
-        CNS_fraction += time_factor/(-180.0 * char_I_actual_ppO2 + 27000.0);
+        CNS_fraction += time_factor/(-177.69 * char_I_actual_ppO2 + 27000.0);
     else if (char_I_actual_ppO2 < 150)
-        CNS_fraction += time_factor/( -90.0 * char_I_actual_ppO2 + 17100.0);
-    else if (char_I_actual_ppO2 < 160)
-        CNS_fraction += time_factor/(-225.0 * char_I_actual_ppO2 + 37350.0);
+        CNS_fraction += time_factor/( -88.84 * char_I_actual_ppO2 + 17100.0);
     else if (char_I_actual_ppO2 < 165)
-        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
-    else if (char_I_actual_ppO2 < 170)
-        CNS_fraction += time_factor*0.00102; // example calculation: Sqrt((1.7/1.55)^20)*0.000404
+        CNS_fraction += time_factor/(-222.11 * char_I_actual_ppO2 + 37350.0);
+    //------------------------------------------------------------------------
+    // Arieli et all.(2002): Modeling pulmonary and CNS O2 toxicity:
+    // J Appl Physiol 92: 248–256, 2002, doi:10.1152/japplphysiol.00434.2001
+    // Formula (A1) based on value for 1.55 and c=20
+    // example calculation: Sqrt((1.7/1.55)^20)*0.000404
+    else if (char_I_actual_ppO2 < 170)       
+        CNS_fraction += time_factor*0.00102; 
     else if (char_I_actual_ppO2 < 175)
         CNS_fraction += time_factor*0.00136;
     else if (char_I_actual_ppO2 < 180)