Ejemplo n.º 1
0
        public void Set(Cables cables, Points points, Acceleration a)
        {
            A = cables.SinA * DivSqrt(points.A.X, points.A.X.Squared() + points.A.Y.Squared());
            B = cables.SinB * DivSqrt(points.B.X, points.B.X.Squared() + MyMath.SD(L1, points.B.Y));
            C = cables.SinC * DivSqrt(L2 - points.C.X, MyMath.SD(L2, points.C.X) + MyMath.SD(L1, points.C.Y));
            D = cables.SinD * DivSqrt(L2 - points.D.X, points.D.Y.Squared() + MyMath.SD(L2, points.D.X));

            E = cables.SinA * DivSqrt(points.A.Y, points.A.X.Squared() + points.A.Y.Squared());
            F = cables.SinB * DivSqrt(points.B.Y, points.B.X.Squared() + MyMath.SD(L1, points.B.Y));
            G = cables.SinC * DivSqrt(L1 - points.C.Y, MyMath.SD(L2, points.C.X) + MyMath.SD(L1, points.C.Y));
            H = cables.SinD * DivSqrt(points.D.Y, points.D.Y.Squared() + MyMath.SD(L2, points.D.X));

            I = cables.SinA * DivSqrt(points.A.X * l1 - points.A.Y * l2, points.A.X.Squared() + points.A.Y.Squared()) * 0.5;
            J = cables.SinB * DivSqrt(points.B.X * l1 + points.B.Y * l2, points.B.X.Squared() + MyMath.SD(L1, points.B.Y)) * 0.5;
            var k1 = (L1 - points.C.Y) * l2 - (L2 - points.C.X) * l1;

            K = cables.SinC * DivSqrt(k1, MyMath.SD(L2, points.C.X) + MyMath.SD(L1, points.C.Y)) * 0.5;
            var l = (L2 - points.D.X) * l1 + points.D.Y * l2;

            L = cables.SinD * DivSqrt(l, points.D.Y.Squared() + MyMath.SD(L2, points.D.X)) * 0.5;

            var div = B * E + A * F;

            M = (C * E - A * G) / div;
            N = (D * E + A * H) / div;
            O = (a.X * E - a.Y * A) / div;
            P = (C * F + G * B) / div;
            R = (D * F - H * B) / div;
            S = (a.X * F + a.Y * B) / div;
        }
Ejemplo n.º 2
0
 public void Reset()
 {
     current    = null;
     cables     = new Cables(inputdata.L1, inputdata.L2, inputdata.l1, inputdata.l2, inputdata.H);
     accel      = new Acceleration(start, finish, t1, t2, inputdata.as_, inputdata.af);
     points     = new Points(inputdata.l1, inputdata.l2);
     vars       = new AuxiliaryVariables(inputdata.L1, inputdata.L2, inputdata.l1, inputdata.l2);
     prevCables = null;
 }
Ejemplo n.º 3
0
        public double GetPower(double t)
        {
            if (doStepInPower)
            {
                NextPosition(t);
            }
            var power = prevCables == null ? 0 : GetPowerForCurrent(t);

            prevCables = cables.Copy();
            return(power);
        }