public void C1B_1ReturnsPositiveMomentAtX() { double L = 20; double w = 1.5; IAnalysisBeam bm = GetBeam(L, w); double X = L / 2; double M_x = bm.GetMoment(X); Assert.AreEqual(75, M_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 } }); }