Example #1
0
        public void C3A_2ReturnsNegativeMoment()
        {
            double        L  = 120;
            double        a  = L / 2.0;
            double        P  = 20;
            IAnalysisBeam bm = GetBeam(L, a, P);
            double        X  = L;

            double M_min = bm.GetMomentMinimum().Value;

            Assert.AreEqual(-3.0 * P * L / 16.0, M_min);
        }
Example #2
0
        public void C2A_1ReturnsNegativeMoment()
        {
            double        L  = 120;
            double        a  = 48;
            double        P  = -20;
            IAnalysisBeam bm = GetBeam(L, a, P);
            double        X  = L;

            double M_min = bm.GetMomentMinimum().Value;

            Assert.AreEqual(-48 * 20, M_min);
            //double M_x = bm.GetMoment(X);
            //double V_x = bm.GetShear(X);
            //
            //double M_min = bm.GetMomentMinimum();
            //double V_max = bm.GetShearMaximumValue();
        }
        public static Dictionary <string, object> BeamForces(string BeamForcesCaseId, double L, double X = 0, double P = 0, double M = 0, double w = 0, double a_load = 0, double b_load = 0, double c_load = 0, double P1 = 0, double P2 = 0, double M1 = 0, double M2 = 0)
        {
            //Default values
            double M_max = 0;
            double M_min = 0;
            double V_max = 0;
            double M_x   = 0;
            double V_x   = 0;


            //Calculation logic:


            BeamFactoryData        dat         = new BeamFactoryData(L, P, M, w, a_load, b_load, c_load, P1, P2, M1, M2);
            BeamLoadFactoryLocator loc         = new BeamLoadFactoryLocator();
            IBeamLoadFactory       loadFactory = loc.GetLoadFactory(BeamForcesCaseId, dat);
            LoadBeam            load           = loadFactory.GetLoad(BeamForcesCaseId);
            BeamInstanceFactory beamFactory    = new BeamInstanceFactory(dat);
            IAnalysisBeam       bm             = beamFactory.CreateBeamInstance(BeamForcesCaseId, load, null);


            M_x   = bm.GetMoment(X);
            V_x   = bm.GetShear(X);
            M_max = bm.GetMomentMaximum().Value;
            M_min = bm.GetMomentMinimum().Value;
            V_max = bm.GetShearMaximumValue().Value;

            return(new Dictionary <string, object>
            {
                { "M_max", M_max }
                , { "M_min", M_min }
                , { "V_max", V_max }
                , { "M_x", M_x }
                , { "V_x", V_x }
            });
        }