我需要在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();
}
}
}
使用工具箱中的图表表格(在Visual Studio的左侧)
然后您可以添加这样的点
chart1.Series["SeriesName"].Points.AddXY(t1, y1);
这是MSDN的链接:
https://msdn.microsoft.com/en-us/library/dd489237.aspx