KeyValuePair double double alpha new KeyValuePair double double -1 bet

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
KeyValuePair<double, double> alpha = new KeyValuePair<double, double>(5.0, -1.3),
beta = new KeyValuePair<double, double>(0.61, 5.0);
double a = 2.8,
b = 3.4,
h = 0.05,
A = 4.0,
B = 3.0;
Matrix coeff = CollocationMethod.GetCoeff(alpha, beta, a, b, A, B);
double sigma = coeff[0, 0],
gamma = coeff[1, 0];
List<double> xValue = new List<double>(),
yValue = new List<double>(),
xX = new List<double>(new double[] { 2.85, 3.15, 3.25 }),
yCollocation = new List<double>(),
yFD = new List<double>(),
yReduction = new List<double>();
for (double x = a; x <= b; x += h) {
xValue.Add(x);
yValue.Add(GetExactSolution(x));
}
int n = xValue.Count;
for (int i = 0; i < n; ++i) {
yCollocation.Add(CollocationMethod.GetY(beta, a, b, xValue[i], sigma, gamma, xX));
}