当前位置: 首页>>代码示例>>C#>>正文


C# Function.GetSolve方法代码示例

本文整理汇总了C#中System.Function.GetSolve方法的典型用法代码示例。如果您正苦于以下问题:C# Function.GetSolve方法的具体用法?C# Function.GetSolve怎么用?C# Function.GetSolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Function的用法示例。


在下文中一共展示了Function.GetSolve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRungeKytSolves

        private void GetRungeKytSolves(Function func, InputData data, out List<double> x, out List<double> y)
        {
            double curX = data.X0;
            double curY = data.Y0;
            double h = data.H;

            x = new List<double>();
            y = new List<double>();

            while (Math.Round(curX, 10) <= data.RightLimit + h)
            {
                y.Add(curY);
                x.Add(curX);
                double K1 = h * func.GetSolve(curX, curY);
                double K2 = h * func.GetSolve(curX + h / 2, curY + K1 / 2);
                double K3 = h * func.GetSolve(curX + h / 2, curY + K2 / 2);
                double K4 = h * func.GetSolve(curX + h, curY + K3);
                curY = curY+1f/6f*(K1+2*K2+2*K3+K4);
                curX += data.H;
            }
        }
开发者ID:artalgame,项目名称:Labs,代码行数:21,代码来源:MainWindow.xaml.cs

示例2: GetEulerMSolves

        private void GetEulerMSolves(Function func, InputData data, out List<double> x, out List<double> y)
        {
            double curX = data.X0;
            double curY = data.Y0;
            x = new List<double>();
            y = new List<double>();

            while (Math.Round(curX, 10) <= data.RightLimit + data.H)
            {
                x.Add(curX);
                y.Add(curY);

                curY = curY + data.H * func.GetSolve(curX+data.H/2,
                    curY+(data.H/2)*func.GetSolve(curX,curY));

                curX += data.H;

            }
        }
开发者ID:artalgame,项目名称:Labs,代码行数:19,代码来源:MainWindow.xaml.cs

示例3: GetEulerSolves

        private void GetEulerSolves(Function func, InputData data, out List<double> x, out List<double> y)
        {
            double curX = data.X0;
            double curY = data.Y0;
            x = new List<double>();
            y = new List<double>();

            while (Math.Round(curX, 10) <= data.RightLimit + data.H)
            {
                y.Add(curY);
                x.Add(curX);

                curY = y[y.Count - 1] + data.H * func.GetSolve(x[x.Count - 1], y[y.Count - 1]);

                curX += data.H;
            }
        }
开发者ID:artalgame,项目名称:Labs,代码行数:17,代码来源:MainWindow.xaml.cs

示例4: GetAdamsSolves

        private void GetAdamsSolves(Function func, InputData data, out List<double> x, out List<double> y)
        {
            double curX = data.X0;
            double curY = data.Y0;
            x = new List<double>();
            y = new List<double>();
            x.Add(curX);
            y.Add(curY);

            double curPrevY = curY;
            double curPrevX = curX;

            double h = Math.Pow(data.H,2);
            //Calculate next y and x
            double K1 = h * func.GetSolve(curX, curY);
            double K2 = h * func.GetSolve(curX + h / 2, curY + K1 / 2);
            double K3 = h * func.GetSolve(curX + h / 2, curY + K2 / 2);
            double K4 = h * func.GetSolve(curX + h, curY + K3);
            curY = curY + 1f / 6f * (K1 + 2 * K2 + 2 * K3 + K4);
            curX += h;
            //--------------------------------
            h = data.H;

            while (Math.Round(curX, 10) <= data.RightLimit+h)
            {
                x.Add(curX);
                y.Add(curY);

                curY = curY + h * ((3f / 2) * func.GetSolve(curX, curY) - 0.5 * func.GetSolve(curPrevX, curPrevY));
                curX += h;

                curPrevX = x[x.Count-1];
                curPrevY = y[y.Count-1];
            }
        }
开发者ID:artalgame,项目名称:Labs,代码行数:35,代码来源:MainWindow.xaml.cs


注:本文中的System.Function.GetSolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。