public static double v_given_ph(double p, double h) { double ret_val; try { ret_val = 1.0 / IF97.rhomass_phmass(p / 1000000.0, h / 1000.0); //UNIT CONVERSION UNTESTED! return(ret_val); } catch (Exception ex) { Debug.Log(String.Format("Got an exception: {0}\nReturning {1}", ex.Message, v_neutral)); got_error = true; return(v_neutral); } //return 1.0/IF97.rhomass_phmass(p/1000000.0,h/1000.0); //UNIT CONVERSION UNTESTED! }