Пример #1
0
        public void DoWork()
        {
            Parallel.For (0, betasteps+1,ibeta=>
            {
                double beta = betamin + ibeta * (betamax - betamin) / betasteps;

                //RMS
                NumIterator rmsIterator = new NumIterator(adjmatrix, beta, sigma, delta,pertubation);
                rmsIterator.noise = noise;
                double[] rms = new double[cluster.Length];
                rmsIterator.iterate(pre);
                for (int itime = 0; itime < rec; itime++)
                {
                    rmsIterator.iterate();
                    for (int icluster = 0; icluster < cluster.Length; icluster++)
                    {
                        rms[icluster] += MS(rmsIterator.xt.Last())[icluster];
                    }
                }
                for (int i = 0; i < rms.Length; i++)
                {
                    rms[i] /= rec;
                    rms[i] = Math.Sqrt(rms[i]);
                }

                //Ljapunow
                double[] ljapunow = new double[cluster.Length];
                //synchrone orbits berechnen

                NumIterator smIterator = new NumIterator(adjmatrix, beta, sigma, delta,pertubation);
                smIterator.iterate(pre + rec);

                List<double[]> transDoneSynchManifolds = smIterator.xt.GetRange(pre, rec);

                List<double[]> smts = new List<double[]>();
                for (int i = 0; i < transDoneSynchManifolds.Count; i++)
                {
                    double[] add = new double[cluster.Length];
                    for (int j = 0; j < cluster.Length; j++)
                    {
                        int node0 = cluster[j][0];
                        add[j] = transDoneSynchManifolds[i][node0];
                    }
                    smts.Add(add);
                }

                ljapunow = ljapunow.Add(Double.MinValue);

                for (int m = 0; m < clusterTransform.Length; m++)
                {
                    for (int i = 0; i < clusterTransform[m].Length; i++)
                    {
                        int etanodenum = clusterTransform[m][i];
                        if (etanodenum >= clusterTransform.Length) // unterer Block
                        {
                            Ljapunator punator = new Ljapunator(JMats, BMat, cluster.Length, smts, beta, sigma, delta);
                            punator.etat[0][etanodenum] = pertubation;
                            punator.iterate(rec);
                            ljapunow[m] = Math.Max(punator.ljapunowSum / (double)rec, ljapunow[m]);

                    }
                }
                }

                result ret_result = new result(beta, rms, ljapunow);
                callback(ret_result);

            });
        }
Пример #2
0
        private void iterator_init()
        {
            if (graph_loaded)
            {
                foreach (Series serie in gseries)
                {
                    serie.Points.Clear();
                }

                iterator = new NumIterator(adjmatrix, beta, sigma, delta, pertubation);
                iterator.noise = noise;
                double[] xs = iterator.xt[iterator.xt.Count - 1];

                for (int i = 0; i < xs.Length; i++)
                {
                    vertices[i].Value = (xs[i] / (2.0 * Math.PI));
                }
                rmsChart.ChartAreas[0].AxisY.ScaleView.ZoomReset();
            }
        }