//Direct Strength Method F.3-2

        public AluminumLimitStateValue GetLocalBucklingStrength(double b, double t, LateralSupportType LateralSupportType,
                                                                FlexuralCompressionFiberPosition CompressionLocation, WeldCase WeldCase,
                                                                SubElementType SubElementType = SubElementType.Flat)
        {
            double S_xc = GetSectionModulusCompressionSxc(CompressionLocation);
            double M_np = this.GetPlasticMoment();
            FlexuralLocalBucklingElement LocalElement = new FlexuralLocalBucklingElement(this.Section.Material, b, t, LateralSupportType,
                                                                                         M_np, S_xc, WeldCase, SubElementType);

            double F_b = LocalElement.GetCriticalStress();
            double M_n = S_xc * F_b;
            AluminumLimitStateValue Y = GetFlexuralYieldingStrength(CompressionLocation);

            bool   applicable;
            double val;

            if (M_n > Y.Value)
            {
                applicable = false;
                val        = -1.0;
            }
            else
            {
                applicable = true;
                val        = 0.9 * M_n;
            }

            return(new AluminumLimitStateValue(val, applicable));
        }
        public static Dictionary <string, object> FlexuralYieldingAndRupture(CustomProfile Shape, AluminumMaterial AluminumMaterial,
                                                                             string FlexuralCompressionLocation = "Top", string Code = "AA2015")
        {
            //Default values
            double phiM_n = 0;


            FlexuralCompressionFiberPosition FlexuralCompression;
            //Calculation logic:
            bool IsValidStringCompressionLoc = Enum.TryParse(FlexuralCompressionLocation, true, out FlexuralCompression);

            if (IsValidStringCompressionLoc == false)
            {
                throw new Exception("Flexural compression location selection not recognized. Check input string.");
            }

            AluminumFlexuralMember m = new AluminumFlexuralMember();

            Kodestruct.Aluminum.AA.AA2015.AluminumMaterial a = new Kodestruct.Aluminum.AA.AA2015.AluminumMaterial(
                AluminumMaterial.Alloy, AluminumMaterial.Temper, AluminumMaterial.ThicknessRange, AluminumMaterial.ProductType);


            m.Section = new AluminumSection(a, Shape.Section);
            AluminumLimitStateValue ls_Y = m.GetFlexuralYieldingStrength(FlexuralCompression);

            AluminumLimitStateValue ls_R = m.GetFlexuralRuptureStrength();

            phiM_n = Math.Min(ls_Y.Value, ls_R.Value);

            return(new Dictionary <string, object>
            {
                { "phiM_n", phiM_n }
            });
        }
        public static Dictionary <string, object> FlexuralLocalBucklingCriticalStress(CustomProfile Shape, AluminumMaterial AluminumMaterial, double b, double t, string LateralSupportType,
                                                                                      string FlexuralCompressionLocation = "Top", string WeldCaseId = "NotAffected", string SectionSubElementType = "Flat", string Code = "AA2015")
        {
            //Default values
            double F_b = 0;


            //Calculation logic:
            FlexuralCompressionFiberPosition FlexuralCompression;
            //Calculation logic:
            bool IsValidStringCompressionLoc = Enum.TryParse(FlexuralCompressionLocation, true, out FlexuralCompression);

            if (IsValidStringCompressionLoc == false)
            {
                throw new Exception("Flexural compression location selection not recognized. Check input string.");
            }


            Kodestruct.Aluminum.AA.Entities.Enums.LateralSupportType LateralSupportTypeParsed;
            bool IsValidLateralSupportType = Enum.TryParse(LateralSupportType, true, out LateralSupportTypeParsed);

            if (IsValidLateralSupportType == false)
            {
                throw new Exception("Failed to convert string. LateralSupportType shall be OneEdge or BothEdges. Please check input");
            }


            WeldCase WeldCaseParsed;
            bool     IsValidWeldCase = Enum.TryParse(WeldCaseId, true, out WeldCaseParsed);

            if (IsValidWeldCase == false)
            {
                throw new Exception("Failed to convert string. WeldCase shall be NotAffected or WeldAffected. Please check input");
            }


            SubElementType SubElementType;
            bool           IsValidInputString = Enum.TryParse(SectionSubElementType, true, out SubElementType);

            if (IsValidInputString == false)
            {
                throw new Exception("Failed to convert string. Currently supported value is Flat. Please check input");
            }



            AluminumFlexuralMember m = new AluminumFlexuralMember();

            Kodestruct.Aluminum.AA.AA2015.AluminumMaterial a = new Kodestruct.Aluminum.AA.AA2015.AluminumMaterial(
                AluminumMaterial.Alloy, AluminumMaterial.Temper, AluminumMaterial.ThicknessRange, AluminumMaterial.ProductType);


            m.Section = new AluminumSection(a, Shape.Section);
            AluminumLimitStateValue ls_LB = m.GetLocalBucklingFlexuralCriticalStress(b, t, LateralSupportTypeParsed, FlexuralCompression, WeldCaseParsed, SubElementType);

            F_b = ls_LB.Value;


            return(new Dictionary <string, object>
            {
                { "F_b", F_b }
            });
        }