public double GetCriticalStress()
        {
            double F_e      = GetFe_();
            double lamda_1  = GetLambda1();
            double lamda_2  = GetLambda2();
            double lamda_eq = GetLambda_eq(F_e);
            double E        = Material.E;
            MaterialBucklingConstantProvider bcf = new MaterialBucklingConstantProvider(BucklingType.FlexuralCompression, this.SubElementType, Material, WeldCase);
            double C_p = bcf.C;
            double B_p = bcf.B;
            double k_2 = bcf.k_2;

            double F_b = 0;

            if (lamda_eq <= lamda_1)
            {
                F_b = ((M_np) / (S_xc));
            }
            else if (lamda_eq < lamda_2)
            {
                F_b = ((M_np) / (S_xc)) - (((M_np) / (S_xc)) - ((Math.Pow(Math.PI, 2) * E) / (Math.Pow(C_p, 2)))) * (((lamda_eq - lamda_1) / (C_p - lamda_1)));
            }
            else
            {
                F_b = ((k_2 * Math.Sqrt(B_p * E)) / (lamda_eq));
            }
            return(F_b);
        }
        private double GetLambda2()
        {
            MaterialBucklingConstantProvider bcf = new MaterialBucklingConstantProvider(BucklingType.FlexuralCompression, this.SubElementType, Material, WeldCase);
            double C_p     = bcf.C;
            double lambda2 = C_p;

            return(lambda2);
        }
        public void AluminumShapeReturnsBucklingConstant_C_p()
        {
            AluminumMaterial mat = new AluminumMaterial("6061", "T6", "0.062 or greater", "std structural profile");
            MaterialBucklingConstantProvider bcf = new MaterialBucklingConstantProvider(BucklingType.FlexuralCompression, SubElementType.Flat, mat, Aluminum.AA.Entities.WeldCase.NotAffected);
            double C_p             = bcf.C;
            double refValue        = 66.9; // from Design Manual
            double actualTolerance = EvaluateActualTolerance(C_p, refValue);

            Assert.LessOrEqual(actualTolerance, tolerance);
        }
        private double GetLambda1()
        {
            MaterialBucklingConstantProvider bcf = new MaterialBucklingConstantProvider(BucklingType.FlexuralCompression, this.SubElementType, Material, WeldCase);
            double F_cy     = this.Material.F_cy;
            double B_p      = bcf.B;
            double D_p      = bcf.D;
            double lambda_1 = ((B_p - F_cy) / (D_p));

            return(lambda_1);
        }