示例#1
0
文件: RKSolOut.cs 项目: olesar/Altaxo
        internal void Initialize(double[] y0, double[] tspan, OdeSolution solution)
        {
            _SolutionOutType = SolutionOutType.Delegate;
            InitializeValues(y0, tspan);

            _SolutionOut = solution;
        }
示例#2
0
文件: RKSolOut.cs 项目: olesar/Altaxo
        internal void Initialize(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            _SolutionOutType = SolutionOutType.Delegate;
            InitializeValues(y0, t0, deltaT, tf);

            _SolutionOut = solution;
        }
示例#3
0
        /// <summary>
        ///  Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions ( at t0). N is the number of differential equations.</param>
        /// <param name="tspan">A vector specifying the interval of integration (t0,..,tf).</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double[] tspan, OdeSolution solution)
        {
            CheckTArray(tspan);

            base.SetInitialValues(tspan[0], y0);

            MeTf = tspan[tspan.Length - 1];

            _RKSolOut.Initialize(y0, tspan, solution);

            Solve();
        }
示例#4
0
        /// <summary>
        /// Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions. N is the number of differential equations.</param>
        /// <param name="t0">The initial independent variable value.</param>
        /// <param name="deltaT">The step for the interval of integration (t0, t0+deltaT, t0+2*deltaT,...,tf).</param>
        /// <param name="tf">The final independent variable value.</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            CheckArguments(t0, deltaT, tf);

            base.SetInitialValues(t0, y0);

            MeTf = tf;

            _RKSolOut.Initialize(y0, t0, deltaT, tf, solution);

            Solve();
        }
        /// <summary>
        ///  Computes the solution of the differential equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions ( at t0). N is the number of differential equations.</param>
        /// <param name="tspan">A vector specifying the interval of integration (t0,..,tf).</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double[] tspan, OdeSolution solution)
        {
            CheckTArray(tspan);

            base.SetInitialValues(tspan[0], y0);

            double[] tempY;

            double time = 0;

            for (int i = 0; i < tspan.Length; i++)
            {
                time = tspan[i];

                tempY = Solve(time);

                solution(time, tempY);
            }
        }
        /// <summary>
        /// Computes the solution of the differential equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions. N is the number of differential equations.</param>
        /// <param name="t0">The initial independent variable value.</param>
        /// <param name="deltaT">The step for the interval of integration (t0, t0+deltaT, t0+2*deltaT,...,tf).</param>
        /// <param name="tf">The final independent variable value.</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            CheckArguments(t0, deltaT, tf);

            SetInitialValues(t0, y0);

            int maxIndex = (int)(Math.Abs(tf - t0) / Math.Abs(deltaT)) + 1;

            double[] tempY;
            double   time = t0;

            for (int i = 0; i < maxIndex; i++)
            {
                tempY = Solve(time);

                solution(time, tempY);

                time += deltaT;
            }
        }
        /// <summary>
        ///  Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions ( at t0). N is the number of differential equations.</param>
        /// <param name="tspan">A vector specifying the interval of integration (t0,..,tf).</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double[] tspan, OdeSolution solution)
        {
            this.CheckTArray(tspan);

            base.SetInitialValues(tspan[0], y0);

            double[] tempY;

            double time = 0;

            for (int i = 0; i < tspan.Length; i++)
            {
                time = tspan[i];

                tempY = this.Solve(time);

                solution(time, tempY);
            }
        }
        /// <summary>
        /// Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions. N is the number of differential equations.</param>
        /// <param name="t0">The initial independent variable value.</param>
        /// <param name="deltaT">The step for the interval of integration (t0, t0+deltaT, t0+2*deltaT,...,tf).</param>
        /// <param name="tf">The final independent variable value.</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            this.CheckArguments(t0, deltaT, tf);

            this.SetInitialValues(t0, y0);

            int maxIndex = (int)(Math.Abs(tf - t0) / Math.Abs(deltaT)) + 1;

            double[] tempY;
            double time = t0;

            for (int i = 0; i < maxIndex; i++)
            {
                tempY = this.Solve(time);

                solution(time, tempY);

                time += deltaT;
            }
        }
示例#9
0
        internal void Initialize(double[] y0, double[] tspan, OdeSolution solution)
        {
            this._SolutionOutType = SolutionOutType.Delegate;
            this.InitializeValues(y0, tspan);

            this._SolutionOut = solution;
        }
示例#10
0
        internal void Initialize(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            this._SolutionOutType = SolutionOutType.Delegate;
            this.InitializeValues(y0, t0, deltaT, tf);

            this._SolutionOut = solution;
        }
示例#11
0
        /// <summary>
        ///  Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions ( at t0). N is the number of differential equations.</param>
        /// <param name="tspan">A vector specifying the interval of integration (t0,..,tf).</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double[] tspan, OdeSolution solution)
        {
            this.CheckTArray(tspan);

            base.SetInitialValues(tspan[0], y0);

            this.MeTf = tspan[tspan.Length - 1];

            this._RKSolOut.Initialize(y0, tspan, solution);

            this.Solve();
        }
示例#12
0
        /// <summary>
        /// Computes the solution of the differntial equations.
        /// </summary>
        /// <param name="y0">A vector of size N containing the initial conditions. N is the number of differential equations.</param>
        /// <param name="t0">The initial independent variable value.</param>
        /// <param name="deltaT">The step for the interval of integration (t0, t0+deltaT, t0+2*deltaT,...,tf).</param>
        /// <param name="tf">The final independent variable value.</param>
        /// <param name="solution">A delegate where to return the solution.</param>
        public void Solve(double[] y0, double t0, double deltaT, double tf, OdeSolution solution)
        {
            this.CheckArguments(t0, deltaT, tf);

            base.SetInitialValues(t0, y0);

            this.MeTf = tf;

            this._RKSolOut.Initialize(y0, t0, deltaT, tf, solution);

            this.Solve();
        }