Example #1
0
        public override TVector RightParts(TVector X, double t)
        {
            double  mus            = 132712440018;
            TVector objectVector   = new TVector(X.Vector.Take(X.Length() - 6).ToArray());
            TVector earthVector    = new TVector(X.Vector.Skip(X.Length() - 6).ToArray());
            TVector bufDecoratedRP = decorated.RightParts(objectVector, t);
            TVector bufEarthRP     = earth.RightParts(earthVector, t);
            TVector HelioVector    = Converter.GeoToHelio(objectVector.Take(3), earthVector.Take(3));
            double  distance       = HelioVector.Norm();
            double  R = Math.Pow(earthVector.Take(3).Norm(), 3);

            for (int i = 3; i < 6; i++)
            {
                bufDecoratedRP[i] += mus * (HelioVector[i - 3] / Math.Pow(distance, 3) - (earthVector[i - 3] / R));
            }
            return(bufDecoratedRP.Concat(bufEarthRP));
        }
Example #2
0
        public override TVector RightParts(TVector X, double t)
        {
            double muMoon = 4902.8000;

            TVector objectVector = new TVector(X.Vector.Take(X.Length() - 6)
                                               .ToArray());
            TVector moonVector = new TVector(X.Vector.Skip(X.Length() - 6)
                                             .Take(6)
                                             .ToArray());
            TVector bufDecoratedRP = decorated.RightParts(objectVector, t);
            TVector bufMoonRP      = moon.RightParts(moonVector, t);
            TVector delta          = moonVector.Take(3) - objectVector.Take(3);
            double  R        = moonVector.Take(3).Norm();
            double  distance = delta.Norm();

            for (int i = 3; i < 6; i++)
            {
                bufDecoratedRP[i] += muMoon * (delta[i - 3] / Math.Pow(distance, 3) - moonVector[i - 3] / Math.Pow(R, 3));
            }
            return(bufDecoratedRP.Concat(bufMoonRP));
        }