示例#1
0
        internal static double TValueToRValue(double t, ABCParam param, ConvertMethod method)
        {
            double rnew, tnew;

            if (method == ConvertMethod.ITS90)
            {
                double ac, bc, cc;
                param.targetT = t;
                ac            = param.a;
                bc            = param.b;
                cc            = param.c;
                rnew          = GetWr(t);
                return(rnew + ac * (rnew - 1) + bc * (rnew - 1) * (rnew - 1) + cc * (rnew - 1) * (rnew - 1) * (rnew - 1));
            }
            if (method == ConvertMethod.DIN68 || method == ConvertMethod.DIN90 || method == ConvertMethod.ASTM)
            {
                double alpha, A, B, C;
                alpha = A = B = C = 0;
                if (method == ConvertMethod.DIN68)
                {
                    alpha     = 0.003850;
                    param.rtp = 100;
                    A         = 3.90802e-3;
                    B         = -5.8020e-7;
                    C         = -4.2735e-12;
                }
                if (method == ConvertMethod.DIN90)
                {
                    alpha     = 0;
                    param.rtp = 100;
                    A         = 3.90823e-3;
                    B         = -5.7750e-7;
                    C         = -4.1830e-12;
                    if (t >= 0)
                    {
                        C = 0;
                    }
                }
                if (method == ConvertMethod.ASTM)
                {
                    alpha     = 0.003911;
                    param.rtp = 100;
                    A         = 3.9692e-3;
                    B         = -5.8495e-7;
                    C         = -4.2325e-12;
                }
                tnew = t;

                return(param.rtp * (1 + A * tnew + B * tnew * tnew + C * (tnew - 100) * tnew * tnew * tnew));
            }
            throw new Exception("Unexpected convert method " + method.ToString());
        }
示例#2
0
        internal static double TValueToRValue(double t, ABCParam param, ConvertMethod method)
        {
            double rnew,tnew;
            if (method == ConvertMethod.ITS90)
            {
                double ac, bc, cc;
                param.targetT = t;
                ac = param.a;
                bc = param.b;
                cc = param.c;
                rnew = GetWr(t);
                return rnew + ac * (rnew - 1) + bc * (rnew - 1) * (rnew - 1) + cc * (rnew - 1) * (rnew - 1) * (rnew - 1);
            }
            if (method == ConvertMethod.DIN68 || method == ConvertMethod.DIN90 || method == ConvertMethod.ASTM)
            {
                double alpha, A, B, C;
                alpha = A = B = C = 0;
                if (method == ConvertMethod.DIN68)
                {
                    alpha = 0.003850;
                    param.rtp = 100;
                    A = 3.90802e-3;
                    B = -5.8020e-7;
                    C = -4.2735e-12;
                }
                if (method == ConvertMethod.DIN90)
                {
                    alpha = 0;
                    param.rtp = 100;
                    A = 3.90823e-3;
                    B = -5.7750e-7;
                    C = -4.1830e-12;
                    if (t >= 0)
                        C = 0;

                }
                if (method == ConvertMethod.ASTM)
                {
                    alpha = 0.003911;
                    param.rtp = 100;
                    A = 3.9692e-3;
                    B = -5.8495e-7;
                    C = -4.2325e-12;
                    
                }
                tnew = t;

                return param.rtp * (1 + A * tnew + B * tnew * tnew + C * (tnew - 100) * tnew * tnew * tnew);
            }
            throw new Exception("Unexpected convert method " + method.ToString());
        }