internal double GetRequiredShearStress()
        {
            double frv = 0.0;
            double F2  = Math.Abs(this.FindMaximumForce(ForceType.F2, true).F2);
            double F3  = Math.Abs(this.FindMaximumForce(ForceType.F3, true).F3);
            double V   = Math.Max(F2, F3);
            double A   = this.Area;

            if (A != 0.0)
            {
                frv = V / A;

                ICalcLogEntry ent = Log.CreateNewEntry();
                ent.ValueName = v.frv;
                ent.AddDependencyValue(v.Ab, A);
                ent.AddDependencyValue(v.Vb, V);
                ent.DescriptionReference = d.frv;
                ent.FormulaID            = f.frv;
                ent.VariableValue        = frv.ToString();
                AddToLog(ent);
            }
            else
            {
                throw new Exception("Bolt load information not available");
            }

            return(frv);
        }
        internal double CheckMaximumAvailableTensileStrength(double F_pp_nt)
        {
            double Fnt = NominalTensileStress;

            if (F_pp_nt > Fnt)
            {
                ICalcLogEntry ent = Log.CreateNewEntry();
                ent.ValueName = v.F_pp_nt;
                ent.AddDependencyValue(v.Fnt, Fnt);
                ent.DescriptionReference = d.F_pp_nt;
                ent.FormulaID            = f.F_pp_ntMax;
                ent.VariableValue        = F_pp_nt.ToString();
                AddToLog(ent);
                return(Fnt);
            }
            return(F_pp_nt);
        }
        public double GetSlipResistanceReductionFactor(double T_u)
        {
            double ksc = 0.0;
            //Get tension per bolt
            double Du     = pretensionMultiplier;
            double phiR_n = this.GetAvailableTensileStrength();

            if (T_u > phiR_n)
            {
                throw new Exception("Bolt factored force exceeeds capacity. Reduced slip strength cannot be calculated.");
            }
            ICalcLogEntry ent = Log.CreateNewEntry();

            ent.ValueName            = v.ksc;
            ent.DescriptionReference = d.ksc;

            if (T_b == 0.0)
            {
                throw new Exception("Bolt pretension cannot be zero");
            }

            if (Du == 0.0)
            {
                throw new Exception("Multiplier that reflects the ratio of the mean installed bolt pretension to the specified minimum bolt pretension cannot be zero");
            }

            ksc = 1.0 - T_u / (Du * T_b);
            ent.AddDependencyValue(v.Tu, T_u);
            ent.Reference     = "AISC Formula J3-5a";
            ent.FormulaID     = f.J3_5.LRFD;
            ent.VariableValue = ksc.ToString();


            AddToLog(ent);

            return(ksc);
        }
        public double GetAvailableTensileStrength(double V)
        {
            double F_pp_nt = 0.0;
            double Fnt     = NominalTensileStress;
            double Fnv     = NominalShearStress;
            //double frv = GetRequiredShearStress();
            double Ab  = Area;
            double frv = V / Ab;
            double R   = 0.0;

            // check if interaction needs to be investigated:
            double f_available;


            f_available = 0.75 * Fnv;



            if (f_available * 0.3 > frv)
            {
                //interation need not be investigated
                return(0.75 * Fnt * Ab);
            }


            // interaction
            ICalcLogEntry ent = Log.CreateNewEntry();

            ent.ValueName = v.F_pp_nt;
            ent.AddDependencyValue(v.Fnt, Fnt);

            ent.DescriptionReference = d.F_pp_nt;
            AddToLog(ent);


            ent.Reference = "AISC Formula J3-3a";
            ent.FormulaID = f.J3_3.a;
            F_pp_nt       = 1.3 * Fnt - Fnt / (0.75 * Fnv) * frv;



            F_pp_nt = CheckMaximumAvailableTensileStrength(F_pp_nt);

            ent.VariableValue = F_pp_nt.ToString();


            ICalcLogEntry ent2 = Log.CreateNewEntry();

            ent2.AddDependencyValue(v.F_pp_nt, F_pp_nt);
            ent2.AddDependencyValue(v.Ab, Ab);
            ent2.Reference = "AISC Formula J3-2";


            ent2.DescriptionReference = d.phiRn.AvailableTensileStrengthForCombinedLoad;
            ent2.FormulaID            = f.J3_2.LRFD;
            R = 0.75 * F_pp_nt * Ab;

            ent2.ValueName     = v.R;
            ent2.VariableValue = R.ToString();
            AddToLog(ent2);


            return(R);
        }