0

我需要在 C# 中针对 t1 绘制 y1;这些是我的阵列。你能告诉我我该怎么做吗?我对 C# 很陌生,我不太了解它。谢谢这里是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Research.Oslo;


namespace odestiff
{
    class Program
    {
        static void Main(string[] args)
        {

            //solve the equations with Gear method
            var sol = Microsoft.Research.Oslo.Ode.GearBDF(
           0,
           new Vector(2, 0),
            (t, x) => new Vector(
            x[1],
            1000 * (1 - x[0]*x[0]) * x[1] - x[0])).TakeWhile(p => p.T <= 3000).ToArray();  //define the time span


            //// put results in an array
            double[] y1 = sol.Select(p => p.X[0]).ToArray();
            double[] t1 = sol.Select(p => p.T).ToArray();

        }
    }
}
4

1 回答 1

0

使用工具箱中的图表表单(在 Visual Studio 的左侧)

然后你可以像这样添加点

chart1.Series["SeriesName"].Points.AddXY(t1, y1);

下面是msdn的链接:

https://msdn.microsoft.com/en-us/library/dd489237.aspx

于 2017-11-22T05:50:34.293 回答