Ejemplo n.º 1
0
        public void TestIncrementNotSet()
        {
            var analysis = new E80Analysis();

            analysis.ImpactFactor = 1.0;
            analysis.DistFactor   = 1.0;
            analysis.Span         = 20;
            analysis.TrainType    = TrainConfig.E80;
            analysis.GetTrain();
            Assert.ThrowsException <MissingFieldException>(() => analysis.CalculateSingleLocation(10));
        }
Ejemplo n.º 2
0
        public void TestSpanNotSet()
        {
            // moment at span end should be zero
            var analysis = new E80Analysis();

            analysis.ImpactFactor    = 1.0;
            analysis.DistFactor      = 1.0;
            analysis.IncrementInches = 1;
            analysis.TrainType       = TrainConfig.E80;
            analysis.GetTrain();
            Assert.ThrowsException <MissingFieldException>(() => analysis.CalculateSingleLocation(10));
        }
Ejemplo n.º 3
0
        public void TestImpactAndDistNotSet()
        {
            // shouldn't throw an error
            var analysis = new E80Analysis();

            analysis.Span            = 20;
            analysis.IncrementInches = 1;
            analysis.TrainType       = TrainConfig.E80;
            analysis.GetTrain();
            Dictionary <string, double> vals;

            vals = analysis.CalculateSingleLocation(10);
            Assert.IsNotNull(vals);
        }
Ejemplo n.º 4
0
        public void TestE80ZeroMoment2()
        {
            // moment at span end should be zero
            var analysis = new E80Analysis();

            analysis.Span            = 20;
            analysis.ImpactFactor    = 1.0;
            analysis.DistFactor      = 1.0;
            analysis.IncrementInches = 1;
            analysis.TrainType       = TrainConfig.E80;
            analysis.GetTrain();
            Dictionary <string, double> vals = analysis.CalculateSingleLocation(analysis.Span);
            double expectedMaxMoment         = 0;
            double calculatedMaxMoment       = vals["m"];

            Assert.AreEqual(expectedMaxMoment, calculatedMaxMoment, 0.001);
        }
Ejemplo n.º 5
0
        public void TestE80MaxMoment()
        {
            // 20ft span, 412.5k (per AREMA 2017) per axle = 825k max moment at L/2 +/- 1.25ft (for 20ft = 11.25ft)
            // with 0.1% error allowance
            var analysis = new E80Analysis();

            analysis.Span            = 20;
            analysis.ImpactFactor    = 1.0;
            analysis.DistFactor      = 1.0;
            analysis.IncrementInches = 1;
            analysis.TrainType       = TrainConfig.E80;
            analysis.GetTrain();
            Dictionary <string, double> vals = analysis.CalculateSingleLocation(11.25);
            double expectedMaxMoment         = 825;
            double calculatedMaxMoment       = vals["m"];

            Assert.AreEqual(expectedMaxMoment, calculatedMaxMoment, 0.001);
        }
Ejemplo n.º 6
0
        public void TestThatMaxIsMax()
        {
            // 20ft span, max moment should occur at L/2 +/- 1.25ft (for 20ft = 11.25ft)
            var analysis = new E80Analysis();

            analysis.Span            = 20;
            analysis.ImpactFactor    = 1.0;
            analysis.DistFactor      = 1.0;
            analysis.IncrementInches = 1;
            analysis.TrainType       = TrainConfig.E80;
            analysis.GetTrain();
            Dictionary <string, double> vals = analysis.CalculateSingleLocation(11.25);
            double maxMoment = vals["m"];
            Dictionary <string, double> valsBefore = analysis.CalculateSingleLocation(11);
            double beforeMoment = valsBefore["m"];
            Dictionary <string, double> valsAfter = analysis.CalculateSingleLocation(11.5);
            double afterMoment = valsAfter["m"];

            Assert.IsTrue(maxMoment > beforeMoment && maxMoment > afterMoment);
        }