コード例 #1
0
        /// <summary>
        /// Calculate VFA/TA (volatile fatty acids / total alkalinity) value
        /// out of given ADM state vector x
        ///
        /// Erwin Voß:
        /// FOS/TAC-Herleitung, Methodik und Praktische Anwendung, VE efficiency
        /// solutions GmbH
        ///
        /// </summary>
        /// <param name="x">ADM state vector</param>
        /// <param name="FOS"></param>
        /// <param name="TAC"></param>
        /// <returns></returns>
        public static physValueBounded calcFOSTACOfADMstate(double[] x, out physValue FOS,
                                                            out physValue TAC)
        {
            // see ref. 1)
            //
            FOS = biogas.ADMstate.calcVFAOfADMstate(x, "gHAceq/l");


            // see ref. 1)
            //
            TAC = biogas.ADMstate.calcTACOfADMstate(x, "gCaCO3eq/l");

            //

            physValueBounded FOS_TAC;

            if (TAC != new science.physValue("TAC_min", 0, "gCaCO3eq/l"))
            {
                FOS_TAC = new physValueBounded(FOS / TAC);
            }
            else
            {
                FOS_TAC = new science.physValueBounded("FOS_TAC", 0, "gHAceq/gCaCO3eq");
            }

            //
            FOS_TAC.Symbol = "FOS_TAC";

            FOS_TAC.setLB(Double.NegativeInfinity);

            FOS_TAC.printIsOutOfBounds();

            return(FOS_TAC);
        }
コード例 #2
0
        /// <summary>
        /// TODO:
        /// Quelle für dieses Verhältnis suchen!
        /// Einheit in mol/l oder g/l, oder...?
        ///
        /// Calculate ratio of acetic to propionic acid in mol/l
        /// </summary>
        /// <param name="x">ADM state vector</param>
        /// <returns></returns>
        public static physValueBounded calcAcetic_vs_PropionicOfADMstate(double[] x)
        {
            string unit = "mol/l";

            // mol/l
            physValue Sac = biogas.ADMstate.calcFromADMstate(x, "Sac", unit);
            // mol/l
            physValue Spro = biogas.ADMstate.calcFromADMstate(x, "Spro", unit);


            physValueBounded Sac_vs_Spro;

            if (Spro != new science.physValue(0, unit))
            {
                Sac_vs_Spro = new physValueBounded(Sac / Spro);
            }
            else
            {
                Sac_vs_Spro = new science.physValueBounded("Ac_vs_Pro", 0, "mol/mol");
            }

            //
            Sac_vs_Spro.Symbol = "Ac_vs_Pro";
            Sac_vs_Spro        = Sac_vs_Spro.convertUnit("mol/mol");

            //Sac_vs_Spro.setLB(0);

            Sac_vs_Spro.printIsOutOfBounds();

            return(Sac_vs_Spro);
        }
コード例 #3
0
        /// <summary>
        /// unary minus: Returns -v
        /// </summary>
        /// <param name="v">v</param>
        /// <returns>-v</returns>
        public static physValueBounded operator-(physValueBounded v)
        {
            physValueBounded v_new = new physValueBounded(-(physValue)v);

            v_new._lb = -v.LB;
            v_new._ub = -v.UB;

            return(v_new);
        }
コード例 #4
0
 /// <summary>
 /// constructor used to copy physValueBoundeds, the returned physValueBounded
 /// is identical to the template
 /// </summary>
 /// <param name="template">template</param>
 public physValueBounded(physValueBounded template) : base(template)
 {
     _lb = template.LB;
     _ub = template.UB;
 }