Beispiel #1
0
        void fillAll(Model mdl, PotterAlgorithm alg)
        {
            drtbYTrue.FillData(mdl.Y_True);
              plotMain.ClearGraphs();

              plotMain.AddGraph(new Graph(drtbYTrue.Verts, Color.Green, "True"));
              drtbYGen.FillData(mdl.Y);
              plotMain.AddGraph(new Graph(drtbYGen.Verts, Color.Red, "Generated"));
              drtbYFilter.FillData(alg.Yt);
              plotMain.AddGraph(new Graph(drtbYFilter.Verts, Color.Blue, "Filtered"));
              drtbX.FillDataX(mdl.X);
              addRisksX(plotMain);
              addRisksY(plotMain);

              plotMain.ReSize();

              plotMain.Draw();

              double dif = 0.0;
              for(int i=0; i<Model.CountObs; i++)
            dif += Math.Abs(mdl.Y_True[i, 0] - alg.Yt[i, 0]);

              tbxDiff.Text = "|Yf - Yt| = " + dif.ToString();
        }
Beispiel #2
0
 private void mmus(bool uConst, double amplitude, double[] x0Expected_, double r, double q, double p, double b, bool x1)
 {
     try {
     Model model = new Model(uConst, amplitude, x0Expected_,r,q,p,b,x1);
     PotterAlgorithm potter = new PotterAlgorithm(model);
     if (!potter.Work()) {
       MessageBox.Show("Алгоритм не работает.");
       return;
     }
     fillAll(model, potter);
       }
       catch (Exception ex) {
     MessageBox.Show(ex.Message, "Error!");
       }
 }