コード例 #1
0
        public void CatenaryTest()
        {
            Span s = new Span(new Vector2(15, 100), 300, 50);
            var  c = new Catenary(s, 1.15, 770);

            Assert.IsTrue(c.IsOK);
            Assert.IsTrue(s.Equals(c));
            Assert.AreEqual(1.15, c.CableWeight);
            Assert.AreEqual(770, c.HorizontalTension);

            Assert.AreEqual(669.5652, c.CatenaryConstant, 1e-4);
            CollectionAssert.AreEqual(new Vector2(54.832, 98.815), c.SagPoint, Extensions.AbsComparer(1e-3));
            Assert.AreEqual(98.8149, c.Clearance, 1e-4);
            CollectionAssert.AreEqual(new Vector2(-770, 45.833), c.StartTension, Extensions.AbsComparer(1e-3));
            CollectionAssert.AreEqual(new Vector2(770, 306.78), c.EndTension, Extensions.AbsComparer(1e-3));
            Assert.AreEqual(0.2240, c.Eta, 1e-4);
            Assert.AreEqual(0.8160, c.GeometricStrainPct, 1e-4);
            Assert.IsFalse(c.IsStartTowerUplift);
            Assert.IsFalse(c.IsEndTowerUplift);
            CollectionAssert.AreEqual(new Vector2(54.832, 98.815), c.LowestPosition, Extensions.AbsComparer(1e-3));
            Assert.AreEqual(17.1019, c.MaximumSag, 1e-4);
            Assert.AreEqual(17.1012, c.MidSag, 1e-4);
            Assert.AreEqual(306.6199, c.TotalLength, 1e-4);
            Assert.AreEqual(352.6128, c.TotalWeight, 1e-4);
        }
コード例 #2
0
        public void SetClearancePointTest()
        {
            var c     = new Catenary(new Vector2(15, 100), 300, 50, 1.15, 770);
            var point = new Vector2(50.0, 95.0);

            c.SetClearancePoint(point);
            var x      = point.X;
            var actual = new Vector2(x, c.CatenaryFunction(x));

            CollectionAssert.AreEqual(point, actual, Extensions.AbsComparer(1e-3));
        }