コード例 #1
0
        public MultiStoermerEngine(Func <double, IList <double>, IList <double> > rhs, double x, IList <double> y, IList <double> yPrime, MultiOdeEvaluationSettings settings) : base(rhs, x, settings)
        {
            Debug.Assert(rhs != null);
            Debug.Assert(y != null);
            Debug.Assert(yPrime != null);
            Debug.Assert(settings != null);
            Debug.Assert(y.Count == yPrime.Count);

            dimension = y.Count;

            Y = new double[dimension];
            y.CopyTo(Y, 0);
            YPrime = new double[dimension];
            yPrime.CopyTo(YPrime, 0);

            YPrimePrime = new double[dimension];
            Evaluate(x, y).CopyTo(YPrimePrime, 0);

            ComputeInitialStep();

            yExtrapolators      = new NevilleExtrapolator[y.Count];
            yPrimeExtrapolators = new NevilleExtrapolator[yPrime.Count];
            for (int i = 0; i < y.Count; i++)
            {
                yExtrapolators[i]      = new NevilleExtrapolator(N.Length);
                yPrimeExtrapolators[i] = new NevilleExtrapolator(N.Length);
            }
        }
コード例 #2
0
 public MultiStoermerStepper(Func <double, IList <double>, IList <double> > rhs, double x0, IList <double> y0, IList <double> yp0, EvaluationSettings settings) : base(rhs, x0, y0, settings)
 {
     YPrime          = yp0;
     YPrimePrime     = rhs(x0, y0);
     DeltaX          = 1.0;
     yExtrapolators  = new NevilleExtrapolator[Dimension];
     ypExtrapolators = new NevilleExtrapolator[Dimension];
     for (int i = 0; i < Dimension; i++)
     {
         yExtrapolators[i]  = new NevilleExtrapolator(N.Length);
         ypExtrapolators[i] = new NevilleExtrapolator(N.Length);
     }
 }
コード例 #3
0
        public BulrischStoerStepper(Func <double, IList <double>, IList <double> > rhs, double x0, IList <double> y0, EvaluationSettings settings) : base(rhs, x0, y0, settings)
        {
            YPrime = Evaluate(x0, y0);
            //DeltaX = 1.0;
            DeltaX = 0.1;
            //ComputeInitialSetp();

            extrapolators = new NevilleExtrapolator[Dimension];
            for (int i = 0; i < Dimension; i++)
            {
                extrapolators[i] = new NevilleExtrapolator(N.Length);
            }
            errorExtrapolator = new NevilleExtrapolator(N.Length);
        }
コード例 #4
0
        public MultiBulrischStoerEngine(Func <double, IList <double>, IList <double> > rhs, double x, IList <double> y, MultiOdeEvaluationSettings settings) : base(rhs, x, settings)
        {
            Debug.Assert(rhs != null);
            Debug.Assert(y != null);
            Debug.Assert(settings != null);

            Y = new double[y.Count];
            y.CopyTo(Y, 0);
            YPrime = new double[y.Count];
            Evaluate(X, Y).CopyTo(YPrime, 0);
            ComputeInitialStep();

            extrapolators = new NevilleExtrapolator[y.Count];
            for (int i = 0; i < extrapolators.Length; i++)
            {
                extrapolators[i] = new NevilleExtrapolator(N.Length);
            }
        }