/// <summary> /// Решает всё как надо, выдаёт массив погрешностей для границы (минимизируемый функционал) и вообще по области (цель решения задачи) /// </summary> /// <param name="n"></param> /// <param name="g"></param> /// <param name="cu"></param> /// <param name="SYSTEM"></param> /// <param name="SYSTEMQ"></param> /// <returns></returns> public static Tuple <double[], double[]> CreateAndSolve(int n, int g, int cu, SLAUpok SYSTEM = null, SLAUpok SYSTEMQ = null) { //"вход".Show(); ForDesigion.Building(n, g, cu, SYSTEM, SYSTEMQ); //"есть билд".Show(); var tmp = new BiharmonicEquation(); tmp.NevaskShow(); tmp.UltraHybrid(tmp.dim); tmp.BeeDown(-20, 20, 1000, tmp.dim - 1); return(new Tuple <double[], double[]>(tmp.ErrorsMasL, tmp.ErrorsMasQ)); }
public static Tuple <double[], double[], int[], Func <Point, double> > LastMethod2(int n, int g, int cu, SLAUpok SYSTEM = null, SLAUpok SYSTEMQ = null) { ForDesigion.Building(n, g, cu, SYSTEM, SYSTEMQ); double[] ErrorsMasL = new double[n], ErrorsMasQ = new double[n]; int[] Times = new int[n]; var tmp = new BiharmonicEquation(); double range = 200; Vectors old = Vectors.Union2(tmp.cnew, tmp.d); var r = BeeHiveAlgorithm.GetGlobalMin(tmp.F, 2 * n, -range, range, 1e-15, 1200, 60, old, -1); for (int t = 0; t < n; t++) { Functional fif = (Point x) => { double s = 0; for (int i = 0; i < t; i++) { s += tmp.cnew[i] * alpha(x, i) + tmp.d[i] * beta(x, i); } return(Math.Abs(s - KursMethods.U(x))); }; ErrorsMasQ[t] = IntegralClass.Integral(fif, CIRCLE - 1); ErrorsMasL[t] = tmp.F(Vectors.Union2(tmp.cnew.SubVector(t), tmp.d.SubVector(t))); } Func <Point, double> ff = (Point x) => { double s = 0; for (int i = 0; i < tmp.dim; i++) { s += tmp.cnew[i] * alpha(x, i) + tmp.d[i] * beta(x, i); } return(s); }; return(new Tuple <double[], double[], int[], Func <Point, double> >(ErrorsMasL, ErrorsMasQ, Times, ff)); }
public static void Test() { //ForDesigion.Building(10, 3, 3); //using (StreamWriter cir = new StreamWriter("Circles.txt")) //{ // for (int i = 0; i < CircleName.Length; i++) // cir.WriteLine(CircleName[i]); //} //using (StreamWriter fir = new StreamWriter("Functions.txt")) //{ // for (int i = 0; i < KursMethods.FuncName.Length - 1; i++) // fir.WriteLine(KursMethods.FuncName[i]); //} for (CIRCLE = 2; CIRCLE <= CountCircle; CIRCLE++) { for (GF = 1; GF <= KGF - 4; GF++) { //if (CIRCLE == 2) return; //var t = BiharmonicEquation.CreateAndSolve(30, GF, CIRCLE); $"Circle = {CIRCLE} \tGF = {GF}".Show(); ForDesigion.Building(40, GF, CIRCLE); var t = BiharmonicEquation.LastMethod(40, GF, CIRCLE); string s = $"C={CircleName[CIRCLE - 1]} f={FuncName[GF - 1]}.txt"; StreamWriter fs = new StreamWriter(s); for (int i = 0; i < masPoints.Length; i++) { fs.WriteLine($"{i + 1} {t.Item1[i]} {t.Item2[i]} {t.Item3[i]}"); } fs.Close(); } } System.Diagnostics.Process.Start("cmd", "/c shutdown -s -f -t 00"); }