示例#1
0
 /// <summary>
 /// Initializes a new UserInputIntent with standard UserInputDialog
 /// </summary>
 /// <param name="dialog"></param>
 public UserInputIntent(IServiceProvider serviceProvider, UserInputDialog <TContext> dialog)
     : base(serviceProvider)
 {
     // Notes - all intents are singleton. So Dialogs should also be registered as singletons.
     // This means it doesn't maintain any transient state by itself!
     this.Dialog = dialog;
 }
示例#2
0
        private void Med_Click(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Dimensiune masca ", new string[] { "dim" });

            if (dlg.ShowDialog().Value == true)
            {
                int dim = (int)dlg.Values[0];
                mainControl.ProcessedGrayscaleImage = Tools.MedianFilter(mainControl.OriginalGrayscaleImage, dim);
            }
        }
示例#3
0
        private void Simple_Click(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Prag pentru binarizare ", new string[] { "dim" });

            if (dlg.ShowDialog().Value == true)
            {
                int dim = (int)dlg.Values[0];
                mainControl.ProcessedGrayscaleImage = Tools.BinarizareSimpla(mainControl.OriginalGrayscaleImage, dim);
            }
        }
        private void RotationClick(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Degree", new string[] { "alfa=" });

            if (mainControl.OriginalGrayscaleImage != null)
            {
                if (dlg.ShowDialog().Value == true)
                {
                    mainControl.ProcessedGrayscaleImage = InterpolationRotation.Rotation_Method(mainControl.OriginalGrayscaleImage, (int)dlg.Values[0], (int)lastClick.X, (int)lastClick.Y);
                }
            }
        }
示例#5
0
 private void Gamma_Operator_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         UserInputDialog dlg1 = new UserInputDialog("Gamma correction", new string[] { "gamma" });
         if (dlg1.ShowDialog().Value == true)
         {
             double gamma = (double)dlg1.Values[0];
             mainControl.ProcessedGrayscaleImage = Tools.GammaCorrection(mainControl.OriginalGrayscaleImage, gamma);
         }
     }
 }
        private void BinarClick2(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Binar", new string[] { "t1=", "t2=" });

            if (mainControl.OriginalGrayscaleImage != null)
            {
                if (dlg.ShowDialog().Value == true)
                {
                    mainControl.ProcessedGrayscaleImage = Binarizare2.Binarizare2_Method(mainControl.OriginalGrayscaleImage, (int)dlg.Values[0], (int)dlg.Values[1]);
                }
            }
        }
示例#7
0
 private void Closing_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         int             n      = 0;
         UserInputDialog dialog = new UserInputDialog("Closing", new string[] { "n" });
         if (dialog.ShowDialog().Value == true)
         {
             n = (int)dialog.Values[0];
         }
         mainControl.ProcessedGrayscaleImage = Tools.Closing(mainControl.OriginalGrayscaleImage, n);
     }
 }
示例#8
0
 private void HorizontalSobel_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         int             t      = 0;
         UserInputDialog dialog = new UserInputDialog("HorSobel", new string[] { "t" });
         if (dialog.ShowDialog().Value == true)
         {
             t = (int)dialog.Values[0];
         }
         mainControl.ProcessedGrayscaleImage = Tools.HorizontalSobel(mainControl.OriginalGrayscaleImage, t);
     }
 }
示例#9
0
 private void BinomialFilterRGB_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalColorImage != null)
     {
         int             n      = 0;
         UserInputDialog dialog = new UserInputDialog("BinomialFilterRGB", new string[] { "n" });
         if (dialog.ShowDialog().Value == true)
         {
             n = (int)dialog.Values[0];
         }
         mainControl.ProcessedColorImage = Tools.BinomialFilterRGB(mainControl.OriginalColorImage, n);
     }
 }
        private void CCL_Click(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Threshold", new string[] { "T=" });

            if (mainControl.OriginalGrayscaleImage != null)
            {
                if (dlg.ShowDialog().Value == true)
                {
                    mainControl.OriginalGrayscaleImage  = Binarizare.Binarizare_Method(mainControl.OriginalGrayscaleImage, (int)dlg.Values[0]);
                    mainControl.ProcessedGrayscaleImage = AppCCL.CCL_Method(mainControl.OriginalGrayscaleImage);
                }
            }
        }
        private void HoughClick(object sender, RoutedEventArgs e)
        {
            UserInputDialog dlg = new UserInputDialog("Threshold", new string[] { "T=" });

            if (mainControl.OriginalGrayscaleImage != null)
            {
                if (dlg.ShowDialog().Value == true)
                {
                    mainControl.OriginalGrayscaleImage  = AdaptSobel.Sobel(mainControl.OriginalGrayscaleImage, (int)dlg.Values[0]);
                    mainControl.ProcessedGrayscaleImage = Hough.HoughLines_Method(mainControl.OriginalGrayscaleImage, mainControl.OriginalImageCanvas);
                }
            }
        }
示例#12
0
 private void BilinearInterpolationScale_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         float           c      = 0;
         UserInputDialog dialog = new UserInputDialog("InterpolationScale", new string[] { "coef" });
         if (dialog.ShowDialog().Value == true)
         {
             c = (float)dialog.Values[0];
         }
         mainControl.ProcessedGrayscaleImage = Tools.BilinearInterpolationScale(mainControl.OriginalGrayscaleImage, c, lastClick);
     }
 }
示例#13
0
        private void Hough_click(object sender, RoutedEventArgs e)
        {
            if (mainControl.OriginalGrayscaleImage != null)
            {
                UserInputDialog dlg = new UserInputDialog("Prag", new string[] { "Prag" });

                if (dlg.ShowDialog().Value)
                {
                    int t = (int)dlg.Values[0];
                    mainControl.ProcessedGrayscaleImage = Tools.Hough(mainControl.OriginalGrayscaleImage, t);
                }
            }
        }
示例#14
0
        private void Xor_Click(object sender, RoutedEventArgs e)
        {
            if (mainControl.OriginalGrayscaleImage != null)
            {
                UserInputDialog dlg = new UserInputDialog("Prag", new string[] { "Prag pentru binarizare" });

                if (dlg.ShowDialog().Value)
                {
                    int t = (int)dlg.Values[0];
                    mainControl.ProcessedGrayscaleImage = Tools.Xor(t, mainControl.OriginalGrayscaleImage);
                }
            }
        }
示例#15
0
        private void Rot_Click(object sender, RoutedEventArgs e)
        {
            if (mainControl.OriginalGrayscaleImage != null)
            {
                UserInputDialog dlg = new UserInputDialog("Unghi", new string[] { "Unghiul de rotatie" });

                if (dlg.ShowDialog().Value)
                {
                    double t = (double)dlg.Values[0];
                    mainControl.ProcessedGrayscaleImage = Tools.BilinearRotation(mainControl.OriginalGrayscaleImage, t);
                }
            }
        }
示例#16
0
 private void Contrast_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         int             E      = 0;
         int             m      = 0;
         UserInputDialog dialog = new UserInputDialog("Coeficienti", new string[] { "E", "m" });
         if (dialog.ShowDialog().Value == true)
         {
             E = (int)dialog.Values[0];
             m = (int)dialog.Values[1];
         }
         mainControl.ProcessedGrayscaleImage = Tools.ChangeContrast(mainControl.OriginalGrayscaleImage, E, m);
     }
 }
示例#17
0
 private void Binarizare2P_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         int             T1     = 0;
         int             T2     = 0;
         UserInputDialog dialog = new UserInputDialog("Coeficienti", new string[] { "T1", "T2" });
         if (dialog.ShowDialog().Value == true)
         {
             T1 = (int)dialog.Values[0];
             T2 = (int)dialog.Values[1];
         }
         mainControl.ProcessedGrayscaleImage = Tools.Binarizare(mainControl.OriginalGrayscaleImage, T1, T2);
     }
 }
示例#18
0
        private void Bil_Click(object sender, RoutedEventArgs e)
        {
            double sigmaD;
            double sigmaR;

            if (mainControl.OriginalGrayscaleImage != null)
            {
                UserInputDialog dlg = new UserInputDialog("Introduceti cele doua sigma", new string[] { "sigmaD", "sigmaR" });

                if (dlg.ShowDialog().Value == true)
                {
                    sigmaD = (double)dlg.Values[0];
                    sigmaR = (double)dlg.Values[1];

                    mainControl.ProcessedGrayscaleImage = Tools.Filtrare_bilaterala(mainControl.OriginalGrayscaleImage, sigmaD, sigmaR);
                }
            }
        }
示例#19
0
        private void ATH_Click(object sender, RoutedEventArgs e)
        {
            int dim;

            if (mainControl.OriginalGrayscaleImage != null)
            {
                UserInputDialog dlg = new UserInputDialog("Dimensiune fereastra ", new string[] { "dim", "b" });
                float           b;

                if (dlg.ShowDialog().Value == true)
                {
                    dim = (int)dlg.Values[0];
                    b   = (float)dlg.Values[1];

                    mainControl.ProcessedGrayscaleImage = Tools.AdaptativBinarization(mainControl.OriginalGrayscaleImage, dim, b);
                }
            }
        }
示例#20
0
        private async Task Add()
        {
            try
            {
                UserInputDialog _defaultInputDialog = new UserInputDialog("Please fill in the details of new account", mode: "add");

                if (_defaultInputDialog.ShowDialog() == true)
                {
                    if (_defaultInputDialog.Result is null || _defaultInputDialog.Result.Username == "")
                    {
                        IsLoading = false;
                        MessageBox.Show("New username can't be empty", "UPO$$");
                    }
                    else if (_defaultInputDialog.Result.Password == "")
                    {
                        IsLoading = false;
                        MessageBox.Show("New password can't be empty", "UPO$$");
                    }
                    else
                    {
                        dynamic param = new
                        {
                            username   = _defaultInputDialog.Result.Username,
                            password   = _defaultInputDialog.Result.Password,
                            role       = _defaultInputDialog.Result.Role,
                            branchName = _defaultInputDialog.Result.Branch_name
                        };

                        RootUserObject Response = await ObjUserService.PostAPI("addUser", param, _Path);

                        MessageBox.Show(Response.Msg, "UPO$$");

                        if (Response.Status is "ok")
                        {
                            RefreshTextBox();
                            await Search();
                        }
                    }
                }
            }
        public static void ComputeAdditionalProperty(ref SystemInputStream _in, ref double AirX, ref double WaterX)
        {
            #region Variable declarations
            const double Epsilon = 0.75;

            //All properties are final state
            double DensityWaterInitial;
            double DensityAirInitial;

            double MassFlowWaterFinal;
            double MassFlowAirFinal;

            double TWaterFinal;
            double TAirFinal;
            double TWaterMeanFinal;
            double TAirMeanFinal;
            double ViscosityAir;
            double ViscosityWater;
            double CpAir;
            double CpWater;
            double PrandtlAir;
            double PrandtlWater;
            double G_Air;
            double G_Water;
            double Reynolds_Air;
            double Reynolds_Water;
            double J_Water;
            double F_Water;
            double J_Air;
            double F_Air;
            double H_Water;
            double H_Air;
            double c7;
            double c8;
            double c9;
            double VelocityAir;
            double FinEfficiency;
            double OverallEfficiency;
            double Rw;
            double UaInverse;
            double C_Water;
            double C_Air;
            double C_Min;
            double C_Star;
            double NTU;
            double epsilon;
            double ConductionAreaWater;
            double ConductionAreaAir;
            double lambdaAir;
            double lambdaWater;
            double M1;
            double M2;
            double EpsilonRatio;
            double deltaEpsilon;
            double ActualEpsilon;
            double HeatTransferRate;
            double prevvalWater;
            double prevvalAir;
            #endregion

            #region User Input acquisition
            double L1 = _in.NumericalReadings.First(x => x.Parameter == "L1").Value;
            double L2 = _in.NumericalReadings.First(x => x.Parameter == "L2").Value;
            double L3 = _in.NumericalReadings.First(x => x.Parameter == "L3").Value;
            double Xt = _in.NumericalReadings.First(x => x.Parameter == "Xt").Value;
            double Xl = _in.NumericalReadings.First(x => x.Parameter == "Xl").Value;
            double Do = _in.NumericalReadings.First(x => x.Parameter == "Do").Value;
            double Di = _in.NumericalReadings.First(x => x.Parameter == "Di").Value;
            double DelH = _in.NumericalReadings.First(x => x.Parameter == "DelH").Value;
            double FinThickness = _in.NumericalReadings.First(x => x.Parameter == "FinThickness").Value;

            double QWaterInitial = _in.NumericalReadings.First(x => x.Parameter == "QWaterInitial").Value;
            double TWaterInitial = _in.NumericalReadings.First(x => x.Parameter == "TWaterInitial").Value;
            double PWaterInitial = _in.NumericalReadings.First(x => x.Parameter == "PWaterInitial").Value;

            double QAirInitial = _in.NumericalReadings.First(x => x.Parameter == "QAirInitial").Value;
            double TAirInitial = _in.NumericalReadings.First(x => x.Parameter == "TAirInitial").Value;
            double PAirInitial = _in.NumericalReadings.First(x => x.Parameter == "PAirInitial").Value;
            //double Nr = _in.NumericalReadings.First(x => x.Parameter == "Nr").Value;
            double FinPitch = _in.NumericalReadings.First(x => x.Parameter == "FinPitch").Value;

            double Nr = L3 / Xt;

            DensityWaterInitial = PWaterInitial / (287.04 * (TWaterInitial));
            DensityAirInitial = PAirInitial / (287.04 * (TAirInitial));

            MassFlowWaterFinal = QWaterInitial * DensityWaterInitial;
            MassFlowAirFinal = QAirInitial * DensityAirInitial;
            #endregion

            #region Iteration
            do
            {
                #region TMean calculation

                TWaterFinal = TWaterInitial - Epsilon * (TWaterInitial - TAirInitial);
                TAirFinal = TAirInitial + Epsilon * (MassFlowWaterFinal / MassFlowAirFinal) * (TWaterInitial - TAirInitial);
                TWaterMeanFinal = (TWaterFinal + TWaterInitial) / 2;
                TAirMeanFinal = (TAirFinal + TAirInitial) / 2;

                #endregion

                prevvalAir = TAirFinal;
                prevvalWater = TWaterFinal;

                #region CoolProp

                //Calculate additional properties
                ViscosityAir = CoolProp.PropsSI("V", "T", TAirMeanFinal, "P", 101325, "Air");
                ViscosityWater = CoolProp.PropsSI("V", "T", TWaterMeanFinal, "P", 101325, "Water");
                CpAir = CoolProp.PropsSI("CPMASS", "T", TWaterMeanFinal, "P", 101325, "Water");
                CpWater = CoolProp.PropsSI("CPMASS", "T", TWaterMeanFinal, "P", 101325, "Water");
                PrandtlAir = CoolProp.PropsSI("CPMASS", "T", TWaterMeanFinal, "P", 101325, "Water");
                PrandtlWater = CoolProp.PropsSI("CPMASS", "T", TWaterMeanFinal, "P", 101325, "Water");

                #endregion

                #region Calculate G and Re

                G_Air = MassFlowAirFinal /
                        ((_in.SysType == SystemType.Inline)
                            ? _in.TubeOutsideInlineData.TotalMinFfArea
                            : _in.TubeOutsideStaggered.TotalMinFfArea);

                G_Water = MassFlowWaterFinal /
                          ((_in.SysType == SystemType.Inline)
                              ? _in.TubeOutsideInlineData.TotalMinFfArea
                              : _in.TubeOutsideStaggered.TotalMinFfArea);

                Reynolds_Air = G_Air * ((_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.HydDiameter
                    : _in.TubeOutsideStaggered.HydDiameter) / ViscosityAir;

                Reynolds_Water = G_Water * ((_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.HydDiameter
                    : _in.TubeOutsideStaggered.HydDiameter) / ViscosityWater;

                #endregion

                #region Calculation of J

                if (Nr <= 1)
                {
                    if (_in.SysType == SystemType.Inline)
                    {

                        double c1 = 1.9 - 0.23 * Math.Log(Reynolds_Water);
                        double c2 = -0.236 + 0.126 * Math.Log(Reynolds_Water);
                        J_Water = 0.108 * Math.Pow(Reynolds_Water, -0.29) * Math.Pow(Xt / Xl, c1) * Math.Pow(FinPitch / Do, 1.084) *
                                  Math.Pow(FinPitch / _in.TubeOutsideInlineData.HydDiameter, -0.786) *
                                  Math.Pow(FinPitch / Xt, c2);

                        c1 = 1.9 - 0.23 * Math.Log(Reynolds_Air);
                        c2 = -0.236 + 0.126 * Math.Log(Reynolds_Air);
                        J_Air = 0.108 * Math.Pow(Reynolds_Air, -0.29) * Math.Pow(Xt / Xl, c1) * Math.Pow(FinPitch / Do, 1.084) *
                                Math.Pow(FinPitch / _in.TubeOutsideInlineData.HydDiameter, -0.786) *
                                Math.Pow(FinPitch / Xt, c2);
                    }
                    else
                    {
                        double c1 = 1.9 - 0.23 * Math.Log(Reynolds_Water);
                        double c2 = -0.236 + 0.126 * Math.Log(Reynolds_Water);
                        J_Water = 0.108 * Math.Pow(Reynolds_Water, -0.29) * Math.Pow(Xt / Xl, c1) * Math.Pow(FinPitch / Do, 1.084) *
                                  Math.Pow(FinPitch / _in.TubeOutsideStaggered.HydDiameter, -0.786) *
                                  Math.Pow(FinPitch / Xt, c2);

                        c1 = 1.9 - 0.23 * Math.Log(Reynolds_Air);
                        c2 = -0.236 + 0.126 * Math.Log(Reynolds_Air);
                        J_Air = 0.108 * Math.Pow(Reynolds_Air, -0.29) * Math.Pow(Xt / Xl, c1) * Math.Pow(FinPitch / Do, 1.084) *
                                Math.Pow(FinPitch / _in.TubeOutsideStaggered.HydDiameter, -0.786) *
                                Math.Pow(FinPitch / Xt, c2);
                    }
                }
                else
                {

                    if (_in.SysType == SystemType.Inline)
                    {
                        //Water
                        double c3 = -0.361 - 0.042 * Nr / Math.Log(Reynolds_Water) +
                                    0.158 * Math.Log(Nr * Math.Pow(FinPitch / Do, 0.41));
                        double c4 = -1.224 -
                                    0.076 * Math.Pow(Xl / _in.TubeOutsideInlineData.HydDiameter, 1.42) /
                                    Math.Log(Reynolds_Water);
                        double c5 = -0.083 + 0.058 * Nr / Math.Log(Reynolds_Water);
                        double c6 = -5.735 + 1.21 * Math.Log(Reynolds_Water / Nr);
                        J_Water = 0.086 * Math.Pow(Reynolds_Water, c3) * Math.Pow(Nr, c4) * Math.Pow(FinPitch / Do, c5) *
                                  Math.Pow(FinPitch / _in.TubeOutsideInlineData.HydDiameter, c6) *
                                  Math.Pow(FinPitch / Xt, -0.93);
                        //Air
                        c3 = -0.361 - 0.042 * Nr / Math.Log(Reynolds_Air) + 0.158 * Math.Log(Nr * Math.Pow(FinPitch / Do, 0.41));
                        c4 = -1.224 -
                             0.076 * Math.Pow(Xl / _in.TubeOutsideInlineData.HydDiameter, 1.42) / Math.Log(Reynolds_Air);
                        c5 = -0.083 + 0.058 * Nr / Math.Log(Reynolds_Air);
                        c6 = -5.735 + 1.21 * Math.Log(Reynolds_Air / Nr);
                        J_Air = 0.086 * Math.Pow(Reynolds_Air, c3) * Math.Pow(Nr, c4) * Math.Pow(FinPitch / Do, c5) *
                                Math.Pow(FinPitch / _in.TubeOutsideInlineData.HydDiameter, c6) *
                                Math.Pow(FinPitch / Xt, -0.93);
                    }
                    else
                    {
                        //Water
                        double c3 = -0.361 - 0.042 * Nr / Math.Log(Reynolds_Water) +
                                    0.158 * Math.Log(Nr * Math.Pow(FinPitch / Do, 0.41));
                        double c4 = -1.224 -
                                    0.076 * Math.Pow(Xl / _in.TubeOutsideStaggered.HydDiameter, 1.42) /
                                    Math.Log(Reynolds_Water);
                        double c5 = -0.083 + 0.058 * Nr / Math.Log(Reynolds_Water);
                        double c6 = -5.735 + 1.21 * Math.Log(Reynolds_Water / Nr);
                        J_Water = 0.086 * Math.Pow(Reynolds_Water, c3) * Math.Pow(Nr, c4) * Math.Pow(FinPitch / Do, c5) *
                                  Math.Pow(FinPitch / _in.TubeOutsideStaggered.HydDiameter, c6) *
                                  Math.Pow(FinPitch / Xt, -0.93);
                        //Air
                        c3 = -0.361 - 0.042 * Nr / Math.Log(Reynolds_Air) + 0.158 * Math.Log(Nr * Math.Pow(FinPitch / Do, 0.41));
                        c4 = -1.224 -
                             0.076 * Math.Pow(Xl / _in.TubeOutsideStaggered.HydDiameter, 1.42) / Math.Log(Reynolds_Air);
                        c5 = -0.083 + 0.058 * Nr / Math.Log(Reynolds_Air);
                        c6 = -5.735 + 1.21 * Math.Log(Reynolds_Air / Nr);
                        J_Air = 0.086 * Math.Pow(Reynolds_Air, c3) * Math.Pow(Nr, c4) * Math.Pow(FinPitch / Do, c5) *
                                Math.Pow(FinPitch / _in.TubeOutsideStaggered.HydDiameter, c6) * Math.Pow(FinPitch / Xt, -0.93);
                    }
                }

                #endregion

                #region H Calculation

                H_Water = J_Water * G_Water * CpWater / Math.Pow(PrandtlWater, (double)2 / 3);
                H_Air = J_Air * G_Air * CpAir / Math.Pow(PrandtlAir, (double)2 / 3);

                #endregion

                #region F Calculation

                c7 = -0.764 + 0.739 * Xt / Xl + 0.177 * FinPitch / Do - 0.00758 / Nr;
                c8 = -15.689 + 64.021 / Math.Log(Reynolds_Water);
                c9 = 1.696 - 15.695 / Math.Log(Reynolds_Water);
                F_Water = 0.0267 * Math.Pow(Reynolds_Water, c7) * Math.Pow(Xt / Xl, c8) * Math.Pow(FinPitch / Do, c9);

                c7 = -0.764 + 0.739 * Xt / Xl + 0.177 * FinPitch / Do - 0.00758 / Nr;
                c8 = -15.689 + 64.021 / Math.Log(Reynolds_Air);
                c9 = 1.696 - 15.695 / Math.Log(Reynolds_Air);
                F_Air = 0.0267 * Math.Pow(Reynolds_Air, c7) * Math.Pow(Xt / Xl, c8) * Math.Pow(FinPitch / Do, c9);

                #endregion

                #region Fin Efficiency

                VelocityAir = QAirInitial / (L1 * L3 - Nr * L1 * Do);
                if (VelocityAir <= 15 && VelocityAir >= 6)
                {
                    MessageBox.Show("Velocity should be between 6m/s and 15m/s", "Input out of limits");
                    return;
                }

                FinEfficiency = 7.41 * Math.Pow(VelocityAir, -0.12) *
                                Math.Pow(Xt / (2 * FinThickness), -2.32) * Math.Pow(Xl / (2 * FinThickness), -0.198);

                OverallEfficiency = 1 - ((1 - FinEfficiency) * (L2 * L3 - _in.Nt * Math.PI * Do * Do) /
                                         ((_in.SysType == SystemType.Inline)
                                             ? _in.TubeOutsideInlineData.TotalHeatArea
                                             : _in.TubeOutsideStaggered.TotalHeatArea));

                Rw = (Do - Di) / (_in.MaterialCoeff * (_in.Nt + 1) * 2 * L1 * L2);

                #endregion

                #region UA Calculation

                if (_in.SysType == SystemType.Inline)
                    UaInverse = Rw + (1 / (OverallEfficiency * H_Water * _in.TubeOutsideInlineData.TotalHeatArea)) +
                                (1 / (OverallEfficiency * H_Air * _in.TubeOutsideInlineData.TotalHeatArea));
                else
                    UaInverse = Rw + (1 / (OverallEfficiency * H_Water * _in.TubeOutsideStaggered.TotalHeatArea)) +
                                (1 / (OverallEfficiency * H_Air * _in.TubeOutsideStaggered.TotalHeatArea));

                C_Water = MassFlowWaterFinal * CpWater;
                C_Air = MassFlowAirFinal * CpAir;
                C_Min = Math.Min(C_Air, C_Water);
                C_Star = (C_Water / C_Air);
                if (C_Star > 1) C_Star = 1 / C_Star;

                NTU = 1 / (UaInverse * C_Min);

                #endregion

                epsilon = FactorialCompute(25, NTU, C_Star);
                ConductionAreaWater = _in.Nt * Math.PI * Di * L1;
                ConductionAreaAir = _in.Nt * Math.PI * Do * L1;

                lambdaAir = _in.MaterialCoeff * ConductionAreaAir / (L1 * C_Air);
                lambdaWater = _in.MaterialCoeff * ConductionAreaWater / (L1 * C_Water);

                M1 = H_Air / H_Water;
                M2 = lambdaWater / lambdaAir;

                XPlatHelper.OpenImageTables();

                while (true)
                {
                    UserInputDialog userInput = new UserInputDialog("Enter Delta(Epsilon)/Epsilon");
                    userInput.ShowDialog();
                    if (!string.IsNullOrWhiteSpace(userInput.Answer))
                    {
                        double x;
                        if (double.TryParse(userInput.Answer, out x))
                        {
                            EpsilonRatio = x;
                            break;
                        }
                    }
                }

                deltaEpsilon = EpsilonRatio * Epsilon;
                ActualEpsilon = Epsilon - deltaEpsilon;

                HeatTransferRate = ActualEpsilon * (TAirInitial - TWaterInitial) * C_Min;

                TWaterFinal = prevvalWater - HeatTransferRate / C_Water;
                TAirFinal = prevvalAir - HeatTransferRate / C_Air;
            } while (!((Math.Abs((prevvalWater - TWaterFinal) / prevvalWater) < 0.05) &&
                     (Math.Abs((prevvalAir - TAirFinal) / prevvalAir) < 0.05)));
            #endregion

            {
                double TMeanAir = (TAirInitial + TAirFinal) / 2;
                double TMeanWater = (TWaterInitial + TWaterFinal) / 2;
                double RoFinalAir = (PAirInitial / 287.04) / TAirFinal;
                double RoFinalWater = (PWaterInitial / 287.04) / TWaterFinal;
                double RoMeanAir = 2 * RoFinalAir * DensityAirInitial / (RoFinalAir + DensityAirInitial);
                double RoMeanWater = 2 * RoFinalWater * DensityWaterInitial / (RoFinalWater + DensityWaterInitial);
                double RhFinal = (_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.TotalMinFfArea
                    : _in.TubeOutsideStaggered.TotalMinFfArea;
                RhFinal /= 2;
                double GAirFinal = MassFlowAirFinal / ((_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.TotalMinFfArea
                    : _in.TubeOutsideStaggered.TotalMinFfArea);
                double GWaterFinal = MassFlowWaterFinal / ((_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.TotalMinFfArea
                    : _in.TubeOutsideStaggered.TotalMinFfArea);

                XPlatHelper.OpenFinalTable();
                double Kc, Ke;
                while (true)
                {
                    UserInputDialog userInput = new UserInputDialog("Enter Kc");
                    userInput.ShowDialog();
                    if (!string.IsNullOrWhiteSpace(userInput.Answer))
                    {
                        double x;
                        if (double.TryParse(userInput.Answer, out x))
                        {
                            Kc = x;
                            break;
                        }
                    }
                }
                while (true)
                {
                    UserInputDialog userInput = new UserInputDialog("Enter Ke");
                    userInput.ShowDialog();
                    if (!string.IsNullOrWhiteSpace(userInput.Answer))
                    {
                        double x;
                        if (double.TryParse(userInput.Answer, out x))
                        {
                            Ke = x;
                            break;
                        }
                    }
                }

                double Sigma = (_in.SysType == SystemType.Inline)
                    ? _in.TubeOutsideInlineData.RatioFfFrontalArea
                    : _in.TubeOutsideStaggered.RatioFfFrontalArea;

                double delPAir =
                    Math.Pow(GAirFinal, 2)/(2*DensityAirInitial)*(
                        (1 - Sigma*Sigma + Kc) + 2*(DensityAirInitial/RoFinalAir - 1) +
                        (F_Air*L1/RhFinal*DensityAirInitial/RoMeanAir)
                        - (1 - Sigma*Sigma - Ke*DensityAirInitial/RoFinalAir));

                double delPWater =
                    Math.Pow(GWaterFinal, 2) / (2 * DensityWaterInitial) * (
                        (1 - Sigma * Sigma + Kc) + 2 * (DensityWaterInitial / RoFinalWater - 1) +
                        (F_Water * L1 / RhFinal * DensityWaterInitial / RoMeanWater)
                        - (1 - Sigma * Sigma - Ke * DensityWaterInitial / RoFinalWater));

                AirX = delPAir;
                WaterX = delPWater;

            }
        }